@domql/state 2.5.159 → 2.5.162

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/create.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  import { triggerEventOn } from '@domql/event'
4
- import { deepCloneWithExtend, exec, is, isArray, isFunction, isObject, isUndefined } from '@domql/utils'
4
+ import { deepClone, exec, is, isArray, isFunction, isObject, isUndefined } from '@domql/utils'
5
5
  import { IGNORE_STATE_PARAMS } from './ignore'
6
6
  import {
7
7
  add,
@@ -59,7 +59,7 @@ const applyDependentState = (element, state) => {
59
59
  const { __ref, ref, __element } = state //
60
60
  const origState = exec(__ref || ref || __element?.state, element)
61
61
  if (!origState) return
62
- const dependentState = deepCloneWithExtend(origState, IGNORE_STATE_PARAMS)
62
+ const dependentState = deepClone(origState, IGNORE_STATE_PARAMS)
63
63
  const newDepends = { [element.key]: dependentState }
64
64
 
65
65
  const __depends = isObject(origState.__depends)
@@ -57,7 +57,7 @@ const applyDependentState = (element, state) => {
57
57
  const origState = (0, import_utils.exec)(__ref || ref || (__element == null ? void 0 : __element.state), element);
58
58
  if (!origState)
59
59
  return;
60
- const dependentState = (0, import_utils.deepCloneWithExtend)(origState, import_ignore.IGNORE_STATE_PARAMS);
60
+ const dependentState = (0, import_utils.deepClone)(origState, import_ignore.IGNORE_STATE_PARAMS);
61
61
  const newDepends = { [element.key]: dependentState };
62
62
  const __depends = (0, import_utils.isObject)(origState.__depends) ? { ...origState.__depends, ...newDepends } : newDepends;
63
63
  if (Array.isArray(origState)) {
@@ -96,7 +96,7 @@ const createInheritedState = (element, parent) => {
96
96
  if ((0, import_utils.isUndefined)(inheritedState))
97
97
  return element.state;
98
98
  if ((0, import_utils.is)(inheritedState)("object", "array")) {
99
- return (0, import_utils.deepCloneWithExtend)(inheritedState, import_ignore.IGNORE_STATE_PARAMS);
99
+ return (0, import_utils.deepClone)(inheritedState, { exclude: import_ignore.IGNORE_STATE_PARAMS });
100
100
  } else if ((0, import_utils.is)(inheritedState)("string", "number", "boolean")) {
101
101
  ref.__stateType = typeof inheritedState;
102
102
  return { value: inheritedState };
@@ -136,12 +136,12 @@ const remove = function(key, options = {}) {
136
136
  };
137
137
  const set = function(val, options = {}) {
138
138
  const state = this;
139
- const value = (0, import_utils.deepCloneWithExtend)(val);
139
+ const value = (0, import_utils.deepClone)(val);
140
140
  return state.clean({ preventStateUpdate: true, ...options }).update(value, { replace: true, ...options });
141
141
  };
142
142
  const reset = function(options = {}) {
143
143
  const state = this;
144
- const value = (0, import_utils.deepCloneWithExtend)(state.parse());
144
+ const value = (0, import_utils.deepClone)(state.parse());
145
145
  return state.set(value, { replace: true, ...options });
146
146
  };
147
147
  const apply = function(func, options = {}) {
package/inherit.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { deepCloneWithExtend, is, isObjectLike, isUndefined } from '@domql/utils'
3
+ import { deepClone, is, isObjectLike, isUndefined } from '@domql/utils'
4
4
  import { IGNORE_STATE_PARAMS } from './ignore'
5
5
 
6
6
  export const getRootStateInKey = (stateKey, parentState) => {
@@ -69,7 +69,7 @@ export const createInheritedState = (element, parent) => {
69
69
  if (isUndefined(inheritedState)) return element.state
70
70
 
71
71
  if (is(inheritedState)('object', 'array')) {
72
- return deepCloneWithExtend(inheritedState, IGNORE_STATE_PARAMS)
72
+ return deepClone(inheritedState, { exclude: IGNORE_STATE_PARAMS })
73
73
  } else if (is(inheritedState)('string', 'number', 'boolean')) {
74
74
  ref.__stateType = typeof inheritedState
75
75
  return { value: inheritedState }
package/methods.js CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { isArray, deepCloneWithExtend, isFunction, isObject, isString } from '@domql/utils'
3
+ import { isArray, deepClone, isFunction, isObject, isString } from '@domql/utils'
4
4
 
5
5
  import { IGNORE_STATE_PARAMS } from './ignore'
6
6
 
@@ -110,14 +110,14 @@ export const remove = function (key, options = {}) {
110
110
 
111
111
  export const set = function (val, options = {}) {
112
112
  const state = this
113
- const value = deepCloneWithExtend(val)
113
+ const value = deepClone(val)
114
114
  return state.clean({ preventStateUpdate: true, ...options })
115
115
  .update(value, { replace: true, ...options })
116
116
  }
117
117
 
118
118
  export const reset = function (options = {}) {
119
119
  const state = this
120
- const value = deepCloneWithExtend(state.parse())
120
+ const value = deepClone(state.parse())
121
121
  return state.set(value, { replace: true, ...options })
122
122
  }
123
123
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/state",
3
- "version": "2.5.159",
3
+ "version": "2.5.162",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "dist/esm/index.js",
@@ -23,13 +23,13 @@
23
23
  "build:esm": "npx esbuild *.js --target=es2017 --format=esm --outdir=dist/esm",
24
24
  "build:cjs": "npx esbuild *.js --target=node16 --format=cjs --outdir=dist/cjs",
25
25
  "build:iife": "npx esbuild *.js --target=node16 --format=iife --outdir=dist/iife",
26
- "build": "yarn build:cjs",
27
- "prepublish": "rimraf -I dist && yarn build && yarn copy:package:cjs"
26
+ "build": "npm run build:cjs",
27
+ "prepublish": "rimraf -I dist && npm run build && npm run copy:package:cjs"
28
28
  },
29
29
  "dependencies": {
30
- "@domql/event": "^2.5.159",
31
- "@domql/report": "^2.5.0",
32
- "@domql/utils": "^2.5.159"
30
+ "@domql/event": "^2.5.162",
31
+ "@domql/report": "^2.5.162",
32
+ "@domql/utils": "^2.5.162"
33
33
  },
34
- "gitHead": "7595b1077d3096c3ee7b1da5eef02aa9248f2ed6"
34
+ "gitHead": "0aeb25f284d863a57821a0a74937c2b9babb7969"
35
35
  }