react-hooks-global-states 16.0.0 → 16.0.1

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.
Files changed (46) hide show
  1. package/jest.config.js +50 -0
  2. package/package.json +52 -2
  3. package/GlobalStore.cjs +0 -525
  4. package/GlobalStore.d.ts +0 -160
  5. package/GlobalStore.debugProps.cjs +0 -28
  6. package/GlobalStore.debugProps.d.ts +0 -5
  7. package/GlobalStore.debugProps.js +0 -28
  8. package/GlobalStore.debugProps.mjs +0 -7
  9. package/GlobalStore.js +0 -525
  10. package/GlobalStore.mjs +0 -497
  11. package/actions.cjs +0 -61
  12. package/actions.d.ts +0 -32
  13. package/actions.js +0 -61
  14. package/actions.mjs +0 -30
  15. package/bundle.cjs +0 -40
  16. package/bundle.js +0 -40
  17. package/bundle.mjs +0 -19
  18. package/createContext.cjs +0 -253
  19. package/createContext.d.ts +0 -15
  20. package/createContext.js +0 -253
  21. package/createContext.mjs +0 -235
  22. package/createGlobalState.cjs +0 -29
  23. package/createGlobalState.d.ts +0 -7
  24. package/createGlobalState.js +0 -29
  25. package/createGlobalState.mjs +0 -8
  26. package/index.d.ts +0 -9
  27. package/isRecord.cjs +0 -46
  28. package/isRecord.d.ts +0 -2
  29. package/isRecord.js +0 -46
  30. package/isRecord.mjs +0 -15
  31. package/shallowCompare.cjs +0 -115
  32. package/shallowCompare.d.ts +0 -52
  33. package/shallowCompare.js +0 -115
  34. package/shallowCompare.mjs +0 -84
  35. package/throwWrongKeyOnActionCollectionConfig.cjs +0 -41
  36. package/throwWrongKeyOnActionCollectionConfig.d.ts +0 -2
  37. package/throwWrongKeyOnActionCollectionConfig.js +0 -41
  38. package/throwWrongKeyOnActionCollectionConfig.mjs +0 -20
  39. package/types.cjs +0 -18
  40. package/types.d.ts +0 -1250
  41. package/types.js +0 -18
  42. package/types.mjs +0 -0
  43. package/uniqueId.cjs +0 -72
  44. package/uniqueId.d.ts +0 -7
  45. package/uniqueId.js +0 -72
  46. package/uniqueId.mjs +0 -51
