shelving 1.28.0 → 1.29.0

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/api/Resource.js CHANGED
@@ -1,4 +1,4 @@
1
- import { UNDEFINED, validate } from "../util/index.js";
1
+ import { GET_UNDEFINED, validate } from "../util/index.js";
2
2
  import { Feedback } from "../feedback/index.js";
3
3
  import { ResourceValidationError } from "./errors.js";
4
4
  /**
@@ -37,6 +37,6 @@ export class Resource {
37
37
  }
38
38
  }
39
39
  }
40
- export function RESOURCE(payload = UNDEFINED, result = UNDEFINED) {
40
+ export function RESOURCE(payload = GET_UNDEFINED, result = GET_UNDEFINED) {
41
41
  return new Resource(payload, result);
42
42
  }
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "state-management",
12
12
  "query-builder"
13
13
  ],
14
- "version": "1.28.0",
14
+ "version": "1.29.0",
15
15
  "repository": "https://github.com/dhoulb/shelving",
16
16
  "author": "Dave Houlbrooke <dave@shax.com>",
17
17
  "license": "0BSD",
package/util/null.d.ts CHANGED
@@ -3,7 +3,7 @@ export declare const IS_NULL: (v: unknown) => v is null;
3
3
  /** Is a value not null? */
4
4
  export declare const NOT_NULL: <T>(v: T | null) => v is T;
5
5
  /** Function that always returns null. */
6
- export declare const NULL: () => null;
6
+ export declare const GET_NULL: () => null;
7
7
  /** Nullish is `null` or `undefined` */
8
8
  export declare type Nullish<T> = T | null | undefined;
9
9
  /** Nullish is `null` or `undefined` */
package/util/null.js CHANGED
@@ -4,7 +4,7 @@ export const IS_NULL = (v) => v === null;
4
4
  /** Is a value not null? */
5
5
  export const NOT_NULL = (v) => v !== null;
6
6
  /** Function that always returns null. */
7
- export const NULL = () => null;
7
+ export const GET_NULL = () => null;
8
8
  /** Is a value nullish? */
9
9
  export const IS_NULLISH = (v) => v === null || v === undefined;
10
10
  /** Is a value nullish? */
package/util/object.d.ts CHANGED
@@ -87,3 +87,11 @@ export declare function deleteEntry<T>(obj: MutableObject<T>, key: string, value
87
87
  * @param entries Set of keys or entries to remove.
88
88
  */
89
89
  export declare function deleteEntries<T>(obj: MutableObject<T>, keys: ImmutableArray<string>): void;
90
+ /** Type that represents an empty object. */
91
+ export declare type EmptyObject = {
92
+ readonly [K in never]: never;
93
+ };
94
+ /** An empty object. */
95
+ export declare const EMPTY_OBJECT: EmptyObject;
96
+ /** Function that returns an an empty object. */
97
+ export declare const GET_EMPTY_OBJECT: () => EmptyObject;
package/util/object.js CHANGED
@@ -98,3 +98,7 @@ export function deleteEntries(obj, keys) {
98
98
  for (const key of keys)
99
99
  delete obj[key];
100
100
  }
101
+ /** An empty object. */
102
+ export const EMPTY_OBJECT = {};
103
+ /** Function that returns an an empty object. */
104
+ export const GET_EMPTY_OBJECT = () => EMPTY_OBJECT;
@@ -4,6 +4,4 @@ export declare const IS_UNDEFINED: (v: unknown) => v is undefined;
4
4
  export declare const IS_DEFINED: <T>(v: T | undefined) => v is T;
5
5
  export declare const NOT_UNDEFINED: <T>(v: T | undefined) => v is T;
6
6
  /** Function that always returns undefined. */
7
- export declare const UNDEFINED: () => undefined;
8
- /** Function that always returns void. */
9
- export declare const VOID: () => void;
7
+ export declare const GET_UNDEFINED: () => undefined;
package/util/undefined.js CHANGED
@@ -4,6 +4,4 @@ export const IS_UNDEFINED = (v) => v === undefined;
4
4
  export const IS_DEFINED = (v) => v !== undefined;
5
5
  export const NOT_UNDEFINED = IS_DEFINED;
6
6
  /** Function that always returns undefined. */
7
- export const UNDEFINED = () => undefined;
8
- /** Function that always returns void. */
9
- export const VOID = UNDEFINED;
7
+ export const GET_UNDEFINED = () => undefined;