@domql/utils 2.3.151 → 2.3.153
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/cjs/object.js +4 -0
- package/dist/cjs/string.js +2 -0
- package/object.js +2 -0
- package/package.json +2 -2
- package/string.js +1 -0
package/dist/cjs/object.js
CHANGED
|
@@ -64,6 +64,8 @@ const map = (obj, extention, element) => {
|
|
|
64
64
|
};
|
|
65
65
|
const merge = (element, obj, excludeFrom = []) => {
|
|
66
66
|
for (const e in obj) {
|
|
67
|
+
if (e === "__proto__")
|
|
68
|
+
continue;
|
|
67
69
|
if (excludeFrom.includes(e) || e.startsWith("__"))
|
|
68
70
|
continue;
|
|
69
71
|
const elementProp = element[e];
|
|
@@ -126,6 +128,8 @@ const mergeArrayExclude = (arr, excl = []) => {
|
|
|
126
128
|
const deepClone = (obj, excludeFrom = []) => {
|
|
127
129
|
const o = (0, import_types.isArray)(obj) ? [] : {};
|
|
128
130
|
for (const prop in obj) {
|
|
131
|
+
if (prop === "__proto__")
|
|
132
|
+
continue;
|
|
129
133
|
if (excludeFrom.includes(prop) || prop.startsWith("__"))
|
|
130
134
|
continue;
|
|
131
135
|
let objProp = obj[prop];
|
package/dist/cjs/string.js
CHANGED
|
@@ -31,6 +31,8 @@ const stringIncludesAny = (str, characters) => {
|
|
|
31
31
|
return false;
|
|
32
32
|
};
|
|
33
33
|
const replaceLiteralsWithObjectFields = (str, state) => {
|
|
34
|
+
if (!str.includes("{{"))
|
|
35
|
+
return str;
|
|
34
36
|
return str.replace(/\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g, (_, parentPath, variable) => {
|
|
35
37
|
if (parentPath) {
|
|
36
38
|
const parentLevels = parentPath.match(/\.\.\//g).length;
|
package/object.js
CHANGED
|
@@ -24,6 +24,7 @@ export const map = (obj, extention, element) => {
|
|
|
24
24
|
|
|
25
25
|
export const merge = (element, obj, excludeFrom = []) => {
|
|
26
26
|
for (const e in obj) {
|
|
27
|
+
if (e === '__proto__') continue
|
|
27
28
|
if (excludeFrom.includes(e) || e.startsWith('__')) continue
|
|
28
29
|
const elementProp = element[e]
|
|
29
30
|
const objProp = obj[e]
|
|
@@ -95,6 +96,7 @@ export const mergeArrayExclude = (arr, excl = []) => {
|
|
|
95
96
|
export const deepClone = (obj, excludeFrom = []) => {
|
|
96
97
|
const o = isArray(obj) ? [] : {}
|
|
97
98
|
for (const prop in obj) {
|
|
99
|
+
if (prop === '__proto__') continue
|
|
98
100
|
if (excludeFrom.includes(prop) || prop.startsWith('__')) continue
|
|
99
101
|
let objProp = obj[prop]
|
|
100
102
|
if (prop === 'extend' && isArray(objProp)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.153",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"@domql/key": "latest",
|
|
24
24
|
"@domql/tags": "latest"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "91cb404c3b97ab43b164ecb85a572d37e0976d97",
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@babel/core": "^7.12.0"
|
|
29
29
|
}
|
package/string.js
CHANGED
|
@@ -10,6 +10,7 @@ export const stringIncludesAny = (str, characters) => {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const replaceLiteralsWithObjectFields = (str, state) => {
|
|
13
|
+
if (!str.includes('{{')) return str
|
|
13
14
|
return str.replace(/\{\{\s*((?:\.\.\/)+)?([^}\s]+)\s*\}\}/g, (_, parentPath, variable) => {
|
|
14
15
|
if (parentPath) {
|
|
15
16
|
const parentLevels = parentPath.match(/\.\.\//g).length
|