@superutils/store 0.1.19 → 0.1.20

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/dist/index.cjs CHANGED
@@ -378,7 +378,8 @@ function createObjectStore(options, context) {
378
378
  initialValue: !(0, import_core3.isObj)(options == null ? void 0 : options.initialValue, true) ? options == null ? void 0 : options.initialValue : (0, import_core3.objToMap)(options.initialValue)
379
379
  };
380
380
  const store = createStore_default(
381
- ...[options, context]
381
+ options,
382
+ context
382
383
  );
383
384
  store.type = "object";
384
385
  const setAll = store.setAll.bind(store);
package/dist/index.d.cts CHANGED
@@ -102,7 +102,7 @@ type Store_Stringify<Data, ThisArg> = (this: ThisArg, data: Data) => string | un
102
102
  type Store_ToJSON<K, V> = (replacer?: null | ((key: K, value: V) => unknown), spacing?: string | number, data?: Map<K, V>) => string;
103
103
 
104
104
  /** Store properties accepted in {@link Store_Options} */
105
- type Store_OptionKeys = 'cacheDisabled' | 'delay' | 'delayOptions' | 'name' | 'onChange' | 'onError' | 'parse' | 'spaces' | 'storage' | 'stringify' | 'validate';
105
+ type Store_OptionKeys = 'cacheDisabled' | 'name' | 'onChange' | 'onError' | 'parse' | 'spaces' | 'storage' | 'stringify' | 'validate';
106
106
  /**
107
107
  * Configuration options for initializing {@link IStore} instances.
108
108
  *
@@ -127,10 +127,10 @@ type Store_Options<Key = unknown, Value = unknown, CacheDisabled extends boolean
127
127
  * Default: `undefined`
128
128
  */
129
129
  initialValue?: Map<Key, Value>;
130
- } & Pick<Partial<IStore<Key, Value, CacheDisabled>>, Store_OptionKeys> & (CacheDisabled extends false ? Pick<Partial<IStore<Key, Value, CacheDisabled>>, 'delay' | 'delayOptions'> : {
130
+ } & Partial<Pick<IStore<Key, Value, CacheDisabled>, Store_OptionKeys> & (CacheDisabled extends false ? Pick<IStore<Key, Value, CacheDisabled>, 'delay' | 'delayOptions'> : {
131
131
  delay?: never;
132
132
  delayOptions?: never;
133
- });
133
+ })>;
134
134
  /**
135
135
  * Represents a generic, reactive, and persistent Map-like data store.
136
136
  *
@@ -483,10 +483,10 @@ type ObjectStore_Options<T extends object = Record<PropertyKey, unknown>, CacheD
483
483
  * Default: `undefined`
484
484
  */
485
485
  initialValue?: T;
486
- } & Pick<Partial<IObjectStore<T, CacheDisabled>>, Store_OptionKeys> & (CacheDisabled extends false ? Pick<Partial<IObjectStore<T, CacheDisabled>>, 'delay' | 'delayOptions'> : {
486
+ } & Partial<Pick<IObjectStore<T, CacheDisabled>, Store_OptionKeys> & (CacheDisabled extends false ? Pick<IObjectStore<T, CacheDisabled>, 'delay' | 'delayOptions'> : {
487
487
  delay?: never;
488
488
  delayOptions?: never;
489
- });
489
+ })>;
490
490
 