package/types.js DELETED
@@ -1,18 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types.ts
17
- var types_exports = {};
18
- module.exports = __toCommonJS(types_exports);
package/types.mjs DELETED
File without changes
package/uniqueId.cjs DELETED
@@ -1,72 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/uniqueId.ts
21
- var uniqueId_exports = {};
22
- __export(uniqueId_exports, {
23
- default: () => uniqueId_default,
24
- uniqueId: () => uniqueId
25
- });
26
- module.exports = __toCommonJS(uniqueId_exports);
27
- var uniqueId = (() => {
28
- let $counter = 0;
29
- const counter = () => {
30
- if ($counter === Number.MAX_SAFE_INTEGER) $counter = 0;
31
- return $counter++;
32
- };
33
- const getBrandedId = (prefix, base) => {
34
- var _a;
35
- if ((_a = globalThis.crypto) == null ? void 0 : _a.randomUUID)
36
- return (prefix != null ? prefix : "") + globalThis.crypto.randomUUID();
37
- return (prefix != null ? prefix : "") + Date.now().toString(36) + base.toString(36);
38
- };
39
- const $uniqueId = (prefix) => {
40
- return getBrandedId(prefix, counter());
41
- };
42
- $uniqueId.for = (prefix) => {
43
- const generateBrandedId = () => {
44
- return getBrandedId(prefix, counter());
45
- };
46
- generateBrandedId.is = (value) => {
47
- return typeof value === "string" && value.startsWith(prefix);
48
- };
49
- generateBrandedId.assert = function(value) {
50
- if (!generateBrandedId.is(value)) {
51
- throw new Error(
52
- `The value "${String(value)}" does not match the expected prefix "${String(prefix)}"`
53
- );
54
- }
55
- };
56
- generateBrandedId.strict = () => {
57
- const strictBrandGenerator = generateBrandedId;
58
- return strictBrandGenerator;
59
- };
60
- return generateBrandedId;
61
- };
62
- $uniqueId.of = () => {
63
- const generateBrandedId = $uniqueId.for("");
64
- return generateBrandedId;
65
- };
66
- $uniqueId.strict = () => {
67
- const strictBrandGenerator = $uniqueId;
68
- return strictBrandGenerator;
69
- };
70
- return $uniqueId;
71
- })();
72
- var uniqueId_default = uniqueId;
package/uniqueId.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import type { UniqueId, BrandedId } from './types';
2
- /**
3
- * Generates a unique identifier string, optionally prefixed.
4
- */
5
- export declare const uniqueId: UniqueId;
6
- export default uniqueId;
7
- export type { UniqueId, BrandedId };
package/uniqueId.js DELETED
@@ -1,72 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/uniqueId.ts
21
- var uniqueId_exports = {};
22
- __export(uniqueId_exports, {
23
- default: () => uniqueId_default,
24
- uniqueId: () => uniqueId
25
- });
26
- module.exports = __toCommonJS(uniqueId_exports);
27
- var uniqueId = (() => {
28
- let $counter = 0;
29
- const counter = () => {
30
- if ($counter === Number.MAX_SAFE_INTEGER) $counter = 0;
31
- return $counter++;
32
- };
33
- const getBrandedId = (prefix, base) => {
34
- var _a;
35
- if ((_a = globalThis.crypto) == null ? void 0 : _a.randomUUID)
36
- return (prefix != null ? prefix : "") + globalThis.crypto.randomUUID();
37
- return (prefix != null ? prefix : "") + Date.now().toString(36) + base.toString(36);
38
- };
39
- const $uniqueId = (prefix) => {
40
- return getBrandedId(prefix, counter());
41
- };
42
- $uniqueId.for = (prefix) => {
43
- const generateBrandedId = () => {
44
- return getBrandedId(prefix, counter());
45
- };
46
- generateBrandedId.is = (value) => {
47
- return typeof value === "string" && value.startsWith(prefix);
48
- };
49
- generateBrandedId.assert = function(value) {
50
- if (!generateBrandedId.is(value)) {
51
- throw new Error(
52
- `The value "${String(value)}" does not match the expected prefix "${String(prefix)}"`
53
- );
54
- }
55
- };
56
- generateBrandedId.strict = () => {
57
- const strictBrandGenerator = generateBrandedId;
58
- return strictBrandGenerator;
59
- };
60
- return generateBrandedId;
61
- };
62
- $uniqueId.of = () => {
63
- const generateBrandedId = $uniqueId.for("");
64
- return generateBrandedId;
65
- };
66
- $uniqueId.strict = () => {
67
- const strictBrandGenerator = $uniqueId;
68
- return strictBrandGenerator;
69
- };
70
- return $uniqueId;
71
- })();
72
- var uniqueId_default = uniqueId;
package/uniqueId.mjs DELETED
@@ -1,51 +0,0 @@
1
- // src/uniqueId.ts
2
- var uniqueId = (() => {
3
- let $counter = 0;
4
- const counter = () => {
5
- if ($counter === Number.MAX_SAFE_INTEGER) $counter = 0;
6
- return $counter++;
7
- };
8
- const getBrandedId = (prefix, base) => {
9
- var _a;
10
- if ((_a = globalThis.crypto) == null ? void 0 : _a.randomUUID)
11
- return (prefix != null ? prefix : "") + globalThis.crypto.randomUUID();
12
- return (prefix != null ? prefix : "") + Date.now().toString(36) + base.toString(36);
13
- };
14
- const $uniqueId = (prefix) => {
15
- return getBrandedId(prefix, counter());
16
- };
17
- $uniqueId.for = (prefix) => {
18
- const generateBrandedId = () => {
19
- return getBrandedId(prefix, counter());
20
- };
21
- generateBrandedId.is = (value) => {
22
- return typeof value === "string" && value.startsWith(prefix);
23
- };
24
- generateBrandedId.assert = function(value) {
25
- if (!generateBrandedId.is(value)) {
26
- throw new Error(
27
- `The value "${String(value)}" does not match the expected prefix "${String(prefix)}"`
28
- );
29
- }
30
- };
31
- generateBrandedId.strict = () => {
32
- const strictBrandGenerator = generateBrandedId;
33
- return strictBrandGenerator;
34
- };
35
- return generateBrandedId;
36
- };
37
- $uniqueId.of = () => {
38
- const generateBrandedId = $uniqueId.for("");
39
- return generateBrandedId;
40
- };
41
- $uniqueId.strict = () => {
42
- const strictBrandGenerator = $uniqueId;
43
- return strictBrandGenerator;
44
- };
45
- return $uniqueId;
46
- })();
47
- var uniqueId_default = uniqueId;
48
- export {
49
- uniqueId_default as default,
50
- uniqueId
51
- };