asJsDictionary, asKeyedDictionary
This commit is contained in:
parent
9ecbd0bdd1
commit
7657952993
|
@ -211,6 +211,16 @@ export class DictionaryMap<T extends Embeddable = GenericEmbedded, V = Value<T>>
|
|||
this.simplify();
|
||||
return this.value;
|
||||
}
|
||||
|
||||
asJsDictionary(): JsDictionary<V> {
|
||||
this.simplify();
|
||||
if (!this.j) throw new Error("Cannot represent general dictionary as JsDictionary");
|
||||
return this.j;
|
||||
}
|
||||
|
||||
asKeyedDictionary(): KeyedDictionary<T, Value<T>, V> {
|
||||
return this.k ?? new KeyedDictionary<T, Value<T>, V>(JsDictionary.entries(this.j!));
|
||||
}
|
||||
}
|
||||
|
||||
export namespace Dictionary {
|
||||
|
|
Loading…
Reference in New Issue