shelving 1.150.7 → 1.150.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -14,6 +14,8 @@ export declare class DictionaryStore<T> extends Store<ImmutableDictionary<T>> im
|
|
|
14
14
|
get(name: string): T | undefined;
|
|
15
15
|
/** Set an item in this dictionary. */
|
|
16
16
|
set(name: string, value: T): void;
|
|
17
|
+
/** Delete an item in this dictionary. */
|
|
18
|
+
delete(name: string): void;
|
|
17
19
|
/** Iterate over the entries of the object. */
|
|
18
20
|
[Symbol.iterator](): Iterator<DictionaryItem<T>>;
|
|
19
21
|
}
|
package/store/DictionaryStore.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDictionaryItems, omitDictionaryItems } from "../util/dictionary.js";
|
|
2
|
-
import { withProp } from "../util/object.js";
|
|
2
|
+
import { omitProps, withProp } from "../util/object.js";
|
|
3
3
|
import { updateData } from "../util/update.js";
|
|
4
4
|
import { Store } from "./Store.js";
|
|
5
5
|
/** Store a dictionary object. */
|
|
@@ -27,6 +27,10 @@ export class DictionaryStore extends Store {
|
|
|
27
27
|
set(name, value) {
|
|
28
28
|
this.value = withProp(this.value, name, value);
|
|
29
29
|
}
|
|
30
|
+
/** Delete an item in this dictionary. */
|
|
31
|
+
delete(name) {
|
|
32
|
+
this.value = omitProps(this.value, name);
|
|
33
|
+
}
|
|
30
34
|
/** Iterate over the entries of the object. */
|
|
31
35
|
[Symbol.iterator]() {
|
|
32
36
|
return getDictionaryItems(this.value)[Symbol.iterator]();
|