@lowdefy/helpers 4.0.0-rc.0 → 4.0.0-rc.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/dist/LRUCache.js +1 -1
- package/dist/applyArrayIndices.js +1 -1
- package/dist/cachedPromises.js +1 -1
- package/dist/get.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mergeObjects.js +1 -1
- package/dist/omit.js +1 -1
- package/dist/serializer.js +1 -1
- package/dist/set.js +1 -1
- package/dist/stableStringify.js +6 -6
- package/dist/swap.js +1 -1
- package/dist/type.js +12 -11
- package/dist/unset.js +1 -1
- package/dist/urlQuery.js +1 -1
- package/dist/wait.js +1 -1
- package/package.json +8 -7
package/dist/LRUCache.js
CHANGED
package/dist/cachedPromises.js
CHANGED
package/dist/get.js
CHANGED
package/dist/index.js
CHANGED
package/dist/mergeObjects.js
CHANGED
package/dist/omit.js
CHANGED
package/dist/serializer.js
CHANGED
package/dist/set.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-plusplus */ /* eslint-disable no-use-before-define */ /* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
package/dist/stableStringify.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-continue */ /* eslint-disable no-plusplus */ /* eslint-disable consistent-return */ /* eslint-disable no-param-reassign */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -82,16 +82,16 @@ function stableStringify(obj, opts) {
|
|
|
82
82
|
throw new TypeError('Converting circular structure to JSON');
|
|
83
83
|
} else seen.push(node);
|
|
84
84
|
const keys = Object.keys(node).sort(cmp && cmp(node));
|
|
85
|
-
const
|
|
86
|
-
for(let
|
|
87
|
-
const ky = keys[
|
|
85
|
+
const out1 = [];
|
|
86
|
+
for(let i1 = 0; i1 < keys.length; i1++){
|
|
87
|
+
const ky = keys[i1];
|
|
88
88
|
const value = stringify(node, ky, node[ky], level + 1);
|
|
89
89
|
if (!value) continue;
|
|
90
90
|
const keyValue = JSON.stringify(ky) + colonSeparator + value;
|
|
91
|
-
|
|
91
|
+
out1.push(indent + space + keyValue);
|
|
92
92
|
}
|
|
93
93
|
seen.splice(seen.indexOf(node), 1);
|
|
94
|
-
return `{${
|
|
94
|
+
return `{${out1.join(',')}${indent}}`;
|
|
95
95
|
}({
|
|
96
96
|
'': obj
|
|
97
97
|
}, '', obj, 0);
|
package/dist/swap.js
CHANGED
package/dist/type.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable indent */ /* eslint-disable default-case */ /*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -65,12 +65,12 @@ function kindOf(val) {
|
|
|
65
65
|
// eslint-disable-next-line no-void
|
|
66
66
|
if (val === void 0) return 'undefined';
|
|
67
67
|
if (val === null) return 'null';
|
|
68
|
-
let
|
|
69
|
-
if (
|
|
70
|
-
if (
|
|
71
|
-
if (
|
|
72
|
-
if (
|
|
73
|
-
if (
|
|
68
|
+
let type = typeof val;
|
|
69
|
+
if (type === 'boolean') return 'boolean';
|
|
70
|
+
if (type === 'string') return 'string';
|
|
71
|
+
if (type === 'number') return 'number';
|
|
72
|
+
if (type === 'symbol') return 'symbol';
|
|
73
|
+
if (type === 'function') {
|
|
74
74
|
return isGeneratorFn(val) ? 'generatorfunction' : 'function';
|
|
75
75
|
}
|
|
76
76
|
if (isArray(val)) return 'array';
|
|
@@ -119,8 +119,8 @@ function kindOf(val) {
|
|
|
119
119
|
return 'generator';
|
|
120
120
|
}
|
|
121
121
|
// Non-plain objects
|
|
122
|
-
|
|
123
|
-
switch(
|
|
122
|
+
type = toString.call(val);
|
|
123
|
+
switch(type){
|
|
124
124
|
case '[object Object]':
|
|
125
125
|
return 'object';
|
|
126
126
|
// iterators
|
|
@@ -134,7 +134,7 @@ function kindOf(val) {
|
|
|
134
134
|
return 'arrayiterator';
|
|
135
135
|
}
|
|
136
136
|
// other
|
|
137
|
-
return
|
|
137
|
+
return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
|
|
138
138
|
}
|
|
139
139
|
const reISO = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*))(?:Z|(\+|-)([\d|:]*))?$/;
|
|
140
140
|
function isDateString(val) {
|
|
@@ -158,7 +158,8 @@ type.isSet = (value)=>kindOf(value) === 'set';
|
|
|
158
158
|
type.isNull = (value)=>kindOf(value) === 'null';
|
|
159
159
|
type.isUndefined = (value)=>kindOf(value) === 'undefined';
|
|
160
160
|
type.isNone = (value)=>kindOf(value) === 'undefined' || kindOf(value) === 'null';
|
|
161
|
-
type.isPrimitive = (value)=>kindOf(value) === 'undefined' ||
|
|
161
|
+
type.isPrimitive = (value)=>kindOf(value) === 'undefined' || // are we making undefined a primative ?
|
|
162
|
+
kindOf(value) === 'null' || kindOf(value) === 'string' || kindOf(value) === 'number' || kindOf(value) === 'boolean' || kindOf(value) === 'date';
|
|
162
163
|
type.isEmptyObject = (value)=>kindOf(value) === 'object' && Object.keys(value).length === 0;
|
|
163
164
|
// Lowdefy operator types
|
|
164
165
|
function isName(value) {
|
package/dist/unset.js
CHANGED
package/dist/urlQuery.js
CHANGED
package/dist/wait.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/helpers",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -34,21 +34,22 @@
|
|
|
34
34
|
"build": "swc src --out-dir dist --config-file ../../../.swcrc --delete-dir-on-start",
|
|
35
35
|
"clean": "rm -rf dist",
|
|
36
36
|
"prepublishOnly": "pnpm build",
|
|
37
|
-
"test": "
|
|
37
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"lodash.merge": "4.6.2",
|
|
41
|
-
"query-string": "
|
|
41
|
+
"query-string": "8.1.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@
|
|
45
|
-
"@swc/
|
|
46
|
-
"@swc/
|
|
44
|
+
"@jest/globals": "28.1.0",
|
|
45
|
+
"@swc/cli": "0.1.59",
|
|
46
|
+
"@swc/core": "1.3.24",
|
|
47
|
+
"@swc/jest": "0.2.24",
|
|
47
48
|
"jest": "28.1.0",
|
|
48
49
|
"jest-diff": "28.1.0"
|
|
49
50
|
},
|
|
50
51
|
"publishConfig": {
|
|
51
52
|
"access": "public"
|
|
52
53
|
},
|
|
53
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "ac0dec732efb3b3cb06c82941d8f829c9fa65dff"
|
|
54
55
|
}
|