@cyberskill/shared 2.21.0 → 2.26.0
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/config/eslint/index.cjs +1 -1
- package/dist/config/eslint/index.d.ts +2 -7
- package/dist/config/eslint/index.js +1 -1
- package/dist/config/vitest/vitest.e2e.cjs +1 -1
- package/dist/config/vitest/vitest.e2e.js +1 -1
- package/dist/config/vitest/vitest.unit.cjs +1 -1
- package/dist/config/vitest/vitest.unit.js +1 -1
- package/dist/config/vitest/vitest.unit.setup.d.ts +0 -1
- package/dist/node/cli/index.cjs +4 -4
- package/dist/node/cli/index.js +56 -51
- package/dist/node/command/command.util.cjs +2 -2
- package/dist/node/command/command.util.d.ts +4 -1
- package/dist/node/command/command.util.js +125 -112
- package/dist/node/express/express.type.d.ts +2 -0
- package/dist/node/express/express.util.cjs +1 -1
- package/dist/node/express/express.util.js +53 -47
- package/dist/node/mongo/index.cjs +1 -1
- package/dist/node/mongo/index.d.ts +1 -0
- package/dist/node/mongo/index.js +15 -12
- package/dist/node/mongo/mongo.controller.cjs +1 -0
- package/dist/node/mongo/mongo.controller.d.ts +317 -0
- package/dist/node/mongo/mongo.controller.js +956 -0
- package/dist/node/mongo/mongo.type.d.ts +9 -10
- package/dist/node/mongo/mongo.util.cjs +5 -5
- package/dist/node/mongo/mongo.util.d.ts +26 -315
- package/dist/node/mongo/mongo.util.js +314 -1241
- package/dist/node/path/path.constant.cjs +1 -1
- package/dist/node/path/path.constant.d.ts +2 -2
- package/dist/node/path/path.constant.js +43 -43
- package/dist/util/common/common.util.cjs +1 -1
- package/dist/util/common/common.util.d.ts +3 -0
- package/dist/util/common/common.util.js +36 -35
- package/dist/util/object/object.util.cjs +1 -1
- package/dist/util/object/object.util.js +49 -45
- package/dist/util/validate/validate.util.cjs +1 -1
- package/dist/util/validate/validate.util.js +1 -1
- package/package.json +25 -24
- /package/dist/node/mongo/{mongo-controller.test.unit.d.ts → mongo.controller.test.unit.d.ts} +0 -0
- /package/dist/node/mongo/{mongo.test.unit.d.ts → mongo.util.test.unit.d.ts} +0 -0
- /package/dist/node_modules/.pnpm/{vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.3.0_sass@1.97.0_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.cjs +0 -0
- /package/dist/node_modules/.pnpm/{vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.3.0_sass@1.97.0_tsx@4.21.0_yaml@2.8.2 → vitest@4.0.16_@types_node@25.0.3_jiti@2.6.1_jsdom@27.4.0_sass@1.97.2_tsx@4.21.0_yaml@2.8.2}/node_modules/vitest/dist/config.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("fs-extra"),n=require("./path.util.cjs"),e=require("../command/command.type.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const te=require("fs-extra"),n=require("./path.util.cjs"),e=require("../command/command.type.cjs"),T=require("../command/command.util.cjs"),Ee=require("../package/package.util.cjs"),_=require("../package/package.type.cjs"),ae=require("../../config/env/env.util.cjs");var Ce=Object.defineProperty,v=Object.getOwnPropertySymbols,Ie=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable,Y=(E,a,t)=>a in E?Ce(E,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):E[a]=t,ce=(E,a)=>{for(var t in a||(a={}))Ie.call(a,t)&&Y(E,t,a[t]);if(v)for(var t of v(a))se.call(a,t)&&Y(E,t,a[t]);return E},me=(E,a,t)=>new Promise((p,r)=>{var i=c=>{try{y(t.next(c))}catch(L){r(L)}},G=c=>{try{y(t.throw(c))}catch(L){r(L)}},y=c=>c.done?p(c.value):Promise.resolve(c.value).then(i,G);y((t=t.apply(E,a)).next())});const re=ae.getEnv(),P=re.CWD,l="@cyberskill/shared",u="node_modules",g="dist",$="public",K="package.json",V="package-lock.json",F="tsconfig.json",W=".gitignore",b=".simple-git-hooks.json",w="pnpm-lock.yaml",B=".git/hooks/",H=".git/COMMIT_EDITMSG",U=".migrate-mongo.config.js",I=te.readJsonSync(n.resolveWorkingPath(K)).name===l?n.join(P,g):n.join(P,u,l,g),Te="cyberskill",pe="src/node/cli/index.ts",A="eslint",d="eslint",M="vitest",S="vitest",j="@commitlint/cli",J="@commitlint/config-conventional",R="commitlint",q="lint-staged",h="lint-staged",x="typescript",X="tsc",m="tsx",f="git",s="pnpm",z="pnpm exec",Q="simple-git-hooks",Z="simple-git-hooks",ee="@eslint/config-inspector",oe="eslint-config-inspector",ne="node-modules-inspector",_e="node-modules-inspector",N="migrate-mongo",O="./node_modules/migrate-mongo/bin/migrate-mongo",D="storybook",k="storybook",C={CYBERSKILL_DIRECTORY:I,WORKING_DIRECTORY:P,PUBLIC_DIRECTORY:n.resolveWorkingPath($),TS_CONFIG:n.resolveWorkingPath(F),GIT_IGNORE:n.resolveWorkingPath(W),GIT_HOOK:n.resolveWorkingPath(B),GIT_COMMIT_MSG:n.resolveWorkingPath(H),SIMPLE_GIT_HOOKS_JSON:n.resolveWorkingPath(b),PACKAGE_JSON:n.resolveWorkingPath(K),PACKAGE_LOCK_JSON:n.resolveWorkingPath(V),PNPM_LOCK_YAML:n.resolveWorkingPath(w),NODE_MODULES:n.resolveWorkingPath(u),MIGRATE_MONGO_CONFIG:n.resolveWorkingPath(U),LINT_STAGED_CONFIG:n.resolveWorkingPath(`${I}/config/lint-staged/index.js`),COMMITLINT_CONFIG:n.resolveWorkingPath(`${I}/config/commitlint/index.js`),VITEST_UNIT_CONFIG:n.resolveWorkingPath(`${I}/config/vitest/vitest.unit.js`),VITEST_E2E_CONFIG:n.resolveWorkingPath(`${I}/config/vitest/vitest.e2e.js`),STORYBOOK_MAIN_CONFIG:n.resolveWorkingPath(`${I}/config/storybook/storybook.main.js`),STORYBOOK_PREVIEW_CONFIG:n.resolveWorkingPath(`${I}/config/storybook/storybook.preview.js`)};function ie({isCurrentProject:E}){return ce({"pre-commit":h,"commit-msg":R},E?{"pre-push":T.rawCommand(`${f} pull`)}:{"pre-push":T.rawCommand(`${s} build`)})}function o({type:E,packages:a,command:t}){const p=a==null?void 0:a.reduce((r,i)=>(r.some(G=>G.name===i.name)||r.push(i),r),[]);return()=>me(null,null,function*(){switch(E){case e.E_CommandType.CLI:return p!=null&&p.length&&(yield Ee.setupPackages(p,{install:!0})),T.formatCommand(T.rawCommand(`${z} ${t}`));case e.E_CommandType.STRING:return T.formatCommand(T.rawCommand(t));default:throw new Error("Unsupported command type")}})}const Ne={simpleGitHooks:o({type:e.E_CommandType.CLI,packages:[{name:Q,type:_.E_PackageType.DEV_DEPENDENCY}],command:Z}),eslintInspect:o({type:e.E_CommandType.CLI,packages:[{name:ee,type:_.E_PackageType.DEV_DEPENDENCY}],command:oe}),nodeModulesInspect:o({type:e.E_CommandType.CLI,packages:[{name:ne,type:_.E_PackageType.DEV_DEPENDENCY}],command:_e}),eslintCheck:o({type:e.E_CommandType.CLI,packages:[{name:A,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${d} ${C.WORKING_DIRECTORY} --no-cache`}),eslintFix:o({type:e.E_CommandType.CLI,packages:[{name:A,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${d} ${C.WORKING_DIRECTORY} --fix --no-cache`}),typescriptCheck:o({type:e.E_CommandType.CLI,packages:[{name:x,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${X} -p ${C.TS_CONFIG} --noEmit`}),testUnit:o({type:e.E_CommandType.CLI,packages:[{name:M,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${S} --config ${C.VITEST_UNIT_CONFIG}`}),testE2e:o({type:e.E_CommandType.CLI,packages:[{name:M,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${S} --config ${C.VITEST_E2E_CONFIG}`}),mongoMigrateCreate:E=>{if(!/^[\w-]+$/.test(E))throw new Error("Migration name must only contain alphanumeric characters, underscores, and hyphens.");return o({type:e.E_CommandType.CLI,packages:[{name:m,type:_.E_PackageType.DEPENDENCY},{name:N,type:_.E_PackageType.DEPENDENCY}],command:`${m} ${O} create ${E} -f ${C.MIGRATE_MONGO_CONFIG}`})()},mongoMigrateUp:o({type:e.E_CommandType.CLI,packages:[{name:m,type:_.E_PackageType.DEPENDENCY},{name:N,type:_.E_PackageType.DEPENDENCY}],command:`${m} ${O} up -f ${C.MIGRATE_MONGO_CONFIG}`}),mongoMigrateDown:o({type:e.E_CommandType.CLI,packages:[{name:m,type:_.E_PackageType.DEPENDENCY},{name:N,type:_.E_PackageType.DEPENDENCY}],command:`${m} ${O} down -f ${C.MIGRATE_MONGO_CONFIG}`}),commitLint:o({type:e.E_CommandType.CLI,packages:[{name:j,type:_.E_PackageType.DEV_DEPENDENCY},{name:J,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${R} --edit ${C.GIT_COMMIT_MSG} --config ${C.COMMITLINT_CONFIG}`}),lintStaged:o({type:e.E_CommandType.CLI,packages:[{name:q,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${h} --config ${C.LINT_STAGED_CONFIG}`}),configureGitHook:o({type:e.E_CommandType.STRING,command:`${f} config core.hooksPath ${C.GIT_HOOK}`}),build:o({type:e.E_CommandType.STRING,command:`${s} run --if-present build`}),pnpmInstallStandard:o({type:e.E_CommandType.STRING,command:`${s} install --ignore-scripts`}),pnpmInstallLegacy:o({type:e.E_CommandType.STRING,command:`${s} install --ignore-scripts --legacy-peer-deps`}),pnpmInstallForce:o({type:e.E_CommandType.STRING,command:`${s} install --ignore-scripts --force`}),pnpmPruneStore:o({type:e.E_CommandType.STRING,command:`${s} store prune`}),pnpmCleanCache:o({type:e.E_CommandType.STRING,command:`${s} cache delete`}),storybookDev:o({type:e.E_CommandType.CLI,packages:[{name:D,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${k} dev`}),storybookBuild:o({type:e.E_CommandType.CLI,packages:[{name:D,type:_.E_PackageType.DEV_DEPENDENCY}],command:`${k} build`})};exports.BUILD_DIRECTORY=g;exports.COMMIT_LINT_CLI=R;exports.COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME=J;exports.COMMIT_LINT_PACKAGE_NAME=j;exports.CYBERSKILL_CLI=Te;exports.CYBERSKILL_CLI_PATH=pe;exports.CYBERSKILL_DIRECTORY=I;exports.CYBERSKILL_PACKAGE_NAME=l;exports.ESLINT_CLI=d;exports.ESLINT_INSPECT_CLI=oe;exports.ESLINT_INSPECT_PACKAGE_NAME=ee;exports.ESLINT_PACKAGE_NAME=A;exports.GIT_CLI=f;exports.GIT_COMMIT_EDITMSG=H;exports.GIT_HOOK=B;exports.GIT_IGNORE=W;exports.LINT_STAGED_CLI=h;exports.LINT_STAGED_PACKAGE_NAME=q;exports.MIGRATE_MONGO_CLI=O;exports.MIGRATE_MONGO_CONFIG=U;exports.MIGRATE_MONGO_PACKAGE_NAME=N;exports.NODE_MODULES=u;exports.NODE_MODULES_INSPECT_CLI=_e;exports.NODE_MODULES_INSPECT_PACKAGE_NAME=ne;exports.PACKAGE_JSON=K;exports.PACKAGE_LOCK_JSON=V;exports.PATH=C;exports.PNPM_CLI=s;exports.PNPM_EXEC_CLI=z;exports.PNPM_LOCK_YAML=w;exports.PUBLIC_DIRECTORY=$;exports.SIMPLE_GIT_HOOKS_PACKAGE_NAME=Q;exports.SIMPLE_GIT_HOOK_CLI=Z;exports.SIMPLE_GIT_HOOK_JSON=b;exports.STORYBOOK_CLI=k;exports.STORYBOOK_PACKAGE_NAME=D;exports.TSCONFIG_JSON=F;exports.TSC_CLI=X;exports.TSC_PACKAGE_NAME=x;exports.TSX_CLI=m;exports.VITEST_CLI=S;exports.VITEST_PACKAGE_NAME=M;exports.WORKING_DIRECTORY=P;exports.command=Ne;exports.createGitHooksConfig=ie;
|
|
@@ -72,10 +72,10 @@ export declare const PATH: {
|
|
|
72
72
|
* @returns A Git hooks configuration object with appropriate commands for each hook.
|
|
73
73
|
*/
|
|
74
74
|
export declare function createGitHooksConfig({ isCurrentProject }: Partial<I_CommandContext>): {
|
|
75
|
-
'pre-push'
|
|
75
|
+
'pre-push': {
|
|
76
76
|
raw: boolean;
|
|
77
77
|
cmd: string;
|
|
78
|
-
}
|
|
78
|
+
};
|
|
79
79
|
'pre-commit': string;
|
|
80
80
|
'commit-msg': string;
|
|
81
81
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import b from "fs-extra";
|
|
2
2
|
import { resolveWorkingPath as s, join as y } from "./path.util.js";
|
|
3
3
|
import { E_CommandType as e } from "../command/command.type.js";
|
|
4
|
-
import { formatCommand as g, rawCommand as
|
|
5
|
-
import { setupPackages as
|
|
4
|
+
import { formatCommand as g, rawCommand as N } from "../command/command.util.js";
|
|
5
|
+
import { setupPackages as F } from "../package/package.util.js";
|
|
6
6
|
import { E_PackageType as n } from "../package/package.type.js";
|
|
7
7
|
import { getEnv as w } from "../../config/env/env.util.js";
|
|
8
8
|
var j = Object.defineProperty, L = Object.getOwnPropertySymbols, B = Object.prototype.hasOwnProperty, H = Object.prototype.propertyIsEnumerable, P = (c, E, o) => E in c ? j(c, E, { enumerable: !0, configurable: !0, writable: !0, value: o }) : c[E] = o, U = (c, E) => {
|
|
@@ -12,23 +12,23 @@ var j = Object.defineProperty, L = Object.getOwnPropertySymbols, B = Object.prot
|
|
|
12
12
|
for (var o of L(E))
|
|
13
13
|
H.call(E, o) && P(c, o, E[o]);
|
|
14
14
|
return c;
|
|
15
|
-
}, J = (c, E, o) => new Promise((p,
|
|
15
|
+
}, J = (c, E, o) => new Promise((p, i) => {
|
|
16
16
|
var C = (_) => {
|
|
17
17
|
try {
|
|
18
|
-
|
|
19
|
-
} catch (
|
|
20
|
-
|
|
18
|
+
T(o.next(_));
|
|
19
|
+
} catch (l) {
|
|
20
|
+
i(l);
|
|
21
21
|
}
|
|
22
|
-
},
|
|
22
|
+
}, O = (_) => {
|
|
23
23
|
try {
|
|
24
|
-
|
|
25
|
-
} catch (
|
|
26
|
-
|
|
24
|
+
T(o.throw(_));
|
|
25
|
+
} catch (l) {
|
|
26
|
+
i(l);
|
|
27
27
|
}
|
|
28
|
-
},
|
|
29
|
-
|
|
28
|
+
}, T = (_) => _.done ? p(_.value) : Promise.resolve(_.value).then(C, O);
|
|
29
|
+
T((o = o.apply(c, E)).next());
|
|
30
30
|
});
|
|
31
|
-
const x = w(), d = x.CWD, M = "@cyberskill/shared", K = "node_modules", S = "dist", W = "public", Y = "package.json", X = "package-lock.json", q = "tsconfig.json", z = ".gitignore",
|
|
31
|
+
const x = w(), d = x.CWD, M = "@cyberskill/shared", K = "node_modules", S = "dist", W = "public", Y = "package.json", X = "package-lock.json", q = "tsconfig.json", z = ".gitignore", Q = ".simple-git-hooks.json", Z = "pnpm-lock.yaml", ee = ".git/hooks/", te = ".git/COMMIT_EDITMSG", ne = ".migrate-mongo.config.js", m = b.readJsonSync(s(Y)).name === M ? y(d, S) : y(d, K, M, S), ye = "cyberskill", ge = "src/node/cli/index.ts", A = "eslint", u = "eslint", f = "vitest", $ = "vitest", oe = "@commitlint/cli", se = "@commitlint/config-conventional", h = "commitlint", ce = "lint-staged", v = "lint-staged", Ee = "typescript", ae = "tsc", r = "tsx", V = "git", I = "pnpm", _e = "pnpm exec", me = "simple-git-hooks", Ie = "simple-git-hooks", ie = "@eslint/config-inspector", re = "eslint-config-inspector", pe = "node-modules-inspector", Ce = "node-modules-inspector", G = "migrate-mongo", D = "./node_modules/migrate-mongo/bin/migrate-mongo", R = "storybook", k = "storybook", a = {
|
|
32
32
|
CYBERSKILL_DIRECTORY: m,
|
|
33
33
|
WORKING_DIRECTORY: d,
|
|
34
34
|
PUBLIC_DIRECTORY: s(W),
|
|
@@ -36,10 +36,10 @@ const x = w(), d = x.CWD, M = "@cyberskill/shared", K = "node_modules", S = "dis
|
|
|
36
36
|
GIT_IGNORE: s(z),
|
|
37
37
|
GIT_HOOK: s(ee),
|
|
38
38
|
GIT_COMMIT_MSG: s(te),
|
|
39
|
-
SIMPLE_GIT_HOOKS_JSON: s(
|
|
39
|
+
SIMPLE_GIT_HOOKS_JSON: s(Q),
|
|
40
40
|
PACKAGE_JSON: s(Y),
|
|
41
41
|
PACKAGE_LOCK_JSON: s(X),
|
|
42
|
-
PNPM_LOCK_YAML: s(
|
|
42
|
+
PNPM_LOCK_YAML: s(Z),
|
|
43
43
|
NODE_MODULES: s(K),
|
|
44
44
|
MIGRATE_MONGO_CONFIG: s(ne),
|
|
45
45
|
LINT_STAGED_CONFIG: s(`${m}/config/lint-staged/index.js`),
|
|
@@ -53,18 +53,18 @@ function Le({ isCurrentProject: c }) {
|
|
|
53
53
|
return U({
|
|
54
54
|
"pre-commit": v,
|
|
55
55
|
"commit-msg": h
|
|
56
|
-
}, c
|
|
56
|
+
}, c ? { "pre-push": N(`${V} pull`) } : { "pre-push": N(`${I} build`) });
|
|
57
57
|
}
|
|
58
58
|
function t({ type: c, packages: E, command: o }) {
|
|
59
|
-
const p = E == null ? void 0 : E.reduce((
|
|
59
|
+
const p = E == null ? void 0 : E.reduce((i, C) => (i.some((O) => O.name === C.name) || i.push(C), i), []);
|
|
60
60
|
return () => J(null, null, function* () {
|
|
61
61
|
switch (c) {
|
|
62
62
|
case e.CLI:
|
|
63
|
-
return p != null && p.length && (yield
|
|
63
|
+
return p != null && p.length && (yield F(p, {
|
|
64
64
|
install: !0
|
|
65
|
-
})), g(
|
|
65
|
+
})), g(N(`${_e} ${o}`));
|
|
66
66
|
case e.STRING:
|
|
67
|
-
return g(
|
|
67
|
+
return g(N(o));
|
|
68
68
|
default:
|
|
69
69
|
throw new Error("Unsupported command type");
|
|
70
70
|
}
|
|
@@ -152,50 +152,50 @@ const Pe = {
|
|
|
152
152
|
command: `${$} --config ${a.VITEST_E2E_CONFIG}`
|
|
153
153
|
}),
|
|
154
154
|
mongoMigrateCreate: (c) => {
|
|
155
|
-
if (!/^[
|
|
155
|
+
if (!/^[\w-]+$/.test(c))
|
|
156
156
|
throw new Error("Migration name must only contain alphanumeric characters, underscores, and hyphens.");
|
|
157
157
|
return t({
|
|
158
158
|
type: e.CLI,
|
|
159
159
|
packages: [
|
|
160
160
|
{
|
|
161
|
-
name:
|
|
161
|
+
name: r,
|
|
162
162
|
type: n.DEPENDENCY
|
|
163
163
|
},
|
|
164
164
|
{
|
|
165
|
-
name:
|
|
165
|
+
name: G,
|
|
166
166
|
type: n.DEPENDENCY
|
|
167
167
|
}
|
|
168
168
|
],
|
|
169
|
-
command: `${
|
|
169
|
+
command: `${r} ${D} create ${c} -f ${a.MIGRATE_MONGO_CONFIG}`
|
|
170
170
|
})();
|
|
171
171
|
},
|
|
172
172
|
mongoMigrateUp: t({
|
|
173
173
|
type: e.CLI,
|
|
174
174
|
packages: [
|
|
175
175
|
{
|
|
176
|
-
name:
|
|
176
|
+
name: r,
|
|
177
177
|
type: n.DEPENDENCY
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
|
-
name:
|
|
180
|
+
name: G,
|
|
181
181
|
type: n.DEPENDENCY
|
|
182
182
|
}
|
|
183
183
|
],
|
|
184
|
-
command: `${
|
|
184
|
+
command: `${r} ${D} up -f ${a.MIGRATE_MONGO_CONFIG}`
|
|
185
185
|
}),
|
|
186
186
|
mongoMigrateDown: t({
|
|
187
187
|
type: e.CLI,
|
|
188
188
|
packages: [
|
|
189
189
|
{
|
|
190
|
-
name:
|
|
190
|
+
name: r,
|
|
191
191
|
type: n.DEPENDENCY
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
|
-
name:
|
|
194
|
+
name: G,
|
|
195
195
|
type: n.DEPENDENCY
|
|
196
196
|
}
|
|
197
197
|
],
|
|
198
|
-
command: `${
|
|
198
|
+
command: `${r} ${D} down -f ${a.MIGRATE_MONGO_CONFIG}`
|
|
199
199
|
}),
|
|
200
200
|
commitLint: t({
|
|
201
201
|
type: e.CLI,
|
|
@@ -227,27 +227,27 @@ const Pe = {
|
|
|
227
227
|
}),
|
|
228
228
|
build: t({
|
|
229
229
|
type: e.STRING,
|
|
230
|
-
command: `${
|
|
230
|
+
command: `${I} run --if-present build`
|
|
231
231
|
}),
|
|
232
232
|
pnpmInstallStandard: t({
|
|
233
233
|
type: e.STRING,
|
|
234
|
-
command: `${
|
|
234
|
+
command: `${I} install --ignore-scripts`
|
|
235
235
|
}),
|
|
236
236
|
pnpmInstallLegacy: t({
|
|
237
237
|
type: e.STRING,
|
|
238
|
-
command: `${
|
|
238
|
+
command: `${I} install --ignore-scripts --legacy-peer-deps`
|
|
239
239
|
}),
|
|
240
240
|
pnpmInstallForce: t({
|
|
241
241
|
type: e.STRING,
|
|
242
|
-
command: `${
|
|
242
|
+
command: `${I} install --ignore-scripts --force`
|
|
243
243
|
}),
|
|
244
244
|
pnpmPruneStore: t({
|
|
245
245
|
type: e.STRING,
|
|
246
|
-
command: `${
|
|
246
|
+
command: `${I} store prune`
|
|
247
247
|
}),
|
|
248
248
|
pnpmCleanCache: t({
|
|
249
249
|
type: e.STRING,
|
|
250
|
-
command: `${
|
|
250
|
+
command: `${I} cache delete`
|
|
251
251
|
}),
|
|
252
252
|
storybookDev: t({
|
|
253
253
|
type: e.CLI,
|
|
@@ -289,28 +289,28 @@ export {
|
|
|
289
289
|
z as GIT_IGNORE,
|
|
290
290
|
v as LINT_STAGED_CLI,
|
|
291
291
|
ce as LINT_STAGED_PACKAGE_NAME,
|
|
292
|
-
|
|
292
|
+
D as MIGRATE_MONGO_CLI,
|
|
293
293
|
ne as MIGRATE_MONGO_CONFIG,
|
|
294
|
-
|
|
294
|
+
G as MIGRATE_MONGO_PACKAGE_NAME,
|
|
295
295
|
K as NODE_MODULES,
|
|
296
296
|
Ce as NODE_MODULES_INSPECT_CLI,
|
|
297
297
|
pe as NODE_MODULES_INSPECT_PACKAGE_NAME,
|
|
298
298
|
Y as PACKAGE_JSON,
|
|
299
299
|
X as PACKAGE_LOCK_JSON,
|
|
300
300
|
a as PATH,
|
|
301
|
-
|
|
301
|
+
I as PNPM_CLI,
|
|
302
302
|
_e as PNPM_EXEC_CLI,
|
|
303
|
-
|
|
303
|
+
Z as PNPM_LOCK_YAML,
|
|
304
304
|
W as PUBLIC_DIRECTORY,
|
|
305
305
|
me as SIMPLE_GIT_HOOKS_PACKAGE_NAME,
|
|
306
306
|
Ie as SIMPLE_GIT_HOOK_CLI,
|
|
307
|
-
|
|
307
|
+
Q as SIMPLE_GIT_HOOK_JSON,
|
|
308
308
|
k as STORYBOOK_CLI,
|
|
309
309
|
R as STORYBOOK_PACKAGE_NAME,
|
|
310
310
|
q as TSCONFIG_JSON,
|
|
311
311
|
ae as TSC_CLI,
|
|
312
312
|
Ee as TSC_PACKAGE_NAME,
|
|
313
|
-
|
|
313
|
+
r as TSX_CLI,
|
|
314
314
|
$ as VITEST_CLI,
|
|
315
315
|
f as VITEST_PACKAGE_NAME,
|
|
316
316
|
d as WORKING_DIRECTORY,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../typescript/common.type.cjs");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../typescript/common.type.cjs");var _=Object.defineProperty,i=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable,a=(n,e,r)=>e in n?_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[e]=r,p=(n,e)=>{for(var r in e||(e={}))O.call(e,r)&&a(n,r,e[r]);if(i)for(var r of i(e))f.call(e,r)&&a(n,r,e[r]);return n};const s={a:["à","á","ạ","ả","ã","â","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["è","é","ẹ","ẻ","ẽ","ê","ề","ế","ệ","ể","ễ"],i:["ì","í","ị","ỉ","ĩ"],o:["ò","ó","ọ","ỏ","õ","ô","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["ù","ú","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","ý","ỵ","ỷ","ỹ"],d:["đ"]},v=Object.entries(s).reduce((n,[e,r])=>(n[e.toUpperCase()]=r.map(o=>o.toUpperCase()),n),{}),l=p(p({},s),v),u=new Map,m=new Set;Object.entries(l).forEach(([n,e])=>{const r=`(${[n,...e].join("|")})`;[n,...e].forEach(o=>{u.set(o,r),m.add(o)})});const D=Array.from(m).join(""),N=new RegExp(`[${D}]`,"g");function P(n){return n=n.normalize("NFD"),n.replace(N,e=>u.get(e)||e)}function g(n){return n.normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"")}function M(n,e){if(!e)return Array.from(new Set(n));const r=new Set,o=[];for(const c of n){const E=e(c);r.has(E)||(r.add(E),o.push(c))}return o}function d(n){const{NODE_ENV:e=t.E_Environment.DEVELOPMENT,NODE_ENV_MODE:r=t.E_Environment.DEVELOPMENT}=n,o=e===t.E_Environment.DEVELOPMENT&&r===t.E_Environment.DEVELOPMENT,c=e===t.E_Environment.PRODUCTION&&r===t.E_Environment.STAGING,E=e===t.E_Environment.PRODUCTION&&r===t.E_Environment.PRODUCTION;if(e===t.E_Environment.PRODUCTION&&r===t.E_Environment.DEVELOPMENT)throw new Error("NODE_ENV_MODE must be set to staging or production in production environment");return{IS_DEV:o,IS_STAG:c,IS_PROD:E}}exports.mapEnvironment=d;exports.regexSearchMapper=P;exports.removeAccent=g;exports.uniqueArray=M;
|
|
@@ -4,6 +4,9 @@ import { I_EnvFlags, I_NodeEnvInput } from './common.type.js';
|
|
|
4
4
|
* This function normalizes the input string and creates a regex pattern that can match
|
|
5
5
|
* both the original characters and their accented equivalents.
|
|
6
6
|
*
|
|
7
|
+
* Optimization: Uses pre-computed regex and map to perform replacement in a single pass (O(N)),
|
|
8
|
+
* instead of iterating through all character groups (O(K*N)).
|
|
9
|
+
*
|
|
7
10
|
* @param str - The string to convert to a regex pattern.
|
|
8
11
|
* @returns The regex pattern as a string that matches the original string and its accented variations.
|
|
9
12
|
*/
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { E_Environment as t } from "../../typescript/common.type.js";
|
|
2
|
-
var
|
|
3
|
-
for (var n in
|
|
4
|
-
|
|
5
|
-
if (
|
|
6
|
-
for (var n of
|
|
7
|
-
|
|
8
|
-
return
|
|
2
|
+
var f = Object.defineProperty, p = Object.getOwnPropertySymbols, m = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable, i = (r, e, n) => e in r ? f(r, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : r[e] = n, s = (r, e) => {
|
|
3
|
+
for (var n in e || (e = {}))
|
|
4
|
+
m.call(e, n) && i(r, n, e[n]);
|
|
5
|
+
if (p)
|
|
6
|
+
for (var n of p(e))
|
|
7
|
+
_.call(e, n) && i(r, n, e[n]);
|
|
8
|
+
return r;
|
|
9
9
|
};
|
|
10
|
-
const
|
|
10
|
+
const E = {
|
|
11
11
|
a: ["à", "á", "ạ", "ả", "ã", "â", "ầ", "ấ", "ậ", "ẩ", "ẫ", "ă", "ằ", "ắ", "ặ", "ẳ", "ẵ"],
|
|
12
12
|
e: ["è", "é", "ẹ", "ẻ", "ẽ", "ê", "ề", "ế", "ệ", "ể", "ễ"],
|
|
13
13
|
i: ["ì", "í", "ị", "ỉ", "ĩ"],
|
|
@@ -15,41 +15,42 @@ const s = {
|
|
|
15
15
|
u: ["ù", "ú", "ụ", "ủ", "ũ", "ư", "ừ", "ứ", "ự", "ử", "ữ"],
|
|
16
16
|
y: ["ỳ", "ý", "ỵ", "ỷ", "ỹ"],
|
|
17
17
|
d: ["đ"]
|
|
18
|
-
},
|
|
19
|
-
(
|
|
18
|
+
}, D = Object.entries(E).reduce(
|
|
19
|
+
(r, [e, n]) => (r[e.toUpperCase()] = n.map((o) => o.toUpperCase()), r),
|
|
20
20
|
{}
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
), N = s(s({}, E), D), u = /* @__PURE__ */ new Map(), O = /* @__PURE__ */ new Set();
|
|
22
|
+
Object.entries(N).forEach(([r, e]) => {
|
|
23
|
+
const n = `(${[r, ...e].join("|")})`;
|
|
24
|
+
[r, ...e].forEach((o) => {
|
|
25
|
+
u.set(o, n), O.add(o);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
const l = Array.from(O).join(""), P = new RegExp(`[${l}]`, "g");
|
|
29
|
+
function d(r) {
|
|
30
|
+
return r = r.normalize("NFD"), r.replace(P, (e) => u.get(e) || e);
|
|
30
31
|
}
|
|
31
|
-
function
|
|
32
|
-
return
|
|
32
|
+
function g(r) {
|
|
33
|
+
return r.normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "");
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
if (!
|
|
36
|
-
return Array.from(new Set(
|
|
35
|
+
function w(r, e) {
|
|
36
|
+
if (!e)
|
|
37
|
+
return Array.from(new Set(r));
|
|
37
38
|
const n = /* @__PURE__ */ new Set(), o = [];
|
|
38
|
-
for (const
|
|
39
|
-
const
|
|
40
|
-
n.has(
|
|
39
|
+
for (const c of r) {
|
|
40
|
+
const a = e(c);
|
|
41
|
+
n.has(a) || (n.add(a), o.push(c));
|
|
41
42
|
}
|
|
42
43
|
return o;
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
-
const { NODE_ENV:
|
|
46
|
-
if (
|
|
45
|
+
function S(r) {
|
|
46
|
+
const { NODE_ENV: e = t.DEVELOPMENT, NODE_ENV_MODE: n = t.DEVELOPMENT } = r, o = e === t.DEVELOPMENT && n === t.DEVELOPMENT, c = e === t.PRODUCTION && n === t.STAGING, a = e === t.PRODUCTION && n === t.PRODUCTION;
|
|
47
|
+
if (e === t.PRODUCTION && n === t.DEVELOPMENT)
|
|
47
48
|
throw new Error("NODE_ENV_MODE must be set to staging or production in production environment");
|
|
48
|
-
return { IS_DEV: o, IS_STAG:
|
|
49
|
+
return { IS_DEV: o, IS_STAG: c, IS_PROD: a };
|
|
49
50
|
}
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
S as mapEnvironment,
|
|
53
|
+
d as regexSearchMapper,
|
|
54
|
+
g as removeAccent,
|
|
55
|
+
w as uniqueArray
|
|
55
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var m=Object.defineProperty,A=Object.defineProperties,v=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,y=(e,r,n)=>r in e?m(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,p=(e,r)=>{for(var n in r||(r={}))h.call(r,n)&&y(e,n,r[n]);if(u)for(var n of u(r))w.call(r,n)&&y(e,n,r[n]);return e},O=(e,r)=>A(e,v(r));function P(e){try{return JSON.parse(e),!0}catch(r){return!1}}function _(e,r){let n=e;const o=r.length;for(let t=0;t<o;t++){const s=r[t];if(s!==void 0&&n&&typeof n=="object"&&s in n)n=n[s];else return}return n}function d(e,r,n){if(r.length===0)return e;const[o,...t]=r;if(t.length===0)return O(p({},e),{[o]:n});const s=e[o];return O(p({},e),{[o]:d(typeof s=="object"&&s!==null?s:{},t,n)})}function f(e){if(e===null||typeof e!="object")return e;if(Array.isArray(e))return e.map(o=>f(o));if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);const r=Object.getPrototypeOf(e);if(r!==Object.prototype&&r!==null)return e;const n={};for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=f(e[o]));return n}function g(...e){if(e.length===0)return{};const r=e.filter(t=>t!=null);if(r.length===0)return{};if(r.length===1)return r[0];if(r.every(Array.isArray))return[].concat(...r);if(r.every(t=>typeof t=="object"&&t!==null&&!Array.isArray(t))){const t={};for(const s of r){const i=s;for(const a in i)if(Object.prototype.hasOwnProperty.call(i,a)){const l=i[a];if(Object.prototype.hasOwnProperty.call(t,a)){const c=t[a];typeof l=="object"&&l!==null&&typeof c=="object"&&c!==null?Array.isArray(l)&&Array.isArray(c)?t[a]=c.concat(l):!Array.isArray(l)&&!Array.isArray(c)?t[a]=g(c,l):t[a]=l:t[a]=l}else t[a]=l}}return t}if(r.every(t=>typeof t!="object"||t===null))throw new Error("deepMerge: Cannot merge primitive values. All arguments must be objects or arrays.");const n=r.some(Array.isArray),o=r.some(t=>typeof t=="object"&&t!==null&&!Array.isArray(t));throw n&&o?new Error("deepMerge: Cannot mix arrays and objects. All arguments must be either arrays or objects."):new Error("deepMerge: Invalid arguments provided. All arguments must be objects or arrays of the same type.")}function b(e){if(!e||typeof e!="object")return e;const r={};function n(o,t){for(const s in o){if(!Object.prototype.hasOwnProperty.call(o,s))continue;const i=o[s],a=t?`${t}.${s}`:s;if(i&&typeof i=="object"&&!Array.isArray(i)){let l=!1;for(const c in i)if(Object.prototype.hasOwnProperty.call(i,c)&&c.startsWith("$")){l=!0;break}l?r[a]=i:n(i,a)}else r[a]=i}}return n(e,""),r}exports.deepClone=f;exports.deepMerge=g;exports.getNestedValue=_;exports.isJSON=P;exports.normalizeMongoFilter=b;exports.setNestedValue=d;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
1
|
+
var A = Object.defineProperty, d = Object.defineProperties, g = Object.getOwnPropertyDescriptors, f = Object.getOwnPropertySymbols, m = Object.prototype.hasOwnProperty, h = Object.prototype.propertyIsEnumerable, y = (e, r, n) => r in e ? A(e, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[r] = n, u = (e, r) => {
|
|
2
2
|
for (var n in r || (r = {}))
|
|
3
|
-
|
|
3
|
+
m.call(r, n) && y(e, n, r[n]);
|
|
4
4
|
if (f)
|
|
5
5
|
for (var n of f(r))
|
|
6
|
-
|
|
6
|
+
h.call(r, n) && y(e, n, r[n]);
|
|
7
7
|
return e;
|
|
8
|
-
}, p = (e, r) =>
|
|
8
|
+
}, p = (e, r) => d(e, g(r));
|
|
9
9
|
function P(e) {
|
|
10
10
|
try {
|
|
11
11
|
return JSON.parse(e), !0;
|
|
@@ -13,28 +13,30 @@ function P(e) {
|
|
|
13
13
|
return !1;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function _(e, r) {
|
|
17
17
|
let n = e;
|
|
18
18
|
const o = r.length;
|
|
19
|
-
for (let t = 0; t < o; t++)
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
for (let t = 0; t < o; t++) {
|
|
20
|
+
const s = r[t];
|
|
21
|
+
if (s !== void 0 && n && typeof n == "object" && s in n)
|
|
22
|
+
n = n[s];
|
|
22
23
|
else
|
|
23
24
|
return;
|
|
25
|
+
}
|
|
24
26
|
return n;
|
|
25
27
|
}
|
|
26
|
-
function
|
|
28
|
+
function v(e, r, n) {
|
|
27
29
|
if (r.length === 0)
|
|
28
30
|
return e;
|
|
29
31
|
const [o, ...t] = r;
|
|
30
32
|
if (t.length === 0)
|
|
31
|
-
return p(
|
|
33
|
+
return p(u({}, e), {
|
|
32
34
|
[o]: n
|
|
33
35
|
});
|
|
34
|
-
const
|
|
35
|
-
return p(
|
|
36
|
-
[o]:
|
|
37
|
-
typeof
|
|
36
|
+
const s = e[o];
|
|
37
|
+
return p(u({}, e), {
|
|
38
|
+
[o]: v(
|
|
39
|
+
typeof s == "object" && s !== null ? s : {},
|
|
38
40
|
t,
|
|
39
41
|
n
|
|
40
42
|
)
|
|
@@ -69,19 +71,19 @@ function w(...e) {
|
|
|
69
71
|
return [].concat(...r);
|
|
70
72
|
if (r.every((t) => typeof t == "object" && t !== null && !Array.isArray(t))) {
|
|
71
73
|
const t = {};
|
|
72
|
-
for (const
|
|
73
|
-
const
|
|
74
|
-
for (const
|
|
75
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
76
|
-
const
|
|
77
|
-
if (Object.prototype.hasOwnProperty.call(t,
|
|
78
|
-
const c = t[
|
|
79
|
-
typeof
|
|
74
|
+
for (const s of r) {
|
|
75
|
+
const i = s;
|
|
76
|
+
for (const a in i)
|
|
77
|
+
if (Object.prototype.hasOwnProperty.call(i, a)) {
|
|
78
|
+
const l = i[a];
|
|
79
|
+
if (Object.prototype.hasOwnProperty.call(t, a)) {
|
|
80
|
+
const c = t[a];
|
|
81
|
+
typeof l == "object" && l !== null && typeof c == "object" && c !== null ? Array.isArray(l) && Array.isArray(c) ? t[a] = c.concat(l) : !Array.isArray(l) && !Array.isArray(c) ? t[a] = w(
|
|
80
82
|
c,
|
|
81
|
-
|
|
82
|
-
) : t[
|
|
83
|
+
l
|
|
84
|
+
) : t[a] = l : t[a] = l;
|
|
83
85
|
} else
|
|
84
|
-
t[
|
|
86
|
+
t[a] = l;
|
|
85
87
|
}
|
|
86
88
|
}
|
|
87
89
|
return t;
|
|
@@ -99,32 +101,34 @@ function w(...e) {
|
|
|
99
101
|
"deepMerge: Invalid arguments provided. All arguments must be objects or arrays of the same type."
|
|
100
102
|
);
|
|
101
103
|
}
|
|
102
|
-
function
|
|
104
|
+
function b(e) {
|
|
103
105
|
if (!e || typeof e != "object")
|
|
104
106
|
return e;
|
|
105
107
|
const r = {};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
if (Object.
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
108
|
+
function n(o, t) {
|
|
109
|
+
for (const s in o) {
|
|
110
|
+
if (!Object.prototype.hasOwnProperty.call(o, s))
|
|
111
|
+
continue;
|
|
112
|
+
const i = o[s], a = t ? `${t}.${s}` : s;
|
|
113
|
+
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
114
|
+
let l = !1;
|
|
115
|
+
for (const c in i)
|
|
116
|
+
if (Object.prototype.hasOwnProperty.call(i, c) && c.startsWith("$")) {
|
|
117
|
+
l = !0;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
l ? r[a] = i : n(i, a);
|
|
121
|
+
} else
|
|
122
|
+
r[a] = i;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return n(e, ""), r;
|
|
122
126
|
}
|
|
123
127
|
export {
|
|
124
128
|
O as deepClone,
|
|
125
129
|
w as deepMerge,
|
|
126
|
-
|
|
130
|
+
_ as getNestedValue,
|
|
127
131
|
P as isJSON,
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
b as normalizeMongoFilter,
|
|
133
|
+
v as setNestedValue
|
|
130
134
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={isEmpty(d){return d==null?!0:typeof d=="string"?d.trim().length===0:Array.isArray(d)?d.length===0:typeof d=="object"?d instanceof Date?!1:d instanceof Map||d instanceof Set?d.size===0:d instanceof WeakMap||d instanceof WeakSet?!0:ArrayBuffer.isView(d)?d.byteLength===0:Object.keys(d).length===0:!1},isValidIP(d){const e=d.split(".");return e.length===4&&e.every(t=>/^\d+$/.test(t)&&Number(t)>=0&&Number(t)<=255)?!0:/^(?:(?:[a-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={isEmpty(d){return d==null?!0:typeof d=="string"?d.trim().length===0:Array.isArray(d)?d.length===0:typeof d=="object"?d instanceof Date?!1:d instanceof Map||d instanceof Set?d.size===0:d instanceof WeakMap||d instanceof WeakSet?!0:ArrayBuffer.isView(d)?d.byteLength===0:Object.keys(d).length===0:!1},isValidIP(d){const e=d.split(".");return e.length===4&&e.every(t=>/^\d+$/.test(t)&&Number(t)>=0&&Number(t)<=255)?!0:/^(?:(?:[a-f\d]{1,4}:){7}(?:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,2}|:)|(?:[a-f\d]{1,4}:){4}(?:(?::[a-f\d]{1,4})?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,3}|:)|(?:[a-f\d]{1,4}:){3}(?:(?::[a-f\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,4}|:)|(?:[a-f\d]{1,4}:){2}(?:(?::[a-f\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,5}|:)|[a-f\d]{1,4}:(?:(?::[a-f\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,6}|:)|:(?:(?::[a-f\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,7}|:))(?:%[0-9a-z]+)?$/i.test(d)}};exports.validate=r;
|
|
@@ -31,7 +31,7 @@ const e = {
|
|
|
31
31
|
const f = d.split(".");
|
|
32
32
|
return f.length === 4 && f.every(
|
|
33
33
|
(t) => /^\d+$/.test(t) && Number(t) >= 0 && Number(t) <= 255
|
|
34
|
-
) ? !0 : /^(?:(?:[a-
|
|
34
|
+
) ? !0 : /^(?:(?:[a-f\d]{1,4}:){7}(?:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-f\d]{1,4}|:)|(?:[a-f\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,2}|:)|(?:[a-f\d]{1,4}:){4}(?:(?::[a-f\d]{1,4})?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,3}|:)|(?:[a-f\d]{1,4}:){3}(?:(?::[a-f\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,4}|:)|(?:[a-f\d]{1,4}:){2}(?:(?::[a-f\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,5}|:)|[a-f\d]{1,4}:(?:(?::[a-f\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,6}|:)|:(?:(?::[a-f\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-f\d]{1,4}){1,7}|:))(?:%[0-9a-z]+)?$/i.test(d);
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
37
|
export {
|