@keload/node-red-dxp 1.4.1 → 1.6.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/dist/chunk-DATO2UPN.js +108 -0
- package/dist/chunk-DATO2UPN.js.map +1 -0
- package/dist/cli/index.cjs +4009 -39
- package/dist/cli/index.cjs.map +1 -0
- package/dist/editor/index.cjs +176 -1
- package/dist/editor/index.cjs.map +1 -0
- package/dist/editor/index.js +105 -1
- package/dist/editor/index.js.map +1 -0
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/utils.cjs +119 -0
- package/dist/utils.cjs.map +1 -0
- package/dist/utils.d.cts +12 -0
- package/dist/utils.d.ts +12 -0
- package/dist/utils.js +13 -0
- package/dist/utils.js.map +1 -0
- package/package.json +10 -3
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __export = (target, all) => {
|
|
3
|
+
for (var name in all)
|
|
4
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
// node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/getType.js
|
|
8
|
+
function getType(payload) {
|
|
9
|
+
return Object.prototype.toString.call(payload).slice(8, -1);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isArray.js
|
|
13
|
+
function isArray(payload) {
|
|
14
|
+
return getType(payload) === "Array";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isPlainObject.js
|
|
18
|
+
function isPlainObject(payload) {
|
|
19
|
+
if (getType(payload) !== "Object")
|
|
20
|
+
return false;
|
|
21
|
+
const prototype = Object.getPrototypeOf(payload);
|
|
22
|
+
return !!prototype && prototype.constructor === Object && prototype === Object.prototype;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isSymbol.js
|
|
26
|
+
function isSymbol(payload) {
|
|
27
|
+
return getType(payload) === "Symbol";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// node_modules/.pnpm/merge-anything@6.0.2/node_modules/merge-anything/dist/extensions.js
|
|
31
|
+
function concatArrays(originVal, newVal) {
|
|
32
|
+
if (isArray(originVal) && isArray(newVal)) {
|
|
33
|
+
return originVal.concat(newVal);
|
|
34
|
+
}
|
|
35
|
+
return newVal;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// node_modules/.pnpm/merge-anything@6.0.2/node_modules/merge-anything/dist/merge.js
|
|
39
|
+
function assignProp(carry, key, newVal, originalObject) {
|
|
40
|
+
const propType = {}.propertyIsEnumerable.call(originalObject, key) ? "enumerable" : "nonenumerable";
|
|
41
|
+
if (propType === "enumerable")
|
|
42
|
+
carry[key] = newVal;
|
|
43
|
+
if (propType === "nonenumerable") {
|
|
44
|
+
Object.defineProperty(carry, key, {
|
|
45
|
+
value: newVal,
|
|
46
|
+
enumerable: false,
|
|
47
|
+
writable: true,
|
|
48
|
+
configurable: true
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function mergeRecursively(origin, newComer, compareFn) {
|
|
53
|
+
if (!isPlainObject(newComer))
|
|
54
|
+
return newComer;
|
|
55
|
+
let newObject = {};
|
|
56
|
+
if (isPlainObject(origin)) {
|
|
57
|
+
const props2 = Object.getOwnPropertyNames(origin);
|
|
58
|
+
const symbols2 = Object.getOwnPropertySymbols(origin);
|
|
59
|
+
newObject = [...props2, ...symbols2].reduce((carry, key) => {
|
|
60
|
+
const targetVal = origin[key];
|
|
61
|
+
if (!isSymbol(key) && !Object.getOwnPropertyNames(newComer).includes(key) || isSymbol(key) && !Object.getOwnPropertySymbols(newComer).includes(key)) {
|
|
62
|
+
assignProp(carry, key, targetVal, origin);
|
|
63
|
+
}
|
|
64
|
+
return carry;
|
|
65
|
+
}, {});
|
|
66
|
+
}
|
|
67
|
+
const props = Object.getOwnPropertyNames(newComer);
|
|
68
|
+
const symbols = Object.getOwnPropertySymbols(newComer);
|
|
69
|
+
const result = [...props, ...symbols].reduce((carry, key) => {
|
|
70
|
+
let newVal = newComer[key];
|
|
71
|
+
const targetVal = isPlainObject(origin) ? origin[key] : void 0;
|
|
72
|
+
if (targetVal !== void 0 && isPlainObject(newVal)) {
|
|
73
|
+
newVal = mergeRecursively(targetVal, newVal, compareFn);
|
|
74
|
+
}
|
|
75
|
+
const propToAssign = compareFn ? compareFn(targetVal, newVal, key) : newVal;
|
|
76
|
+
assignProp(carry, key, propToAssign, newComer);
|
|
77
|
+
return carry;
|
|
78
|
+
}, newObject);
|
|
79
|
+
return result;
|
|
80
|
+
}
|
|
81
|
+
function merge(object, ...otherObjects) {
|
|
82
|
+
return otherObjects.reduce((result, newComer) => {
|
|
83
|
+
return mergeRecursively(result, newComer);
|
|
84
|
+
}, object);
|
|
85
|
+
}
|
|
86
|
+
function mergeAndCompare(compareFn, object, ...otherObjects) {
|
|
87
|
+
return otherObjects.reduce((result, newComer) => {
|
|
88
|
+
return mergeRecursively(result, newComer, compareFn);
|
|
89
|
+
}, object);
|
|
90
|
+
}
|
|
91
|
+
function mergeAndConcat(object, ...otherObjects) {
|
|
92
|
+
return otherObjects.reduce((result, newComer) => {
|
|
93
|
+
return mergeRecursively(result, newComer, concatArrays);
|
|
94
|
+
}, object);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// node_modules/.pnpm/merge-anything@6.0.2/node_modules/merge-anything/dist/index.js
|
|
98
|
+
var dist_exports = {};
|
|
99
|
+
__export(dist_exports, {
|
|
100
|
+
concatArrays: () => concatArrays,
|
|
101
|
+
merge: () => merge,
|
|
102
|
+
mergeAndCompare: () => mergeAndCompare,
|
|
103
|
+
mergeAndConcat: () => mergeAndConcat
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
export { dist_exports, merge };
|
|
107
|
+
//# sourceMappingURL=chunk-DATO2UPN.js.map
|
|
108
|
+
//# sourceMappingURL=chunk-DATO2UPN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/getType.js","../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isArray.js","../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isPlainObject.js","../node_modules/.pnpm/is-what@5.0.2/node_modules/is-what/dist/isSymbol.js","../node_modules/.pnpm/merge-anything@6.0.2/node_modules/merge-anything/dist/extensions.js","../node_modules/.pnpm/merge-anything@6.0.2/node_modules/merge-anything/dist/merge.js","../node_modules/.pnpm/merge-anything@6.0.2/node_modules/merge-anything/dist/index.js"],"names":["props","symbols"],"mappings":";;;;;;;AACO,SAAS,QAAQ,OAAS,EAAA;AAC7B,EAAO,OAAA,MAAA,CAAO,UAAU,QAAS,CAAA,IAAA,CAAK,OAAO,CAAE,CAAA,KAAA,CAAM,GAAG,CAAE,CAAA,CAAA;AAC9D;;;ACDO,SAAS,QAAQ,OAAS,EAAA;AAC7B,EAAO,OAAA,OAAA,CAAQ,OAAO,CAAM,KAAA,OAAA;AAChC;;;ACCO,SAAS,cAAc,OAAS,EAAA;AACnC,EAAI,IAAA,OAAA,CAAQ,OAAO,CAAM,KAAA,QAAA;AACrB,IAAO,OAAA,KAAA;AACX,EAAM,MAAA,SAAA,GAAY,MAAO,CAAA,cAAA,CAAe,OAAO,CAAA;AAC/C,EAAA,OAAO,CAAC,CAAC,SAAA,IAAa,UAAU,WAAgB,KAAA,MAAA,IAAU,cAAc,MAAO,CAAA,SAAA;AACnF;;;ACRO,SAAS,SAAS,OAAS,EAAA;AAC9B,EAAO,OAAA,OAAA,CAAQ,OAAO,CAAM,KAAA,QAAA;AAChC;;;ACHO,SAAS,YAAA,CAAa,WAAW,MAAQ,EAAA;AAC5C,EAA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AAa,KAAA;AAC7C,IAAO,OAAA,gBAAA,CAAiB,QAAQ,QAAQ,CAAA;AAAA,KACzC,MAAM,CAAA;AACb;AACO,SAAS,eAAA,CAAgB,SAAW,EAAA,MAAA,EAAA,GAAW,YAAc,EAAA;AAChE,EAAA,OAAO,YAAa,CAAA,MAAA,CAAO,CAAC,MAAA,EAAQ,QAAa,KAAA;AAC7C,IAAO,OAAA,gBAAA,CAAiB,MAAQ,EAAA,QAAA,EAAU,SAAS,CAAA;AAAA,KACpD,MAAM,CAAA;AACb;AACO,SAAS,cAAA,CAAe,WAAW,YAAc,EAAA;AACpD,EAAA,OAAO,YAAa,CAAA,MAAA,CAAO,CAAC,MAAA,EAAQ,QAAa,KAAA;AAC7C,IAAO,OAAA,gBAAA,CAAiB,MAAQ,EAAA,QAAA,EAAU,YAAY,CAAA;AAAA,KACvD,MAAM,CAAA;AACb;;;ACvEA,IAAA,YAAA,GAAA;AAAA,QAAA,CAAA,YAAA,EAAA;AAAA,EAAA,YAAA,EAAA,MAAA,YAAA;AAAA,EAAA,KAAA,EAAA,MAAA,KAAA;AAAA,EAAA,eAAA,EAAA,MAAA,eAAA;AAAA,EAAA,cAAA,EAAA,MAAA;AAAA,CAAA,CAAA","file":"chunk-DATO2UPN.js","sourcesContent":["/** Returns the object type of the given payload */\nexport function getType(payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n}\n","import { getType } from './getType.js';\n/** Returns whether the payload is an array */\nexport function isArray(payload) {\n return getType(payload) === 'Array';\n}\n","import { getType } from './getType.js';\n/**\n * Returns whether the payload is a plain JavaScript object (excluding special classes or objects\n * with other prototypes)\n */\nexport function isPlainObject(payload) {\n if (getType(payload) !== 'Object')\n return false;\n const prototype = Object.getPrototypeOf(payload);\n return !!prototype && prototype.constructor === Object && prototype === Object.prototype;\n}\n","import { getType } from './getType.js';\n/** Returns whether the payload is a Symbol */\nexport function isSymbol(payload) {\n return getType(payload) === 'Symbol';\n}\n","import { isArray } from 'is-what';\nexport function concatArrays(originVal, newVal) {\n if (isArray(originVal) && isArray(newVal)) {\n // concat logic\n return originVal.concat(newVal);\n }\n return newVal; // always return newVal as fallback!!\n}\n","import { isPlainObject, isSymbol } from 'is-what';\nimport { concatArrays } from './extensions.js';\nfunction assignProp(carry, key, newVal, originalObject) {\n const propType = {}.propertyIsEnumerable.call(originalObject, key)\n ? 'enumerable'\n : 'nonenumerable';\n if (propType === 'enumerable')\n carry[key] = newVal;\n if (propType === 'nonenumerable') {\n Object.defineProperty(carry, key, {\n value: newVal,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n }\n}\nfunction mergeRecursively(origin, newComer, compareFn) {\n // always return newComer if its not an object\n if (!isPlainObject(newComer))\n return newComer;\n // define newObject to merge all values upon\n let newObject = {};\n if (isPlainObject(origin)) {\n const props = Object.getOwnPropertyNames(origin);\n const symbols = Object.getOwnPropertySymbols(origin);\n newObject = [...props, ...symbols].reduce((carry, key) => {\n const targetVal = origin[key];\n if ((!isSymbol(key) && !Object.getOwnPropertyNames(newComer).includes(key)) ||\n (isSymbol(key) && !Object.getOwnPropertySymbols(newComer).includes(key))) {\n assignProp(carry, key, targetVal, origin);\n }\n return carry;\n }, {});\n }\n // newObject has all properties that newComer hasn't\n const props = Object.getOwnPropertyNames(newComer);\n const symbols = Object.getOwnPropertySymbols(newComer);\n const result = [...props, ...symbols].reduce((carry, key) => {\n // re-define the origin and newComer as targetVal and newVal\n let newVal = newComer[key];\n const targetVal = isPlainObject(origin) ? origin[key] : undefined;\n // When newVal is an object do the merge recursively\n if (targetVal !== undefined && isPlainObject(newVal)) {\n newVal = mergeRecursively(targetVal, newVal, compareFn);\n }\n const propToAssign = compareFn ? compareFn(targetVal, newVal, key) : newVal;\n assignProp(carry, key, propToAssign, newComer);\n return carry;\n }, newObject);\n return result;\n}\n/**\n * Merge anything recursively.\n * Objects get merged, special objects (classes etc.) are re-assigned \"as is\".\n * Basic types overwrite objects or other basic types.\n */\nexport function merge(object, ...otherObjects) {\n return otherObjects.reduce((result, newComer) => {\n return mergeRecursively(result, newComer);\n }, object);\n}\nexport function mergeAndCompare(compareFn, object, ...otherObjects) {\n return otherObjects.reduce((result, newComer) => {\n return mergeRecursively(result, newComer, compareFn);\n }, object);\n}\nexport function mergeAndConcat(object, ...otherObjects) {\n return otherObjects.reduce((result, newComer) => {\n return mergeRecursively(result, newComer, concatArrays);\n }, object);\n}\n// import { Timestamp } from '../test/Timestamp'\n// type T1 = { date: Timestamp }\n// type T2 = [{ b: string[] }, { b: number[] }, { date: Timestamp }]\n// type TestT = Merge<T1, T2>\n// type A1 = { arr: string[] }\n// type A2 = { arr: number[] }\n// type A3 = { arr: boolean[] }\n// type TestA = Merge<A1, [A2, A3]>\n// interface I1 {\n// date: Timestamp\n// }\n// interface I2 {\n// date: Timestamp\n// }\n// const _a: I2 = { date: '' } as unknown as I2\n// type TestI = Merge<I1, [I2]>\n// // ReturnType<(typeof merge)<I1, I2>>\n// const a = merge(_a, [_a])\n// interface Arguments extends Record<string | number | symbol, unknown> {\n// key: string;\n// }\n// const aa1: Arguments = { key: \"value1\" }\n// const aa2: Arguments = { key: \"value2\" }\n// const aa = merge(a1, a2);\n// interface Barguments {\n// key: string\n// }\n// const ba1: Barguments = { key: 'value1' }\n// const ba2: Barguments = { key: 'value2' }\n// const ba = merge(ba1, ba2)\n// interface Carguments {\n// key: string\n// }\n// const ca = merge<Carguments, Carguments[]>({ key: 'value1' }, { key: 'value2' })\n// type P = Pop<Carguments[]>\n","export * from './extensions.js';\nexport * from './merge.js';\n"]}
|