shelving 1.49.1 → 1.49.2

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
@@ -11,7 +11,7 @@
11
11
  "state-management",
12
12
  "query-builder"
13
13
  ],
14
- "version": "1.49.1",
14
+ "version": "1.49.2",
15
15
  "repository": "https://github.com/dhoulb/shelving",
16
16
  "author": "Dave Houlbrooke <dave@shax.com>",
17
17
  "license": "0BSD",
@@ -13,8 +13,8 @@ export declare type Dispatcher<T extends Arguments = []> = (...value: T) => void
13
13
  /** Function that receives a dispatched value. */
14
14
  export declare type AsyncDispatcher<T extends Arguments = []> = (...value: T) => void | PromiseLike<void>;
15
15
  /** Safely dispatch a value to a dispatcher function. */
16
- export declare function dispatch<T extends Arguments>(dispatcher: Dispatcher<T> | AsyncDispatcher<T>, ...value: T): void;
16
+ export declare function dispatch<T extends Arguments>(dispatcher: AsyncDispatcher<T>, ...value: T): void;
17
17
  /** Safely dispatch a value to a dispatcher method on an object. */
18
18
  export declare function dispatchMethod<T extends Arguments, M extends string | symbol>(obj: {
19
- [K in M]: Dispatcher<T> | AsyncDispatcher<T>;
19
+ [K in M]: AsyncDispatcher<T>;
20
20
  }, key: M, ...value: T): void;
package/util/number.js CHANGED
@@ -17,7 +17,7 @@ export const isNumber = (v) => typeof v === "number";
17
17
  */
18
18
  export function toNumber(value) {
19
19
  if (typeof value === "number")
20
- return Number.isFinite(value) ? value : null;
20
+ return !Number.isFinite(value) ? null : value === 0 ? 0 : value;
21
21
  else if (typeof value === "string")
22
22
  return toNumber(parseFloat(value.replace(NUMERIC, "")));
23
23
  else if (value instanceof Date)