491
491
  declare module './IStore' {
492
492
  interface IStore<Key, Value, CD extends boolean = false> {
@@ -824,7 +824,7 @@ declare const OPTIONAL_STORE_PROPS: readonly ["delayOptions", "name", "onChange"
824
824
  * )
825
825
  *```
826
826
  */
827
- declare function createStore<Context extends object | ((store: IStore<Key, Value, CacheDisabled>) => object), Key, Value, CacheDisabled extends boolean = false>(options: undefined | null | Store_Options<Key, Value, CacheDisabled>, context: Context & ContextValidate<Context, IStore<Key, Value, CacheDisabled>>): IStore<Key, Value, CacheDisabled> & ContextReturn<Context>;
827
+ declare function createStore<Context extends object | ((store: IStore<Key, Value, CacheDisabled>) => object), Key, Value, CacheDisabled extends boolean>(options: undefined | null | Store_Options<Key, Value, CacheDisabled>, context: Context & ContextValidate<Context, IStore<Key, Value, CacheDisabled>>): IStore<Key, Value, CacheDisabled> & ContextReturn<Context>;
828
828
  declare function createStore<Key, Value, CacheDisabled extends boolean = false>(options?: Store_Options<Key, Value, CacheDisabled>): IStore<Key, Value, CacheDisabled>;
829
829
 
830
830
  /**
package/dist/index.d.ts CHANGED
@@ -102,7 +102,7 @@ type Store_Stringify<Data, ThisArg> = (this: ThisArg, data: Data) => string | un
102
102
  type Store_ToJSON<K, V> = (replacer?: null | ((key: K, value: V) => unknown), spacing?: string | number, data?: Map<K, V>) => string;
103
103
 
104
104
  /** Store properties accepted in {@link Store_Options} */
105
- type Store_OptionKeys = 'cacheDisabled' | 'delay' | 'delayOptions' | 'name' | 'onChange' | 'onError' | 'parse' | 'spaces' | 'storage' | 'stringify' | 'validate';
105
+ type Store_OptionKeys = 'cacheDisabled' | 'name' | 'onChange' | 'onError' | 'parse' | 'spaces' | 'storage' | 'stringify' | 'validate';
106
106
  /**
107
107
  * Configuration options for initializing {@link IStore} instances.
108
108
  *
@@ -127,10 +127,10 @@ type Store_Options<Key = unknown, Value = unknown, CacheDisabled extends boolean
127
127
  * Default: `undefined`
128
128
  */
129
129
  initialValue?: Map<Key, Value>;
130
- } & Pick<Partial<IStore<Key, Value, CacheDisabled>>, Store_OptionKeys> & (CacheDisabled extends false ? Pick<Partial<IStore<Key, Value, CacheDisabled>>, 'delay' | 'delayOptions'> : {
130
+ } & Partial<Pick<IStore<Key, Value, CacheDisabled>, Store_OptionKeys> & (CacheDisabled extends false ? Pick<IStore<Key, Value, CacheDisabled>, 'delay' | 'delayOptions'> : {
131
131
  delay?: never;
132
132
  delayOptions?: never;
133
- });
133
+ })>;
134
134
  /**
135
135
  * Represents a generic, reactive, and persistent Map-like data store.
136
136
  *
@@ -483,10 +483,10 @@ type ObjectStore_Options<T extends object = Record<PropertyKey, unknown>, CacheD
483
483
  * Default: `undefined`
484
484
  */
485
485
  initialValue?: T;
486
- } & Pick<Partial<IObjectStore<T, CacheDisabled>>, Store_OptionKeys> & (CacheDisabled extends false ? Pick<Partial<IObjectStore<T, CacheDisabled>>, 'delay' | 'delayOptions'> : {
486
+ } & Partial<Pick<IObjectStore<T, CacheDisabled>, Store_OptionKeys> & (CacheDisabled extends false ? Pick<IObjectStore<T, CacheDisabled>, 'delay' | 'delayOptions'> : {
487
487
  delay?: never;
488
488
  delayOptions?: never;
489
- });
489
+ })>;
490
490
 
491
491
  declare module './IStore' {
492
492
  interface IStore<Key, Value, CD extends boolean = false> {
@@ -824,7 +824,7 @@ declare const OPTIONAL_STORE_PROPS: readonly ["delayOptions", "name", "onChange"
824
824
  * )
825
825
  *```
826
826
  */
827
- declare function createStore<Context extends object | ((store: IStore<Key, Value, CacheDisabled>) => object), Key, Value, CacheDisabled extends boolean = false>(options: undefined | null | Store_Options<Key, Value, CacheDisabled>, context: Context & ContextValidate<Context, IStore<Key, Value, CacheDisabled>>): IStore<Key, Value, CacheDisabled> & ContextReturn<Context>;
827
+ declare function createStore<Context extends object | ((store: IStore<Key, Value, CacheDisabled>) => object), Key, Value, CacheDisabled extends boolean>(options: undefined | null | Store_Options<Key, Value, CacheDisabled>, context: Context & ContextValidate<Context, IStore<Key, Value, CacheDisabled>>): IStore<Key, Value, CacheDisabled> & ContextReturn<Context>;
828
828
  declare function createStore<Key, Value, CacheDisabled extends boolean = false>(options?: Store_Options<Key, Value, CacheDisabled>): IStore<Key, Value, CacheDisabled>;
829
829
 
830
830
  /**
package/dist/index.js CHANGED
@@ -363,7 +363,8 @@ function createObjectStore(options, context) {
363
363
  initialValue: !isObj2(options == null ? void 0 : options.initialValue, true) ? options == null ? void 0 : options.initialValue : objToMap(options.initialValue)
364
364
  };
365
365
  const store = createStore_default(
366
- ...[options, context]
366
+ options,
367
+ context
367
368
  );
368
369
  store.type = "object";
369
370
  const setAll = store.setAll.bind(store);
package/package.json CHANGED
@@ -45,6 +45,6 @@
45
45
  "sideEffects": false,
46
46
  "type": "module",
47
47
  "types": "./dist/index.d.ts",
48
- "version": "0.1.19",
49
- "gitHead": "35722628393f7eface789fea15e80e521c509831"
48
+ "version": "0.1.20",
49
+ "gitHead": "1eaf1057e194280f774e6e7576b0095cdda11d92"
50
50
  }