@domql/utils 2.27.11 → 2.27.15
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 +1 -3
- package/dist/cjs/component.js +1 -2
- package/dist/cjs/env.js +2 -0
- package/dist/cjs/object.js +1 -2
- package/dist/esm/component.js +1 -2
- package/dist/esm/env.js +2 -0
- package/dist/esm/object.js +1 -2
- package/env.js +1 -0
- package/object.js +1 -3
- package/package.json +4 -4
package/component.js
CHANGED
|
@@ -5,8 +5,6 @@ import { joinArrays } from './array.js'
|
|
|
5
5
|
import { deepClone, exec } from './object.js'
|
|
6
6
|
import { isArray, isFunction, isObject, isString } from './types.js'
|
|
7
7
|
|
|
8
|
-
const ENV = process.env.NODE_ENV
|
|
9
|
-
|
|
10
8
|
export const checkIfKeyIsComponent = key => {
|
|
11
9
|
const isFirstKeyString = isString(key)
|
|
12
10
|
if (!isFirstKeyString) return
|
|
@@ -177,7 +175,7 @@ export const applyComponentFromContext = (element, parent, options) => {
|
|
|
177
175
|
components[execExtend] || components['smbls.' + execExtend]
|
|
178
176
|
if (componentExists) element.extend = componentExists
|
|
179
177
|
else {
|
|
180
|
-
if (isNotProduction(
|
|
178
|
+
if (isNotProduction() && options.verbose) {
|
|
181
179
|
console.warn(execExtend, 'is not in library', components, element)
|
|
182
180
|
console.warn('replacing with ', {})
|
|
183
181
|
}
|
package/dist/cjs/component.js
CHANGED
|
@@ -39,7 +39,6 @@ var import_env = require("./env.js");
|
|
|
39
39
|
var import_array = require("./array.js");
|
|
40
40
|
var import_object = require("./object.js");
|
|
41
41
|
var import_types = require("./types.js");
|
|
42
|
-
const ENV = process.env.NODE_ENV;
|
|
43
42
|
const checkIfKeyIsComponent = (key) => {
|
|
44
43
|
const isFirstKeyString = (0, import_types.isString)(key);
|
|
45
44
|
if (!isFirstKeyString) return;
|
|
@@ -178,7 +177,7 @@ const applyComponentFromContext = (element, parent, options) => {
|
|
|
178
177
|
const componentExists = components[execExtend] || components["smbls." + execExtend];
|
|
179
178
|
if (componentExists) element.extend = componentExists;
|
|
180
179
|
else {
|
|
181
|
-
if ((0, import_env.isNotProduction)(
|
|
180
|
+
if ((0, import_env.isNotProduction)() && options.verbose) {
|
|
182
181
|
console.warn(execExtend, "is not in library", components, element);
|
|
183
182
|
console.warn("replacing with ", {});
|
|
184
183
|
}
|
package/dist/cjs/env.js
CHANGED
|
@@ -18,6 +18,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var env_exports = {};
|
|
20
20
|
__export(env_exports, {
|
|
21
|
+
ENV: () => ENV,
|
|
21
22
|
NODE_ENV: () => NODE_ENV,
|
|
22
23
|
getNev: () => getNev,
|
|
23
24
|
isDevelopment: () => isDevelopment,
|
|
@@ -30,6 +31,7 @@ __export(env_exports, {
|
|
|
30
31
|
module.exports = __toCommonJS(env_exports);
|
|
31
32
|
// @preserve-env
|
|
32
33
|
const NODE_ENV = process.env.NODE_ENV;
|
|
34
|
+
const ENV = NODE_ENV;
|
|
33
35
|
const isProduction = (env = NODE_ENV) => env === "production";
|
|
34
36
|
const isTest = (env = NODE_ENV) => env === "testing" || env === "test";
|
|
35
37
|
const isTesting = isTest;
|
package/dist/cjs/object.js
CHANGED
|
@@ -64,7 +64,6 @@ var import_array = require("./array.js");
|
|
|
64
64
|
var import_string = require("./string.js");
|
|
65
65
|
var import_node = require("./node.js");
|
|
66
66
|
var import_env = require("./env.js");
|
|
67
|
-
const ENV = process.env.NODE_ENV;
|
|
68
67
|
const exec = (param, element, state, context) => {
|
|
69
68
|
if ((0, import_types.isFunction)(param)) {
|
|
70
69
|
return param.call(
|
|
@@ -695,7 +694,7 @@ const detectInfiniteLoop = (arr) => {
|
|
|
695
694
|
repeatCount = 1;
|
|
696
695
|
}
|
|
697
696
|
if (repeatCount >= maxRepeats * 2) {
|
|
698
|
-
if ((0, import_env.isNotProduction)(
|
|
697
|
+
if ((0, import_env.isNotProduction)()) {
|
|
699
698
|
console.warn(
|
|
700
699
|
"Warning: Potential infinite loop detected due to repeated sequence:",
|
|
701
700
|
pattern
|
package/dist/esm/component.js
CHANGED
|
@@ -21,7 +21,6 @@ import { isNotProduction } from "./env.js";
|
|
|
21
21
|
import { joinArrays } from "./array.js";
|
|
22
22
|
import { deepClone, exec } from "./object.js";
|
|
23
23
|
import { isArray, isFunction, isObject, isString } from "./types.js";
|
|
24
|
-
const ENV = process.env.NODE_ENV;
|
|
25
24
|
const checkIfKeyIsComponent = (key) => {
|
|
26
25
|
const isFirstKeyString = isString(key);
|
|
27
26
|
if (!isFirstKeyString) return;
|
|
@@ -159,7 +158,7 @@ const applyComponentFromContext = (element, parent, options) => {
|
|
|
159
158
|
const componentExists = components[execExtend] || components["smbls." + execExtend];
|
|
160
159
|
if (componentExists) element.extend = componentExists;
|
|
161
160
|
else {
|
|
162
|
-
if (isNotProduction(
|
|
161
|
+
if (isNotProduction() && options.verbose) {
|
|
163
162
|
console.warn(execExtend, "is not in library", components, element);
|
|
164
163
|
console.warn("replacing with ", {});
|
|
165
164
|
}
|
package/dist/esm/env.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @preserve-env
|
|
2
2
|
const NODE_ENV = process.env.NODE_ENV;
|
|
3
|
+
const ENV = NODE_ENV;
|
|
3
4
|
const isProduction = (env = NODE_ENV) => env === "production";
|
|
4
5
|
const isTest = (env = NODE_ENV) => env === "testing" || env === "test";
|
|
5
6
|
const isTesting = isTest;
|
|
@@ -8,6 +9,7 @@ const isDevelopment = (env = NODE_ENV) => env === "development" || env === "dev"
|
|
|
8
9
|
const getNev = (key, env = NODE_ENV) => env[key];
|
|
9
10
|
const isNotProduction = (env = NODE_ENV) => !isProduction(env);
|
|
10
11
|
export {
|
|
12
|
+
ENV,
|
|
11
13
|
NODE_ENV,
|
|
12
14
|
getNev,
|
|
13
15
|
isDevelopment,
|
package/dist/esm/object.js
CHANGED
|
@@ -33,7 +33,6 @@ import { mergeAndCloneIfArray, mergeArray } from "./array.js";
|
|
|
33
33
|
import { stringIncludesAny } from "./string.js";
|
|
34
34
|
import { isDOMNode } from "./node.js";
|
|
35
35
|
import { isNotProduction } from "./env.js";
|
|
36
|
-
const ENV = process.env.NODE_ENV;
|
|
37
36
|
const exec = (param, element, state, context) => {
|
|
38
37
|
if (isFunction(param)) {
|
|
39
38
|
return param.call(
|
|
@@ -663,7 +662,7 @@ const detectInfiniteLoop = (arr) => {
|
|
|
663
662
|
repeatCount = 1;
|
|
664
663
|
}
|
|
665
664
|
if (repeatCount >= maxRepeats * 2) {
|
|
666
|
-
if (isNotProduction(
|
|
665
|
+
if (isNotProduction()) {
|
|
667
666
|
console.warn(
|
|
668
667
|
"Warning: Potential infinite loop detected due to repeated sequence:",
|
|
669
668
|
pattern
|
package/env.js
CHANGED
package/object.js
CHANGED
|
@@ -17,8 +17,6 @@ import { stringIncludesAny } from './string.js'
|
|
|
17
17
|
import { isDOMNode } from './node.js'
|
|
18
18
|
import { isNotProduction } from './env.js'
|
|
19
19
|
|
|
20
|
-
const ENV = process.env.NODE_ENV
|
|
21
|
-
|
|
22
20
|
export const exec = (param, element, state, context) => {
|
|
23
21
|
if (isFunction(param)) {
|
|
24
22
|
return param.call(
|
|
@@ -889,7 +887,7 @@ export const detectInfiniteLoop = arr => {
|
|
|
889
887
|
|
|
890
888
|
// If the pattern repeats more than `maxRepeats`, throw a warning
|
|
891
889
|
if (repeatCount >= maxRepeats * 2) {
|
|
892
|
-
if (isNotProduction(
|
|
890
|
+
if (isNotProduction()) {
|
|
893
891
|
console.warn(
|
|
894
892
|
'Warning: Potential infinite loop detected due to repeated sequence:',
|
|
895
893
|
pattern
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@domql/utils",
|
|
3
|
-
"version": "2.27.
|
|
3
|
+
"version": "2.27.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "index.js",
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"copy:package:cjs": "cp ../../build/package-cjs.json dist/cjs/package.json",
|
|
22
|
-
"build:esm": "cross-env NODE_ENV=$NODE_ENV npx esbuild *.js --target=es2017 --format=esm --outdir=dist/esm --define:process.env.NODE_ENV=process.env.NODE_ENV",
|
|
23
|
-
"build:cjs": "cross-env NODE_ENV=$NODE_ENV npx esbuild *.js --target=node16 --format=cjs --outdir=dist/cjs --define:process.env.NODE_ENV=process.env.NODE_ENV",
|
|
22
|
+
"build:esm": "npx cross-env NODE_ENV=$NODE_ENV npx esbuild *.js --target=es2017 --format=esm --outdir=dist/esm --define:process.env.NODE_ENV=process.env.NODE_ENV",
|
|
23
|
+
"build:cjs": "npx cross-env NODE_ENV=$NODE_ENV npx esbuild *.js --target=node16 --format=cjs --outdir=dist/cjs --define:process.env.NODE_ENV=process.env.NODE_ENV",
|
|
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": "
|
|
27
|
+
"gitHead": "aa562640d37f34a66e567c177be8f6ab6b41eccc",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@babel/core": "^7.26.0"
|
|
30
30
|
}
|