@domql/utils 2.28.58 → 2.28.60

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/component.js CHANGED
@@ -196,28 +196,28 @@ export const hasVariantProp = element => {
196
196
  if (isObject(props) && isString(props.variant)) return true
197
197
  }
198
198
 
199
- export const getChildrenComponentsByKey = (key, el) => {
200
- if (key === el.key || el.__ref.__componentKey === key) {
201
- return el
199
+ export function getChildrenComponentsByKey (key) {
200
+ if (key === thiskey || this.__ref.__componentKey === key) {
201
+ return this
202
202
  }
203
203
 
204
204
  // Check if the prop is "extend" and it's either a string or an array
205
- if (el.extend) {
205
+ if (this.extend) {
206
206
  // Add the value of the extend key to the result array
207
- const foundString = isString(el.extend) && el.extend === key
207
+ const foundString = isString(this.extend) && this.extend === key
208
208
  const foundInArray =
209
- isArray(el.extend) && el.extend.filter(v => v === key).length
210
- if (foundString || foundInArray) return el
209
+ isArray(this.extend) && this.extend.filter(v => v === key).length
210
+ if (foundString || foundInArray) return this
211
211
  }
212
212
 
213
- if (el.parent && el.parent.childExtend) {
213
+ if (this.parent && this.parent.childExtend) {
214
214
  // Add the value of the extend key to the result array
215
215
  const foundString =
216
- isString(el.parent.childExtend) && el.parent.childExtend === key
216
+ isString(this.parent.childExtend) && this.parent.childExtend === key
217
217
  const foundInArray =
218
- isArray(el.parent.childExtend) &&
219
- el.parent.childExtend.filter(v => v === key).length
220
- if (foundString || foundInArray) return el
218
+ isArray(this.parent.childExtend) &&
219
+ this.parent.childExtend.filter(v => v === key).length
220
+ if (foundString || foundInArray) return this
221
221
  }
222
222
  }
223
223
 
@@ -194,21 +194,21 @@ const hasVariantProp = (element) => {
194
194
  const { props } = element;
195
195
  if ((0, import_types.isObject)(props) && (0, import_types.isString)(props.variant)) return true;
196
196
  };
197
- const getChildrenComponentsByKey = (key, el) => {
198
- if (key === el.key || el.__ref.__componentKey === key) {
199
- return el;
197
+ function getChildrenComponentsByKey(key) {
198
+ if (key === thiskey || this.__ref.__componentKey === key) {
199
+ return this;
200
200
  }
201
- if (el.extend) {
202
- const foundString = (0, import_types.isString)(el.extend) && el.extend === key;
203
- const foundInArray = (0, import_types.isArray)(el.extend) && el.extend.filter((v) => v === key).length;
204
- if (foundString || foundInArray) return el;
201
+ if (this.extend) {
202
+ const foundString = (0, import_types.isString)(this.extend) && this.extend === key;
203
+ const foundInArray = (0, import_types.isArray)(this.extend) && this.extend.filter((v) => v === key).length;
204
+ if (foundString || foundInArray) return this;
205
205
  }
206
- if (el.parent && el.parent.childExtend) {
207
- const foundString = (0, import_types.isString)(el.parent.childExtend) && el.parent.childExtend === key;
208
- const foundInArray = (0, import_types.isArray)(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
209
- if (foundString || foundInArray) return el;
206
+ if (this.parent && this.parent.childExtend) {
207
+ const foundString = (0, import_types.isString)(this.parent.childExtend) && this.parent.childExtend === key;
208
+ const foundInArray = (0, import_types.isArray)(this.parent.childExtend) && this.parent.childExtend.filter((v) => v === key).length;
209
+ if (foundString || foundInArray) return this;
210
210
  }
211
- };
211
+ }
212
212
  const getExtendsInElement = (obj) => {
213
213
  let result = [];
214
214
  function traverse(o) {
@@ -175,21 +175,21 @@ const hasVariantProp = (element) => {
175
175
  const { props } = element;
176
176
  if (isObject(props) && isString(props.variant)) return true;
177
177
  };
178
- const getChildrenComponentsByKey = (key, el) => {
179
- if (key === el.key || el.__ref.__componentKey === key) {
180
- return el;
178
+ function getChildrenComponentsByKey(key) {
179
+ if (key === thiskey || this.__ref.__componentKey === key) {
180
+ return this;
181
181
  }
182
- if (el.extend) {
183
- const foundString = isString(el.extend) && el.extend === key;
184
- const foundInArray = isArray(el.extend) && el.extend.filter((v) => v === key).length;
185
- if (foundString || foundInArray) return el;
182
+ if (this.extend) {
183
+ const foundString = isString(this.extend) && this.extend === key;
184
+ const foundInArray = isArray(this.extend) && this.extend.filter((v) => v === key).length;
185
+ if (foundString || foundInArray) return this;
186
186
  }
187
- if (el.parent && el.parent.childExtend) {
188
- const foundString = isString(el.parent.childExtend) && el.parent.childExtend === key;
189
- const foundInArray = isArray(el.parent.childExtend) && el.parent.childExtend.filter((v) => v === key).length;
190
- if (foundString || foundInArray) return el;
187
+ if (this.parent && this.parent.childExtend) {
188
+ const foundString = isString(this.parent.childExtend) && this.parent.childExtend === key;
189
+ const foundInArray = isArray(this.parent.childExtend) && this.parent.childExtend.filter((v) => v === key).length;
190
+ if (foundString || foundInArray) return this;
191
191
  }
192
- };
192
+ }
193
193
  const getExtendsInElement = (obj) => {
194
194
  let result = [];
195
195
  function traverse(o) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domql/utils",
3
- "version": "2.28.58",
3
+ "version": "2.28.60",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "index.js",
@@ -24,7 +24,7 @@
24
24
  "build": "npx rimraf -I dist; npm run build:cjs; npm run build:esm",
25
25
  "prepublish": "npm run build; npm run copy:package:cjs"
26
26
  },
27
- "gitHead": "02242b753d001ee74bb07899ee49679b77176068",
27
+ "gitHead": "0ec4d7cf10409440f682ecd5cf2cbf47573a14eb",
28
28
  "devDependencies": {
29
29
  "@babel/core": "^7.27.1"
30
30
  }