@qwik.dev/devtools 0.0.3 → 0.0.5
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/LICENSE +21 -0
- package/README.md +49 -30
- package/dist/component/_virtual/_commonjsHelpers.qwik.cjs +6 -0
- package/dist/component/_virtual/_commonjsHelpers.qwik.mjs +6 -0
- package/{lib → dist/component}/devtools.qwik.cjs +19 -20
- package/{lib → dist/component}/devtools.qwik.mjs +11 -12
- package/{lib → dist/component}/index.qwik.cjs +0 -2
- package/dist/component/index.qwik.mjs +4 -0
- package/{lib-types → dist/component/lib-types/devtools/src}/index.d.ts +0 -1
- package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/hi.qwik.qwik.cjs +60 -0
- package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/hi.qwik.qwik.mjs +60 -0
- package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/lu.qwik.qwik.cjs +32 -0
- package/dist/component/node_modules/.pnpm/@qwikest_icons@0.0.13_@builder.io_qwik@1.11.0_vite@5.4.10_@types_node@20.14.11__/node_modules/@qwikest/icons/lib/lu.qwik.qwik.mjs +32 -0
- package/dist/component/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.qwik.cjs +54 -0
- package/dist/component/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.qwik.mjs +54 -0
- package/dist/component/node_modules/.pnpm/birpc@0.2.19/node_modules/birpc/dist/index.qwik.cjs +128 -0
- package/dist/component/node_modules/.pnpm/birpc@0.2.19/node_modules/birpc/dist/index.qwik.mjs +128 -0
- package/dist/component/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.qwik.cjs +149 -0
- package/dist/component/node_modules/.pnpm/brace-expansion@2.0.1/node_modules/brace-expansion/index.qwik.mjs +150 -0
- package/dist/component/node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.qwik.cjs +36 -0
- package/dist/component/node_modules/.pnpm/copy-anything@3.0.5/node_modules/copy-anything/dist/index.qwik.mjs +36 -0
- package/dist/component/node_modules/.pnpm/dree@5.1.5/node_modules/dree/bundled/lib/esm/index.esm.qwik.cjs +12 -0
- package/dist/component/node_modules/.pnpm/dree@5.1.5/node_modules/dree/bundled/lib/esm/index.esm.qwik.mjs +12 -0
- package/dist/component/node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.qwik.cjs +17 -0
- package/dist/component/node_modules/.pnpm/is-what@4.1.16/node_modules/is-what/dist/index.qwik.mjs +17 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/assert-valid-pattern.qwik.cjs +12 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/assert-valid-pattern.qwik.mjs +12 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/ast.qwik.cjs +513 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/ast.qwik.mjs +513 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/brace-expressions.qwik.cjs +110 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/brace-expressions.qwik.mjs +110 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/escape.qwik.cjs +6 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/escape.qwik.mjs +6 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.qwik.cjs +738 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/index.qwik.mjs +738 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/unescape.qwik.cjs +6 -0
- package/dist/component/node_modules/.pnpm/minimatch@10.0.1/node_modules/minimatch/dist/esm/unescape.qwik.mjs +6 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.qwik.cjs +120 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/accessDeep.qwik.mjs +120 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.qwik.cjs +23 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/class-registry.qwik.mjs +23 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.qwik.cjs +18 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/custom-transformer-registry.qwik.mjs +18 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.qwik.cjs +23 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/double-indexed-kv.qwik.mjs +23 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.qwik.cjs +91 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.qwik.mjs +91 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.qwik.cjs +51 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.qwik.mjs +51 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.qwik.cjs +30 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/pathstringifier.qwik.mjs +30 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.qwik.cjs +148 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/plainer.qwik.mjs +148 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.qwik.cjs +28 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/registry.qwik.mjs +28 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.qwik.cjs +203 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/transformer.qwik.mjs +203 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.qwik.cjs +47 -0
- package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/util.qwik.mjs +47 -0
- package/dist/component/node_modules/.pnpm/vite-hot-client@0.2.4_vite@5.4.10_@types_node@20.14.11_/node_modules/vite-hot-client/dist/index.qwik.cjs +35 -0
- package/dist/component/node_modules/.pnpm/vite-hot-client@0.2.4_vite@5.4.10_@types_node@20.14.11_/node_modules/vite-hot-client/dist/index.qwik.mjs +35 -0
- package/{lib/kit → dist/component/packages/kit/src}/client.qwik.cjs +5 -5
- package/{lib/kit → dist/component/packages/kit/src}/client.qwik.mjs +2 -2
- package/{lib/kit → dist/component/packages/kit/src}/context.qwik.cjs +0 -12
- package/{lib/kit → dist/component/packages/kit/src}/context.qwik.mjs +2 -14
- package/{lib/kit → dist/component/packages/kit/src}/globals.qwik.cjs +0 -4
- package/dist/component/packages/kit/src/globals.qwik.mjs +6 -0
- package/dist/plugin/index.cjs +10504 -0
- package/dist/plugin/index.mjs +10492 -0
- package/package.json +34 -41
- package/lib/index.qwik.mjs +0 -6
- package/lib/kit/globals.qwik.mjs +0 -10
- package/lib/kit/server.qwik.cjs +0 -18
- package/lib/kit/server.qwik.mjs +0 -18
- package/lib/plugin/assets/index.qwik.cjs +0 -67
- package/lib/plugin/assets/index.qwik.mjs +0 -67
- package/lib/plugin/index.qwik.cjs +0 -49
- package/lib/plugin/index.qwik.mjs +0 -49
- package/lib/plugin/npm/index.qwik.cjs +0 -19
- package/lib/plugin/npm/index.qwik.mjs +0 -19
- package/lib/plugin/routes/index.qwik.cjs +0 -17
- package/lib/plugin/routes/index.qwik.mjs +0 -17
- package/lib/plugin/rpc/index.qwik.cjs +0 -14
- package/lib/plugin/rpc/index.qwik.mjs +0 -14
- package/lib/utils/location.qwik.cjs +0 -9
- package/lib/utils/location.qwik.mjs +0 -9
- package/lib-types/plugin/assets/index.d.ts +0 -5
- package/lib-types/plugin/components/index.d.ts +0 -0
- package/lib-types/plugin/index.d.ts +0 -2
- package/lib-types/plugin/npm/index.d.ts +0 -5
- package/lib-types/plugin/routes/index.d.ts +0 -5
- package/lib-types/plugin/rpc/index.d.ts +0 -3
- package/lib-types/plugin/types/index.d.ts +0 -5
- package/src/devtools.css +0 -558
- package/src/devtools.tsx +0 -404
- package/src/entry.dev.tsx +0 -17
- package/src/entry.ssr.tsx +0 -25
- package/src/index.ts +0 -2
- package/src/kit/client.ts +0 -21
- package/src/kit/constants.ts +0 -1
- package/src/kit/context.ts +0 -42
- package/src/kit/globals.ts +0 -22
- package/src/kit/index.ts +0 -4
- package/src/kit/server.ts +0 -21
- package/src/kit/shared.ts +0 -11
- package/src/kit/types.ts +0 -48
- package/src/plugin/assets/index.ts +0 -126
- package/src/plugin/components/index.ts +0 -0
- package/src/plugin/index.ts +0 -50
- package/src/plugin/npm/index.ts +0 -24
- package/src/plugin/routes/index.ts +0 -16
- package/src/plugin/rpc/index.ts +0 -14
- package/src/plugin/types/index.ts +0 -6
- package/src/root.tsx +0 -15
- package/src/utils/location.ts +0 -9
- /package/{lib → dist/component}/devtools.css.qwik.cjs +0 -0
- /package/{lib → dist/component}/devtools.css.qwik.mjs +0 -0
- /package/{lib-types → dist/component/lib-types/devtools/src}/devtools.d.ts +0 -0
- /package/{lib-types → dist/component/lib-types/devtools/src}/entry.dev.d.ts +0 -0
- /package/{lib-types → dist/component/lib-types/devtools/src}/entry.ssr.d.ts +0 -0
- /package/{lib-types → dist/component/lib-types/devtools/src}/root.d.ts +0 -0
- /package/{lib-types → dist/component/lib-types/devtools/src}/utils/location.d.ts +0 -0
- /package/{lib-types/kit → dist/component/lib-types/kit/src}/client.d.ts +0 -0
- /package/{lib-types/kit → dist/component/lib-types/kit/src}/constants.d.ts +0 -0
- /package/{lib-types/kit → dist/component/lib-types/kit/src}/context.d.ts +0 -0
- /package/{lib-types/kit → dist/component/lib-types/kit/src}/globals.d.ts +0 -0
- /package/{lib-types/kit → dist/component/lib-types/kit/src}/index.d.ts +0 -0
- /package/{lib-types/kit → dist/component/lib-types/kit/src}/server.d.ts +0 -0
- /package/{lib-types/kit → dist/component/lib-types/kit/src}/shared.d.ts +0 -0
- /package/{lib-types/kit → dist/component/lib-types/kit/src}/types.d.ts +0 -0
- /package/{lib/kit → dist/component/packages/kit/src}/constants.qwik.cjs +0 -0
- /package/{lib/kit → dist/component/packages/kit/src}/constants.qwik.mjs +0 -0
- /package/{lib/kit → dist/component/packages/kit/src}/shared.qwik.cjs +0 -0
- /package/{lib/kit → dist/component/packages/kit/src}/shared.qwik.mjs +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const unescape = (s, { windowsPathsNoEscape = false } = {}) => {
|
|
4
|
+
return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
|
|
5
|
+
};
|
|
6
|
+
exports.unescape = unescape;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const is = require("./is.qwik.cjs");
|
|
4
|
+
const util = require("./util.qwik.cjs");
|
|
5
|
+
const getNthKey = (value, n) => {
|
|
6
|
+
if (n > value.size)
|
|
7
|
+
throw new Error("index out of bounds");
|
|
8
|
+
const keys = value.keys();
|
|
9
|
+
while (n > 0) {
|
|
10
|
+
keys.next();
|
|
11
|
+
n--;
|
|
12
|
+
}
|
|
13
|
+
return keys.next().value;
|
|
14
|
+
};
|
|
15
|
+
function validatePath(path) {
|
|
16
|
+
if (util.includes(path, "__proto__")) {
|
|
17
|
+
throw new Error("__proto__ is not allowed as a property");
|
|
18
|
+
}
|
|
19
|
+
if (util.includes(path, "prototype")) {
|
|
20
|
+
throw new Error("prototype is not allowed as a property");
|
|
21
|
+
}
|
|
22
|
+
if (util.includes(path, "constructor")) {
|
|
23
|
+
throw new Error("constructor is not allowed as a property");
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const getDeep = (object, path) => {
|
|
27
|
+
validatePath(path);
|
|
28
|
+
for (let i = 0; i < path.length; i++) {
|
|
29
|
+
const key = path[i];
|
|
30
|
+
if (is.isSet(object)) {
|
|
31
|
+
object = getNthKey(object, +key);
|
|
32
|
+
} else if (is.isMap(object)) {
|
|
33
|
+
const row = +key;
|
|
34
|
+
const type = +path[++i] === 0 ? "key" : "value";
|
|
35
|
+
const keyOfRow = getNthKey(object, row);
|
|
36
|
+
switch (type) {
|
|
37
|
+
case "key":
|
|
38
|
+
object = keyOfRow;
|
|
39
|
+
break;
|
|
40
|
+
case "value":
|
|
41
|
+
object = object.get(keyOfRow);
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
object = object[key];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return object;
|
|
49
|
+
};
|
|
50
|
+
const setDeep = (object, path, mapper) => {
|
|
51
|
+
validatePath(path);
|
|
52
|
+
if (path.length === 0) {
|
|
53
|
+
return mapper(object);
|
|
54
|
+
}
|
|
55
|
+
let parent = object;
|
|
56
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
57
|
+
const key = path[i];
|
|
58
|
+
if (is.isArray(parent)) {
|
|
59
|
+
const index = +key;
|
|
60
|
+
parent = parent[index];
|
|
61
|
+
} else if (is.isPlainObject(parent)) {
|
|
62
|
+
parent = parent[key];
|
|
63
|
+
} else if (is.isSet(parent)) {
|
|
64
|
+
const row = +key;
|
|
65
|
+
parent = getNthKey(parent, row);
|
|
66
|
+
} else if (is.isMap(parent)) {
|
|
67
|
+
const isEnd = i === path.length - 2;
|
|
68
|
+
if (isEnd) {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
const row = +key;
|
|
72
|
+
const type = +path[++i] === 0 ? "key" : "value";
|
|
73
|
+
const keyOfRow = getNthKey(parent, row);
|
|
74
|
+
switch (type) {
|
|
75
|
+
case "key":
|
|
76
|
+
parent = keyOfRow;
|
|
77
|
+
break;
|
|
78
|
+
case "value":
|
|
79
|
+
parent = parent.get(keyOfRow);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const lastKey = path[path.length - 1];
|
|
85
|
+
if (is.isArray(parent)) {
|
|
86
|
+
parent[+lastKey] = mapper(parent[+lastKey]);
|
|
87
|
+
} else if (is.isPlainObject(parent)) {
|
|
88
|
+
parent[lastKey] = mapper(parent[lastKey]);
|
|
89
|
+
}
|
|
90
|
+
if (is.isSet(parent)) {
|
|
91
|
+
const oldValue = getNthKey(parent, +lastKey);
|
|
92
|
+
const newValue = mapper(oldValue);
|
|
93
|
+
if (oldValue !== newValue) {
|
|
94
|
+
parent.delete(oldValue);
|
|
95
|
+
parent.add(newValue);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (is.isMap(parent)) {
|
|
99
|
+
const row = +path[path.length - 2];
|
|
100
|
+
const keyToRow = getNthKey(parent, row);
|
|
101
|
+
const type = +lastKey === 0 ? "key" : "value";
|
|
102
|
+
switch (type) {
|
|
103
|
+
case "key": {
|
|
104
|
+
const newKey = mapper(keyToRow);
|
|
105
|
+
parent.set(newKey, parent.get(keyToRow));
|
|
106
|
+
if (newKey !== keyToRow) {
|
|
107
|
+
parent.delete(keyToRow);
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
case "value": {
|
|
112
|
+
parent.set(keyToRow, mapper(parent.get(keyToRow)));
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return object;
|
|
118
|
+
};
|
|
119
|
+
exports.getDeep = getDeep;
|
|
120
|
+
exports.setDeep = setDeep;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { isArray, isPlainObject, isSet, isMap } from "./is.qwik.mjs";
|
|
2
|
+
import { includes } from "./util.qwik.mjs";
|
|
3
|
+
const getNthKey = (value, n) => {
|
|
4
|
+
if (n > value.size)
|
|
5
|
+
throw new Error("index out of bounds");
|
|
6
|
+
const keys = value.keys();
|
|
7
|
+
while (n > 0) {
|
|
8
|
+
keys.next();
|
|
9
|
+
n--;
|
|
10
|
+
}
|
|
11
|
+
return keys.next().value;
|
|
12
|
+
};
|
|
13
|
+
function validatePath(path) {
|
|
14
|
+
if (includes(path, "__proto__")) {
|
|
15
|
+
throw new Error("__proto__ is not allowed as a property");
|
|
16
|
+
}
|
|
17
|
+
if (includes(path, "prototype")) {
|
|
18
|
+
throw new Error("prototype is not allowed as a property");
|
|
19
|
+
}
|
|
20
|
+
if (includes(path, "constructor")) {
|
|
21
|
+
throw new Error("constructor is not allowed as a property");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const getDeep = (object, path) => {
|
|
25
|
+
validatePath(path);
|
|
26
|
+
for (let i = 0; i < path.length; i++) {
|
|
27
|
+
const key = path[i];
|
|
28
|
+
if (isSet(object)) {
|
|
29
|
+
object = getNthKey(object, +key);
|
|
30
|
+
} else if (isMap(object)) {
|
|
31
|
+
const row = +key;
|
|
32
|
+
const type = +path[++i] === 0 ? "key" : "value";
|
|
33
|
+
const keyOfRow = getNthKey(object, row);
|
|
34
|
+
switch (type) {
|
|
35
|
+
case "key":
|
|
36
|
+
object = keyOfRow;
|
|
37
|
+
break;
|
|
38
|
+
case "value":
|
|
39
|
+
object = object.get(keyOfRow);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
object = object[key];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return object;
|
|
47
|
+
};
|
|
48
|
+
const setDeep = (object, path, mapper) => {
|
|
49
|
+
validatePath(path);
|
|
50
|
+
if (path.length === 0) {
|
|
51
|
+
return mapper(object);
|
|
52
|
+
}
|
|
53
|
+
let parent = object;
|
|
54
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
55
|
+
const key = path[i];
|
|
56
|
+
if (isArray(parent)) {
|
|
57
|
+
const index = +key;
|
|
58
|
+
parent = parent[index];
|
|
59
|
+
} else if (isPlainObject(parent)) {
|
|
60
|
+
parent = parent[key];
|
|
61
|
+
} else if (isSet(parent)) {
|
|
62
|
+
const row = +key;
|
|
63
|
+
parent = getNthKey(parent, row);
|
|
64
|
+
} else if (isMap(parent)) {
|
|
65
|
+
const isEnd = i === path.length - 2;
|
|
66
|
+
if (isEnd) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
const row = +key;
|
|
70
|
+
const type = +path[++i] === 0 ? "key" : "value";
|
|
71
|
+
const keyOfRow = getNthKey(parent, row);
|
|
72
|
+
switch (type) {
|
|
73
|
+
case "key":
|
|
74
|
+
parent = keyOfRow;
|
|
75
|
+
break;
|
|
76
|
+
case "value":
|
|
77
|
+
parent = parent.get(keyOfRow);
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const lastKey = path[path.length - 1];
|
|
83
|
+
if (isArray(parent)) {
|
|
84
|
+
parent[+lastKey] = mapper(parent[+lastKey]);
|
|
85
|
+
} else if (isPlainObject(parent)) {
|
|
86
|
+
parent[lastKey] = mapper(parent[lastKey]);
|
|
87
|
+
}
|
|
88
|
+
if (isSet(parent)) {
|
|
89
|
+
const oldValue = getNthKey(parent, +lastKey);
|
|
90
|
+
const newValue = mapper(oldValue);
|
|
91
|
+
if (oldValue !== newValue) {
|
|
92
|
+
parent.delete(oldValue);
|
|
93
|
+
parent.add(newValue);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (isMap(parent)) {
|
|
97
|
+
const row = +path[path.length - 2];
|
|
98
|
+
const keyToRow = getNthKey(parent, row);
|
|
99
|
+
const type = +lastKey === 0 ? "key" : "value";
|
|
100
|
+
switch (type) {
|
|
101
|
+
case "key": {
|
|
102
|
+
const newKey = mapper(keyToRow);
|
|
103
|
+
parent.set(newKey, parent.get(keyToRow));
|
|
104
|
+
if (newKey !== keyToRow) {
|
|
105
|
+
parent.delete(keyToRow);
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
case "value": {
|
|
110
|
+
parent.set(keyToRow, mapper(parent.get(keyToRow)));
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return object;
|
|
116
|
+
};
|
|
117
|
+
export {
|
|
118
|
+
getDeep,
|
|
119
|
+
setDeep
|
|
120
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const registry = require("./registry.qwik.cjs");
|
|
4
|
+
class ClassRegistry extends registry.Registry {
|
|
5
|
+
constructor() {
|
|
6
|
+
super((c) => c.name);
|
|
7
|
+
this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
8
|
+
}
|
|
9
|
+
register(value, options) {
|
|
10
|
+
if (typeof options === "object") {
|
|
11
|
+
if (options.allowProps) {
|
|
12
|
+
this.classToAllowedProps.set(value, options.allowProps);
|
|
13
|
+
}
|
|
14
|
+
super.register(value, options.identifier);
|
|
15
|
+
} else {
|
|
16
|
+
super.register(value, options);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
getAllowedProps(value) {
|
|
20
|
+
return this.classToAllowedProps.get(value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.ClassRegistry = ClassRegistry;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Registry } from "./registry.qwik.mjs";
|
|
2
|
+
class ClassRegistry extends Registry {
|
|
3
|
+
constructor() {
|
|
4
|
+
super((c) => c.name);
|
|
5
|
+
this.classToAllowedProps = /* @__PURE__ */ new Map();
|
|
6
|
+
}
|
|
7
|
+
register(value, options) {
|
|
8
|
+
if (typeof options === "object") {
|
|
9
|
+
if (options.allowProps) {
|
|
10
|
+
this.classToAllowedProps.set(value, options.allowProps);
|
|
11
|
+
}
|
|
12
|
+
super.register(value, options.identifier);
|
|
13
|
+
} else {
|
|
14
|
+
super.register(value, options);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
getAllowedProps(value) {
|
|
18
|
+
return this.classToAllowedProps.get(value);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
ClassRegistry
|
|
23
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const util = require("./util.qwik.cjs");
|
|
4
|
+
class CustomTransformerRegistry {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.transfomers = {};
|
|
7
|
+
}
|
|
8
|
+
register(transformer) {
|
|
9
|
+
this.transfomers[transformer.name] = transformer;
|
|
10
|
+
}
|
|
11
|
+
findApplicable(v) {
|
|
12
|
+
return util.find(this.transfomers, (transformer) => transformer.isApplicable(v));
|
|
13
|
+
}
|
|
14
|
+
findByName(name) {
|
|
15
|
+
return this.transfomers[name];
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.CustomTransformerRegistry = CustomTransformerRegistry;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { find } from "./util.qwik.mjs";
|
|
2
|
+
class CustomTransformerRegistry {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.transfomers = {};
|
|
5
|
+
}
|
|
6
|
+
register(transformer) {
|
|
7
|
+
this.transfomers[transformer.name] = transformer;
|
|
8
|
+
}
|
|
9
|
+
findApplicable(v) {
|
|
10
|
+
return find(this.transfomers, (transformer) => transformer.isApplicable(v));
|
|
11
|
+
}
|
|
12
|
+
findByName(name) {
|
|
13
|
+
return this.transfomers[name];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
CustomTransformerRegistry
|
|
18
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
class DoubleIndexedKV {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.keyToValue = /* @__PURE__ */ new Map();
|
|
6
|
+
this.valueToKey = /* @__PURE__ */ new Map();
|
|
7
|
+
}
|
|
8
|
+
set(key, value) {
|
|
9
|
+
this.keyToValue.set(key, value);
|
|
10
|
+
this.valueToKey.set(value, key);
|
|
11
|
+
}
|
|
12
|
+
getByKey(key) {
|
|
13
|
+
return this.keyToValue.get(key);
|
|
14
|
+
}
|
|
15
|
+
getByValue(value) {
|
|
16
|
+
return this.valueToKey.get(value);
|
|
17
|
+
}
|
|
18
|
+
clear() {
|
|
19
|
+
this.keyToValue.clear();
|
|
20
|
+
this.valueToKey.clear();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.DoubleIndexedKV = DoubleIndexedKV;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
class DoubleIndexedKV {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.keyToValue = /* @__PURE__ */ new Map();
|
|
4
|
+
this.valueToKey = /* @__PURE__ */ new Map();
|
|
5
|
+
}
|
|
6
|
+
set(key, value) {
|
|
7
|
+
this.keyToValue.set(key, value);
|
|
8
|
+
this.valueToKey.set(value, key);
|
|
9
|
+
}
|
|
10
|
+
getByKey(key) {
|
|
11
|
+
return this.keyToValue.get(key);
|
|
12
|
+
}
|
|
13
|
+
getByValue(value) {
|
|
14
|
+
return this.valueToKey.get(value);
|
|
15
|
+
}
|
|
16
|
+
clear() {
|
|
17
|
+
this.keyToValue.clear();
|
|
18
|
+
this.valueToKey.clear();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
DoubleIndexedKV
|
|
23
|
+
};
|
package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.qwik.cjs
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const classRegistry = require("./class-registry.qwik.cjs");
|
|
4
|
+
const registry = require("./registry.qwik.cjs");
|
|
5
|
+
const customTransformerRegistry = require("./custom-transformer-registry.qwik.cjs");
|
|
6
|
+
const plainer = require("./plainer.qwik.cjs");
|
|
7
|
+
const index = require("../../../../copy-anything@3.0.5/node_modules/copy-anything/dist/index.qwik.cjs");
|
|
8
|
+
class SuperJSON {
|
|
9
|
+
/**
|
|
10
|
+
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
11
|
+
*/
|
|
12
|
+
constructor({ dedupe = false } = {}) {
|
|
13
|
+
this.classRegistry = new classRegistry.ClassRegistry();
|
|
14
|
+
this.symbolRegistry = new registry.Registry((s) => s.description ?? "");
|
|
15
|
+
this.customTransformerRegistry = new customTransformerRegistry.CustomTransformerRegistry();
|
|
16
|
+
this.allowedErrorProps = [];
|
|
17
|
+
this.dedupe = dedupe;
|
|
18
|
+
}
|
|
19
|
+
serialize(object) {
|
|
20
|
+
const identities = /* @__PURE__ */ new Map();
|
|
21
|
+
const output = plainer.walker(object, identities, this, this.dedupe);
|
|
22
|
+
const res = {
|
|
23
|
+
json: output.transformedValue
|
|
24
|
+
};
|
|
25
|
+
if (output.annotations) {
|
|
26
|
+
res.meta = {
|
|
27
|
+
...res.meta,
|
|
28
|
+
values: output.annotations
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const equalityAnnotations = plainer.generateReferentialEqualityAnnotations(identities, this.dedupe);
|
|
32
|
+
if (equalityAnnotations) {
|
|
33
|
+
res.meta = {
|
|
34
|
+
...res.meta,
|
|
35
|
+
referentialEqualities: equalityAnnotations
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
return res;
|
|
39
|
+
}
|
|
40
|
+
deserialize(payload) {
|
|
41
|
+
const { json, meta } = payload;
|
|
42
|
+
let result = index.copy(json);
|
|
43
|
+
if (meta?.values) {
|
|
44
|
+
result = plainer.applyValueAnnotations(result, meta.values, this);
|
|
45
|
+
}
|
|
46
|
+
if (meta?.referentialEqualities) {
|
|
47
|
+
result = plainer.applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
stringify(object) {
|
|
52
|
+
return JSON.stringify(this.serialize(object));
|
|
53
|
+
}
|
|
54
|
+
parse(string) {
|
|
55
|
+
return this.deserialize(JSON.parse(string));
|
|
56
|
+
}
|
|
57
|
+
registerClass(v, options) {
|
|
58
|
+
this.classRegistry.register(v, options);
|
|
59
|
+
}
|
|
60
|
+
registerSymbol(v, identifier) {
|
|
61
|
+
this.symbolRegistry.register(v, identifier);
|
|
62
|
+
}
|
|
63
|
+
registerCustom(transformer, name) {
|
|
64
|
+
this.customTransformerRegistry.register({
|
|
65
|
+
name,
|
|
66
|
+
...transformer
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
allowErrorProps(...props) {
|
|
70
|
+
this.allowedErrorProps.push(...props);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
SuperJSON.defaultInstance = new SuperJSON();
|
|
74
|
+
SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
|
|
75
|
+
SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
|
|
76
|
+
SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
|
|
77
|
+
SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
|
|
78
|
+
SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
|
|
79
|
+
SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
|
|
80
|
+
SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
|
|
81
|
+
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
|
82
|
+
SuperJSON.serialize;
|
|
83
|
+
SuperJSON.deserialize;
|
|
84
|
+
SuperJSON.stringify;
|
|
85
|
+
SuperJSON.parse;
|
|
86
|
+
SuperJSON.registerClass;
|
|
87
|
+
SuperJSON.registerCustom;
|
|
88
|
+
SuperJSON.registerSymbol;
|
|
89
|
+
SuperJSON.allowErrorProps;
|
|
90
|
+
exports.SuperJSON = SuperJSON;
|
|
91
|
+
exports.default = SuperJSON;
|
package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/index.qwik.mjs
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { ClassRegistry } from "./class-registry.qwik.mjs";
|
|
2
|
+
import { Registry } from "./registry.qwik.mjs";
|
|
3
|
+
import { CustomTransformerRegistry } from "./custom-transformer-registry.qwik.mjs";
|
|
4
|
+
import { walker, generateReferentialEqualityAnnotations, applyValueAnnotations, applyReferentialEqualityAnnotations } from "./plainer.qwik.mjs";
|
|
5
|
+
import { copy } from "../../../../copy-anything@3.0.5/node_modules/copy-anything/dist/index.qwik.mjs";
|
|
6
|
+
class SuperJSON {
|
|
7
|
+
/**
|
|
8
|
+
* @param dedupeReferentialEqualities If true, SuperJSON will make sure only one instance of referentially equal objects are serialized and the rest are replaced with `null`.
|
|
9
|
+
*/
|
|
10
|
+
constructor({ dedupe = false } = {}) {
|
|
11
|
+
this.classRegistry = new ClassRegistry();
|
|
12
|
+
this.symbolRegistry = new Registry((s) => s.description ?? "");
|
|
13
|
+
this.customTransformerRegistry = new CustomTransformerRegistry();
|
|
14
|
+
this.allowedErrorProps = [];
|
|
15
|
+
this.dedupe = dedupe;
|
|
16
|
+
}
|
|
17
|
+
serialize(object) {
|
|
18
|
+
const identities = /* @__PURE__ */ new Map();
|
|
19
|
+
const output = walker(object, identities, this, this.dedupe);
|
|
20
|
+
const res = {
|
|
21
|
+
json: output.transformedValue
|
|
22
|
+
};
|
|
23
|
+
if (output.annotations) {
|
|
24
|
+
res.meta = {
|
|
25
|
+
...res.meta,
|
|
26
|
+
values: output.annotations
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const equalityAnnotations = generateReferentialEqualityAnnotations(identities, this.dedupe);
|
|
30
|
+
if (equalityAnnotations) {
|
|
31
|
+
res.meta = {
|
|
32
|
+
...res.meta,
|
|
33
|
+
referentialEqualities: equalityAnnotations
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return res;
|
|
37
|
+
}
|
|
38
|
+
deserialize(payload) {
|
|
39
|
+
const { json, meta } = payload;
|
|
40
|
+
let result = copy(json);
|
|
41
|
+
if (meta?.values) {
|
|
42
|
+
result = applyValueAnnotations(result, meta.values, this);
|
|
43
|
+
}
|
|
44
|
+
if (meta?.referentialEqualities) {
|
|
45
|
+
result = applyReferentialEqualityAnnotations(result, meta.referentialEqualities);
|
|
46
|
+
}
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
stringify(object) {
|
|
50
|
+
return JSON.stringify(this.serialize(object));
|
|
51
|
+
}
|
|
52
|
+
parse(string) {
|
|
53
|
+
return this.deserialize(JSON.parse(string));
|
|
54
|
+
}
|
|
55
|
+
registerClass(v, options) {
|
|
56
|
+
this.classRegistry.register(v, options);
|
|
57
|
+
}
|
|
58
|
+
registerSymbol(v, identifier) {
|
|
59
|
+
this.symbolRegistry.register(v, identifier);
|
|
60
|
+
}
|
|
61
|
+
registerCustom(transformer, name) {
|
|
62
|
+
this.customTransformerRegistry.register({
|
|
63
|
+
name,
|
|
64
|
+
...transformer
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
allowErrorProps(...props) {
|
|
68
|
+
this.allowedErrorProps.push(...props);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
SuperJSON.defaultInstance = new SuperJSON();
|
|
72
|
+
SuperJSON.serialize = SuperJSON.defaultInstance.serialize.bind(SuperJSON.defaultInstance);
|
|
73
|
+
SuperJSON.deserialize = SuperJSON.defaultInstance.deserialize.bind(SuperJSON.defaultInstance);
|
|
74
|
+
SuperJSON.stringify = SuperJSON.defaultInstance.stringify.bind(SuperJSON.defaultInstance);
|
|
75
|
+
SuperJSON.parse = SuperJSON.defaultInstance.parse.bind(SuperJSON.defaultInstance);
|
|
76
|
+
SuperJSON.registerClass = SuperJSON.defaultInstance.registerClass.bind(SuperJSON.defaultInstance);
|
|
77
|
+
SuperJSON.registerSymbol = SuperJSON.defaultInstance.registerSymbol.bind(SuperJSON.defaultInstance);
|
|
78
|
+
SuperJSON.registerCustom = SuperJSON.defaultInstance.registerCustom.bind(SuperJSON.defaultInstance);
|
|
79
|
+
SuperJSON.allowErrorProps = SuperJSON.defaultInstance.allowErrorProps.bind(SuperJSON.defaultInstance);
|
|
80
|
+
SuperJSON.serialize;
|
|
81
|
+
SuperJSON.deserialize;
|
|
82
|
+
SuperJSON.stringify;
|
|
83
|
+
SuperJSON.parse;
|
|
84
|
+
SuperJSON.registerClass;
|
|
85
|
+
SuperJSON.registerCustom;
|
|
86
|
+
SuperJSON.registerSymbol;
|
|
87
|
+
SuperJSON.allowErrorProps;
|
|
88
|
+
export {
|
|
89
|
+
SuperJSON,
|
|
90
|
+
SuperJSON as default
|
|
91
|
+
};
|
package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.qwik.cjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
|
|
4
|
+
const isUndefined = (payload) => typeof payload === "undefined";
|
|
5
|
+
const isNull = (payload) => payload === null;
|
|
6
|
+
const isPlainObject = (payload) => {
|
|
7
|
+
if (typeof payload !== "object" || payload === null)
|
|
8
|
+
return false;
|
|
9
|
+
if (payload === Object.prototype)
|
|
10
|
+
return false;
|
|
11
|
+
if (Object.getPrototypeOf(payload) === null)
|
|
12
|
+
return true;
|
|
13
|
+
return Object.getPrototypeOf(payload) === Object.prototype;
|
|
14
|
+
};
|
|
15
|
+
const isEmptyObject = (payload) => isPlainObject(payload) && Object.keys(payload).length === 0;
|
|
16
|
+
const isArray = (payload) => Array.isArray(payload);
|
|
17
|
+
const isString = (payload) => typeof payload === "string";
|
|
18
|
+
const isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
|
|
19
|
+
const isBoolean = (payload) => typeof payload === "boolean";
|
|
20
|
+
const isRegExp = (payload) => payload instanceof RegExp;
|
|
21
|
+
const isMap = (payload) => payload instanceof Map;
|
|
22
|
+
const isSet = (payload) => payload instanceof Set;
|
|
23
|
+
const isSymbol = (payload) => getType(payload) === "Symbol";
|
|
24
|
+
const isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
|
|
25
|
+
const isError = (payload) => payload instanceof Error;
|
|
26
|
+
const isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
|
|
27
|
+
const isPrimitive = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
|
|
28
|
+
const isBigint = (payload) => typeof payload === "bigint";
|
|
29
|
+
const isInfinite = (payload) => payload === Infinity || payload === -Infinity;
|
|
30
|
+
const isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
|
|
31
|
+
const isURL = (payload) => payload instanceof URL;
|
|
32
|
+
exports.isArray = isArray;
|
|
33
|
+
exports.isBigint = isBigint;
|
|
34
|
+
exports.isBoolean = isBoolean;
|
|
35
|
+
exports.isDate = isDate;
|
|
36
|
+
exports.isEmptyObject = isEmptyObject;
|
|
37
|
+
exports.isError = isError;
|
|
38
|
+
exports.isInfinite = isInfinite;
|
|
39
|
+
exports.isMap = isMap;
|
|
40
|
+
exports.isNaNValue = isNaNValue;
|
|
41
|
+
exports.isNull = isNull;
|
|
42
|
+
exports.isNumber = isNumber;
|
|
43
|
+
exports.isPlainObject = isPlainObject;
|
|
44
|
+
exports.isPrimitive = isPrimitive;
|
|
45
|
+
exports.isRegExp = isRegExp;
|
|
46
|
+
exports.isSet = isSet;
|
|
47
|
+
exports.isString = isString;
|
|
48
|
+
exports.isSymbol = isSymbol;
|
|
49
|
+
exports.isTypedArray = isTypedArray;
|
|
50
|
+
exports.isURL = isURL;
|
|
51
|
+
exports.isUndefined = isUndefined;
|
package/dist/component/node_modules/.pnpm/superjson@2.2.2/node_modules/superjson/dist/is.qwik.mjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const getType = (payload) => Object.prototype.toString.call(payload).slice(8, -1);
|
|
2
|
+
const isUndefined = (payload) => typeof payload === "undefined";
|
|
3
|
+
const isNull = (payload) => payload === null;
|
|
4
|
+
const isPlainObject = (payload) => {
|
|
5
|
+
if (typeof payload !== "object" || payload === null)
|
|
6
|
+
return false;
|
|
7
|
+
if (payload === Object.prototype)
|
|
8
|
+
return false;
|
|
9
|
+
if (Object.getPrototypeOf(payload) === null)
|
|
10
|
+
return true;
|
|
11
|
+
return Object.getPrototypeOf(payload) === Object.prototype;
|
|
12
|
+
};
|
|
13
|
+
const isEmptyObject = (payload) => isPlainObject(payload) && Object.keys(payload).length === 0;
|
|
14
|
+
const isArray = (payload) => Array.isArray(payload);
|
|
15
|
+
const isString = (payload) => typeof payload === "string";
|
|
16
|
+
const isNumber = (payload) => typeof payload === "number" && !isNaN(payload);
|
|
17
|
+
const isBoolean = (payload) => typeof payload === "boolean";
|
|
18
|
+
const isRegExp = (payload) => payload instanceof RegExp;
|
|
19
|
+
const isMap = (payload) => payload instanceof Map;
|
|
20
|
+
const isSet = (payload) => payload instanceof Set;
|
|
21
|
+
const isSymbol = (payload) => getType(payload) === "Symbol";
|
|
22
|
+
const isDate = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
|
|
23
|
+
const isError = (payload) => payload instanceof Error;
|
|
24
|
+
const isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
|
|
25
|
+
const isPrimitive = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);
|
|
26
|
+
const isBigint = (payload) => typeof payload === "bigint";
|
|
27
|
+
const isInfinite = (payload) => payload === Infinity || payload === -Infinity;
|
|
28
|
+
const isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
|
|
29
|
+
const isURL = (payload) => payload instanceof URL;
|
|
30
|
+
export {
|
|
31
|
+
isArray,
|
|
32
|
+
isBigint,
|
|
33
|
+
isBoolean,
|
|
34
|
+
isDate,
|
|
35
|
+
isEmptyObject,
|
|
36
|
+
isError,
|
|
37
|
+
isInfinite,
|
|
38
|
+
isMap,
|
|
39
|
+
isNaNValue,
|
|
40
|
+
isNull,
|
|
41
|
+
isNumber,
|
|
42
|
+
isPlainObject,
|
|
43
|
+
isPrimitive,
|
|
44
|
+
isRegExp,
|
|
45
|
+
isSet,
|
|
46
|
+
isString,
|
|
47
|
+
isSymbol,
|
|
48
|
+
isTypedArray,
|
|
49
|
+
isURL,
|
|
50
|
+
isUndefined
|
|
51
|
+
};
|