domql 1.5.94 → 1.5.95
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/package.json +5 -4
- package/src/element/state.js +1 -1
- package/src/utils/object.js +5 -5
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "domql",
|
|
3
3
|
"description": "DOM rendering Javascript framework at early stage.",
|
|
4
4
|
"author": "symbo.ls",
|
|
5
|
-
"version": "1.5.
|
|
5
|
+
"version": "1.5.95",
|
|
6
6
|
"repository": "https://github.com/domql/domql",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"registry": "https://registry.npmjs.org"
|
|
@@ -15,11 +15,12 @@
|
|
|
15
15
|
"packages"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"
|
|
18
|
+
"compile": "npx esbuild src/index.js --target=es2020 --format=cjs --bundle --sourcemap=external --outfile=dist/index.cjs.js",
|
|
19
|
+
"prepublish": "rm -rf dist && yarn compile && yarn test:lint",
|
|
19
20
|
"start": "parcel examples/index.html --no-cache",
|
|
20
21
|
"build": "parcel build examples/index.html",
|
|
21
|
-
"
|
|
22
|
-
"test": "yarn
|
|
22
|
+
"test:lint": "npx standard \"src/**/*.js\"",
|
|
23
|
+
"test": "yarn test:lint; jest --coverage --coverageReporters=text-lcov | coveralls",
|
|
23
24
|
"test-watch": "jest --watch"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
package/src/element/state.js
CHANGED
|
@@ -6,7 +6,7 @@ import { is, isObject, isFunction, isUndefined } from '@domql/utils'
|
|
|
6
6
|
|
|
7
7
|
export const IGNORE_STATE_PARAMS = [
|
|
8
8
|
'update', 'parse', 'clean', 'create', 'parent', '__element', '__depends', '__ref', '__root',
|
|
9
|
-
'__components',
|
|
9
|
+
'__components', '__extend', '__cached',
|
|
10
10
|
'__projectSystem', '__projectState', '__projectComponents', '__projectPages', '__projectFiddles',
|
|
11
11
|
'projectStateUpdate', 'projectSystemUpdate'
|
|
12
12
|
]
|
package/src/utils/object.js
CHANGED
|
@@ -123,16 +123,16 @@ export const clone = obj => {
|
|
|
123
123
|
/**
|
|
124
124
|
* Deep cloning of object
|
|
125
125
|
*/
|
|
126
|
-
export const deepClone = (obj, excluding = ['parent', 'node', '__element', 'state', '__root', 'context']) => {
|
|
126
|
+
export const deepClone = (obj, excluding = ['parent', 'node', '__element', 'state', '__root', '__cached', 'context']) => {
|
|
127
127
|
const o = isArray(obj) ? [] : {}
|
|
128
128
|
for (const prop in obj) {
|
|
129
129
|
if (excluding.indexOf(prop) > -1) continue
|
|
130
130
|
let objProp = obj[prop]
|
|
131
131
|
if (prop === 'extend' && isArray(objProp)) {
|
|
132
|
-
objProp = mergeArray(objProp)
|
|
132
|
+
objProp = mergeArray(objProp, excluding)
|
|
133
133
|
}
|
|
134
134
|
if (isObjectLike(objProp)) {
|
|
135
|
-
o[prop] = deepClone(objProp)
|
|
135
|
+
o[prop] = deepClone(objProp, excluding)
|
|
136
136
|
} else o[prop] = objProp
|
|
137
137
|
}
|
|
138
138
|
return o
|
|
@@ -217,8 +217,8 @@ export const mergeIfExisted = (a, b) => {
|
|
|
217
217
|
/**
|
|
218
218
|
* Merges array extends
|
|
219
219
|
*/
|
|
220
|
-
export const mergeArray = (arr) => {
|
|
221
|
-
return arr.reduce((a, c) => deepMerge(a, deepClone(c)), {})
|
|
220
|
+
export const mergeArray = (arr, excluding = ['parent', 'node', '__element', 'state', '__root', '__cached', 'context']) => {
|
|
221
|
+
return arr.reduce((a, c) => deepMerge(a, deepClone(c, excluding)), {})
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
/**
|