@design-edito/tools 0.1.7 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Bem
3
- } from "../../../chunks/chunk-KIONYWA7.js";
4
- import "../../../chunks/chunk-W5A2TON3.js";
3
+ } from "../../../chunks/chunk-7YW5HL6N.js";
5
4
  import "../../../chunks/chunk-QXAJXTXV.js";
6
5
  import "../../../chunks/chunk-HC6ZOHCS.js";
6
+ import "../../../chunks/chunk-W5A2TON3.js";
7
7
  export {
8
8
  Bem
9
9
  };
@@ -1,26 +1,27 @@
1
- import {
2
- generateNiceColor,
3
- niceColors
4
- } from "../../chunks/chunk-EDVNAV3G.js";
5
- import {
6
- Bem
7
- } from "../../chunks/chunk-KIONYWA7.js";
8
- import {
9
- classNameRegex,
10
- isValidClassName
11
- } from "../../chunks/chunk-W5A2TON3.js";
12
1
  import {
13
2
  Random
14
3
  } from "../../chunks/chunk-WLL3FNVL.js";
15
4
  import {
16
5
  register
17
- } from "../../chunks/chunk-B27DVNRX.js";
6
+ } from "../../chunks/chunk-TN2VNSUT.js";
18
7
  import {
19
8
  Crossenv
20
9
  } from "../../chunks/chunk-GJOU3UAL.js";
21
- import "../../chunks/chunk-RLESUSTH.js";
10
+ import "../../chunks/chunk-SI3URYBN.js";
11
+ import "../../chunks/chunk-JJFS2I7N.js";
12
+ import {
13
+ generateNiceColor,
14
+ niceColors
15
+ } from "../../chunks/chunk-EDVNAV3G.js";
16
+ import {
17
+ Bem
18
+ } from "../../chunks/chunk-7YW5HL6N.js";
22
19
  import "../../chunks/chunk-QXAJXTXV.js";
23
20
  import "../../chunks/chunk-HC6ZOHCS.js";
21
+ import {
22
+ classNameRegex,
23
+ isValidClassName
24
+ } from "../../chunks/chunk-W5A2TON3.js";
24
25
 
25
26
  // src/agnostic/css/styles-set/index.tsx
26
27
  import { Component } from "react";
@@ -1,30 +1,4 @@
1
- type AnyFunc = (...args: any[]) => any;
2
- type ParamsOfNullableFunc<F extends AnyFunc | undefined | null> = F extends AnyFunc ? Parameters<F> : [];
3
- type ReturnTypeOfNullableFunc<F extends AnyFunc | undefined | null> = F extends AnyFunc ? ReturnType<F> : undefined;
1
+ import { Register as RegisterNamespace } from './register';
4
2
  export declare namespace Errors {
5
- type Factory<Params extends any[] = any[], Details = any> = {
6
- message: string;
7
- makeDetails?: (...params: Params) => Details;
8
- };
9
- type Index<Params extends any[] = any[], Details = any> = {
10
- [code: string]: Factory<Params, Details>;
11
- };
12
- type Data<RS extends Index, C extends keyof RS> = {
13
- code: C;
14
- message: RS[C]['message'];
15
- details: ReturnTypeOfNullableFunc<RS[C]['makeDetails']>;
16
- };
17
- class CustomError<Idx extends Index, Code extends keyof Idx> extends Error {
18
- code: Data<Idx, Code>['code'];
19
- details: Data<Idx, Code>['details'];
20
- constructor(data: Data<Idx, Code>);
21
- }
22
- class Register<Idx extends Index> {
23
- index: Idx;
24
- constructor(index: Idx);
25
- getFactory<C extends keyof Idx>(code: C): Idx[C];
26
- getData<C extends keyof Idx>(code: C, ...params: ParamsOfNullableFunc<Idx[C]['makeDetails']>): Data<Idx, C>;
27
- getError<C extends keyof Idx>(code: C, ...params: ParamsOfNullableFunc<Idx[C]['makeDetails']>): CustomError<Idx, C>;
28
- }
3
+ export import Register = RegisterNamespace;
29
4
  }
30
- export {};
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  Errors
3
- } from "../../chunks/chunk-RLESUSTH.js";
3
+ } from "../../chunks/chunk-SI3URYBN.js";
4
+ import "../../chunks/chunk-JJFS2I7N.js";
4
5
  export {
5
6
  Errors
6
7
  };
@@ -0,0 +1,33 @@
1
+ export declare namespace Register {
2
+ type RegisterEntry = {
3
+ message: string;
4
+ detailsMaker?: (...params: any[]) => any;
5
+ };
6
+ function from<Source extends {
7
+ [k: string]: RegisterEntry;
8
+ }>(source: Source): {
9
+ getMessage: <Code extends keyof Source>(code: Code) => Source[Code]["message"];
10
+ getDetailsMaker: <Code extends keyof Source>(code: Code) => Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined;
11
+ getDetails: <Code extends keyof Source>(code: Code, ...params: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
12
+ getError: <Code extends keyof Source>(code: Code, ...params: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => {
13
+ code: Code;
14
+ details: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
15
+ name: string;
16
+ message: string;
17
+ stack?: string;
18
+ };
19
+ CustomError: {
20
+ new <Code extends keyof Source>(code: Code, ...params: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []): {
21
+ code: Code;
22
+ details: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
23
+ name: string;
24
+ message: string;
25
+ stack?: string;
26
+ };
27
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
28
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
29
+ stackTraceLimit: number;
30
+ };
31
+ source: Source;
32
+ };
33
+ }
@@ -0,0 +1,6 @@
1
+ import {
2
+ Register
3
+ } from "../../../chunks/chunk-JJFS2I7N.js";
4
+ export {
5
+ Register
6
+ };
@@ -1,27 +1,28 @@
1
1
  import {
2
- stringToNodes
3
- } from "../../chunks/chunk-XPM2OFLI.js";
2
+ getPositionInsideParent
3
+ } from "../../chunks/chunk-VTPRO4NJ.js";
4
4
  import {
5
- getNodeAncestors
6
- } from "../../chunks/chunk-SQZGZ3VT.js";
5
+ Placeholders
6
+ } from "../../chunks/chunk-VYW4IADX.js";
7
7
  import {
8
8
  insertNode
9
9
  } from "../../chunks/chunk-XA4HVHJ4.js";
10
10
  import {
11
11
  selectorToElement
12
- } from "../../chunks/chunk-5FU3AIZ4.js";
12
+ } from "../../chunks/chunk-OCEN35QZ.js";
13
13
  import {
14
- getPositionInsideParent
15
- } from "../../chunks/chunk-VTPRO4NJ.js";
14
+ stringToNodes
15
+ } from "../../chunks/chunk-5WIF34SV.js";
16
16
  import {
17
17
  Sanitize
18
- } from "../../chunks/chunk-RASYEJ6T.js";
19
- import "../../chunks/chunk-B27DVNRX.js";
20
- import "../../chunks/chunk-GJOU3UAL.js";
18
+ } from "../../chunks/chunk-NHJPS3IB.js";
21
19
  import {
22
- Placeholders
23
- } from "../../chunks/chunk-VYW4IADX.js";
24
- import "../../chunks/chunk-RLESUSTH.js";
20
+ getNodeAncestors
21
+ } from "../../chunks/chunk-SQZGZ3VT.js";
22
+ import "../../chunks/chunk-TN2VNSUT.js";
23
+ import "../../chunks/chunk-GJOU3UAL.js";
24
+ import "../../chunks/chunk-SI3URYBN.js";
25
+ import "../../chunks/chunk-JJFS2I7N.js";
25
26
 
26
27
  // src/agnostic/html/index.ts
27
28
  var Html;
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  Sanitize
3
- } from "../../../chunks/chunk-RASYEJ6T.js";
4
- import "../../../chunks/chunk-B27DVNRX.js";
3
+ } from "../../../chunks/chunk-NHJPS3IB.js";
4
+ import "../../../chunks/chunk-TN2VNSUT.js";
5
5
  import "../../../chunks/chunk-GJOU3UAL.js";
6
- import "../../../chunks/chunk-RLESUSTH.js";
6
+ import "../../../chunks/chunk-SI3URYBN.js";
7
+ import "../../../chunks/chunk-JJFS2I7N.js";
7
8
  export {
8
9
  Sanitize
9
10
  };
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  selectorToElement
3
- } from "../../../chunks/chunk-5FU3AIZ4.js";
4
- import "../../../chunks/chunk-B27DVNRX.js";
3
+ } from "../../../chunks/chunk-OCEN35QZ.js";
4
+ import "../../../chunks/chunk-TN2VNSUT.js";
5
5
  import "../../../chunks/chunk-GJOU3UAL.js";
6
- import "../../../chunks/chunk-RLESUSTH.js";
6
+ import "../../../chunks/chunk-SI3URYBN.js";
7
+ import "../../../chunks/chunk-JJFS2I7N.js";
7
8
  export {
8
9
  selectorToElement
9
10
  };
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  stringToNodes
3
- } from "../../../chunks/chunk-XPM2OFLI.js";
4
- import "../../../chunks/chunk-RASYEJ6T.js";
5
- import "../../../chunks/chunk-B27DVNRX.js";
3
+ } from "../../../chunks/chunk-5WIF34SV.js";
4
+ import "../../../chunks/chunk-NHJPS3IB.js";
5
+ import "../../../chunks/chunk-TN2VNSUT.js";
6
6
  import "../../../chunks/chunk-GJOU3UAL.js";
7
- import "../../../chunks/chunk-RLESUSTH.js";
7
+ import "../../../chunks/chunk-SI3URYBN.js";
8
+ import "../../../chunks/chunk-JJFS2I7N.js";
8
9
  export {
9
10
  stringToNodes
10
11
  };
@@ -1,24 +1,24 @@
1
1
  import {
2
- Assert
3
- } from "../../chunks/chunk-W7YBGJ4H.js";
2
+ getCurrentDownlink
3
+ } from "../../chunks/chunk-7AWTHZLY.js";
4
4
  import {
5
5
  Logs
6
- } from "../../chunks/chunk-5LNUCDQ6.js";
6
+ } from "../../chunks/chunk-HEJV6JIO.js";
7
7
  import {
8
- Random
9
- } from "../../chunks/chunk-WLL3FNVL.js";
8
+ Assert
9
+ } from "../../chunks/chunk-W7YBGJ4H.js";
10
10
  import {
11
11
  Cast
12
12
  } from "../../chunks/chunk-4QQBKBYH.js";
13
13
  import {
14
- getCurrentDownlink
15
- } from "../../chunks/chunk-7AWTHZLY.js";
14
+ isConstructorFunction
15
+ } from "../../chunks/chunk-RCO57B6F.js";
16
+ import {
17
+ Random
18
+ } from "../../chunks/chunk-WLL3FNVL.js";
16
19
  import {
17
20
  Crossenv
18
21
  } from "../../chunks/chunk-GJOU3UAL.js";
19
- import {
20
- isConstructorFunction
21
- } from "../../chunks/chunk-RCO57B6F.js";
22
22
  import "../../chunks/chunk-QXAJXTXV.js";
23
23
  import {
24
24
  isNotNullish,
@@ -7,6 +7,7 @@ export declare namespace Logs {
7
7
  important: (text: string) => string;
8
8
  title: (text: string) => string;
9
9
  info: (text: string) => string;
10
+ success: (text: string) => string;
10
11
  error: (text: string) => string;
11
12
  warning: (text: string) => string;
12
13
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Logs
3
- } from "../../../chunks/chunk-5LNUCDQ6.js";
3
+ } from "../../../chunks/chunk-HEJV6JIO.js";
4
4
  export {
5
5
  Logs
6
6
  };
@@ -1,22 +1,15 @@
1
- import { Errors } from '../../errors';
2
1
  export declare namespace Outcome {
3
- type Success<Payload = unknown> = {
2
+ type Success<Payload extends any = any> = {
4
3
  success: true;
5
- returned: Payload;
4
+ payload: Payload;
6
5
  };
7
- type Failure<Payload = unknown, ErrorsIndex extends Errors.Index = {
8
- [key: string]: any;
9
- }> = {
6
+ type Failure<Code extends string = string, Msg extends string = string, Details extends any = any> = {
10
7
  success: false;
11
- returned: Payload;
12
- errorCode: keyof ErrorsIndex;
8
+ code: Code;
9
+ message: Msg;
10
+ details?: Details;
13
11
  };
14
- type Outcome<SuccesPayload = unknown, FailurePayload = SuccesPayload, ErrorsIndex extends Errors.Index = {
15
- [key: string]: any;
16
- }> = Success<SuccesPayload> | Failure<FailurePayload, ErrorsIndex>;
17
- function makeSuccess<S = any>(returned: S): Success<S>;
18
- function makeFailure<FailurePayload = any, ErrorsIndex extends Errors.Index = {
19
- [key: string]: any;
20
- }>(returned: FailurePayload, code: keyof ErrorsIndex): Failure<FailurePayload, ErrorsIndex>;
21
- type Outcomer<SuccesPayload, FailurePayload, Params extends any[]> = (...params: Params) => Outcome<SuccesPayload, FailurePayload> | Promise<Outcome<SuccesPayload, FailurePayload>>;
12
+ type Outcome<Payload extends any = any, Code extends string = string, Msg extends string = string, Details extends any = any> = Success<Payload> | Failure<Code, Msg, Details>;
13
+ function makeSuccess<Payload extends any>(payload: Payload): Success<Payload>;
14
+ function makeFailure<Code extends string = string, Msg extends string = string, Details extends any | undefined = undefined>(code: Code, message: Msg, details?: Details): Failure<Code, Msg, Details>;
22
15
  }
@@ -1,18 +1,19 @@
1
1
  // src/agnostic/misc/outcome/index.ts
2
2
  var Outcome;
3
3
  ((Outcome2) => {
4
- function makeSuccess(returned) {
4
+ function makeSuccess(payload) {
5
5
  return {
6
6
  success: true,
7
- returned
7
+ payload
8
8
  };
9
9
  }
10
10
  Outcome2.makeSuccess = makeSuccess;
11
- function makeFailure(returned, code) {
11
+ function makeFailure(code, message, details) {
12
12
  return {
13
13
  success: false,
14
- returned,
15
- errorCode: code
14
+ code,
15
+ message,
16
+ details
16
17
  };
17
18
  }
18
19
  Outcome2.makeFailure = makeFailure;
@@ -1,9 +1,3 @@
1
- import {
2
- absoluteModulo
3
- } from "../../chunks/chunk-DNIOWD7K.js";
4
- import {
5
- interpolate
6
- } from "../../chunks/chunk-EW46EXFB.js";
7
1
  import {
8
2
  clamp
9
3
  } from "../../chunks/chunk-OSAXBA7G.js";
@@ -11,9 +5,15 @@ import {
11
5
  createScale,
12
6
  getHarmonic
13
7
  } from "../../chunks/chunk-UYTXXUU7.js";
8
+ import {
9
+ interpolate
10
+ } from "../../chunks/chunk-EW46EXFB.js";
14
11
  import {
15
12
  round
16
13
  } from "../../chunks/chunk-32IRF4OP.js";
14
+ import {
15
+ absoluteModulo
16
+ } from "../../chunks/chunk-DNIOWD7K.js";
17
17
 
18
18
  // src/agnostic/numbers/index.ts
19
19
  var Numbers;
@@ -1,9 +1,13 @@
1
- import {
2
- isRecord
3
- } from "../../chunks/chunk-YDIBNEGA.js";
4
1
  import {
5
2
  flattenGetters
6
3
  } from "../../chunks/chunk-PO3V3I57.js";
4
+ import {
5
+ isNonNullObject,
6
+ isObject
7
+ } from "../../chunks/chunk-HQLRJ7XW.js";
8
+ import {
9
+ isRecord
10
+ } from "../../chunks/chunk-YDIBNEGA.js";
7
11
  import {
8
12
  Validation
9
13
  } from "../../chunks/chunk-FPEW3A27.js";
@@ -11,10 +15,6 @@ import {
11
15
  Enums
12
16
  } from "../../chunks/chunk-WOAYU6LB.js";
13
17
  import "../../chunks/chunk-E6MSDKON.js";
14
- import {
15
- isNonNullObject,
16
- isObject
17
- } from "../../chunks/chunk-HQLRJ7XW.js";
18
18
  import "../../chunks/chunk-4QQBKBYH.js";
19
19
  import "../../chunks/chunk-QXAJXTXV.js";
20
20
  import "../../chunks/chunk-HC6ZOHCS.js";
@@ -1,10 +1,10 @@
1
- import {
2
- memoize
3
- } from "../../chunks/chunk-JWBDZPQG.js";
4
1
  import {
5
2
  debounce,
6
3
  throttle
7
4
  } from "../../chunks/chunk-VZDUZTW6.js";
5
+ import {
6
+ memoize
7
+ } from "../../chunks/chunk-JWBDZPQG.js";
8
8
 
9
9
  // src/agnostic/optim/index.ts
10
10
  var Optim;
@@ -1,3 +1,8 @@
1
+ import {
2
+ matches,
3
+ matchesEvery,
4
+ matchesSome
5
+ } from "../../chunks/chunk-LQFKUNVQ.js";
1
6
  import {
2
7
  CharCodes
3
8
  } from "../../chunks/chunk-34U4HX4V.js";
@@ -10,11 +15,6 @@ import {
10
15
  import {
11
16
  toAlphanum
12
17
  } from "../../chunks/chunk-COVPTTAD.js";
13
- import {
14
- matches,
15
- matchesEvery,
16
- matchesSome
17
- } from "../../chunks/chunk-LQFKUNVQ.js";
18
18
 
19
19
  // src/agnostic/strings/index.ts
20
20
  var Strings;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Sanitize
3
- } from "./chunk-RASYEJ6T.js";
3
+ } from "./chunk-NHJPS3IB.js";
4
4
  import {
5
5
  register
6
- } from "./chunk-B27DVNRX.js";
6
+ } from "./chunk-TN2VNSUT.js";
7
7
  import {
8
8
  Crossenv
9
9
  } from "./chunk-GJOU3UAL.js";
@@ -24,6 +24,7 @@ ${text}
24
24
  title: (text) => `# ${chalk.bold.underline(`${text}
25
25
  `)}`,
26
26
  info: (text) => chalk.blueBright(text),
27
+ success: (text) => chalk.greenBright(text),
27
28
  error: (text) => chalk.red(text),
28
29
  warning: (text) => chalk.yellow(text)
29
30
  };
@@ -0,0 +1,45 @@
1
+ // src/agnostic/errors/register/index.ts
2
+ var Register;
3
+ ((Register2) => {
4
+ function from(source) {
5
+ function getMessage(code) {
6
+ const message = source[code].message;
7
+ return message;
8
+ }
9
+ function getDetailsMaker(code) {
10
+ const maker = source[code].detailsMaker;
11
+ return maker;
12
+ }
13
+ function getDetails(code, ...params) {
14
+ const maker = getDetailsMaker(code);
15
+ const details = maker?.(...params);
16
+ return details;
17
+ }
18
+ class CustomError extends Error {
19
+ code;
20
+ details;
21
+ constructor(code, ...params) {
22
+ super(getMessage(code));
23
+ const details = getDetails(code, ...params);
24
+ this.code = code;
25
+ this.details = details;
26
+ }
27
+ }
28
+ function getError(code, ...params) {
29
+ return new CustomError(code, ...params);
30
+ }
31
+ return {
32
+ getMessage,
33
+ getDetailsMaker,
34
+ getDetails,
35
+ getError,
36
+ CustomError,
37
+ source
38
+ };
39
+ }
40
+ Register2.from = from;
41
+ })(Register || (Register = {}));
42
+
43
+ export {
44
+ Register
45
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  register
3
- } from "./chunk-B27DVNRX.js";
3
+ } from "./chunk-TN2VNSUT.js";
4
4
  import {
5
5
  Crossenv
6
6
  } from "./chunk-GJOU3UAL.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  register
3
- } from "./chunk-B27DVNRX.js";
3
+ } from "./chunk-TN2VNSUT.js";
4
4
  import {
5
5
  Crossenv
6
6
  } from "./chunk-GJOU3UAL.js";
@@ -0,0 +1,13 @@
1
+ import {
2
+ Register
3
+ } from "./chunk-JJFS2I7N.js";
4
+
5
+ // src/agnostic/errors/index.ts
6
+ var Errors;
7
+ ((Errors2) => {
8
+ Errors2.Register = Register;
9
+ })(Errors || (Errors = {}));
10
+
11
+ export {
12
+ Errors
13
+ };
@@ -3,16 +3,16 @@ import {
3
3
  } from "./chunk-GJOU3UAL.js";
4
4
  import {
5
5
  Errors
6
- } from "./chunk-RLESUSTH.js";
6
+ } from "./chunk-SI3URYBN.js";
7
7
 
8
8
  // src/shared/errors/index.ts
9
- var register = new Errors.Register({
9
+ var register = Errors.Register.from({
10
10
  ["no-window-document-on-runtime" /* NO_DOCUMENT */]: {
11
11
  message: `Runtime '${Crossenv.detectRuntime()}' does not provide a Document object, cannot complete.`
12
12
  },
13
13
  ["no-window-document-on-runtime-please-provide" /* NO_DOCUMENT_PLEASE_PROVIDE */]: {
14
14
  message: `Please provide a Document object since none are found on runtime '${Crossenv.detectRuntime()}'`,
15
- makeDetails: (tips) => tips
15
+ detailsMaker: (tips) => tips
16
16
  }
17
17
  });
18
18
 
@@ -1,12 +1,12 @@
1
1
  import {
2
- readWrite
3
- } from "../../chunks/chunk-7DBNMU6N.js";
2
+ isInDirectory
3
+ } from "../../chunks/chunk-NRITRUZW.js";
4
4
  import {
5
5
  Subpaths
6
6
  } from "../../chunks/chunk-HGCG2J77.js";
7
7
  import {
8
- isInDirectory
9
- } from "../../chunks/chunk-NRITRUZW.js";
8
+ readWrite
9
+ } from "../../chunks/chunk-7DBNMU6N.js";
10
10
  import "../../chunks/chunk-LQFKUNVQ.js";
11
11
 
12
12
  // src/node/files/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@design-edito/tools",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "",
5
5
  "author": "Maxime Fabas",
6
6
  "license": "ISC",
@@ -13,23 +13,23 @@
13
13
  "module": "index.js",
14
14
  "peerDependencies": {
15
15
  "chalk": "^5.3.0",
16
- "jsdom": "^24.1.1",
16
+ "jsdom": "^25.0.0",
17
17
  "react": "^18.3.1",
18
18
  "react-dom": "^18.3.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/chalk": "^2.2.0",
22
22
  "@types/jsdom": "^21.1.7",
23
- "@types/node": "^22.1.0",
23
+ "@types/node": "^22.5.5",
24
24
  "@types/prompts": "^2.4.9",
25
- "@types/react": "^18.3.3",
25
+ "@types/react": "^18.3.7",
26
26
  "@types/react-dom": "^18.3.0",
27
27
  "@types/semver": "^7.5.8",
28
28
  "camelcase": "^8.0.0",
29
- "esbuild": "^0.23.0",
29
+ "esbuild": "^0.23.1",
30
30
  "prompts": "^2.4.2",
31
31
  "semver": "^7.6.3",
32
- "simple-git": "^3.25.0",
33
- "typescript": "^5.5.4"
32
+ "simple-git": "^3.26.0",
33
+ "typescript": "^5.6.2"
34
34
  }
35
35
  }
@@ -1,14 +1,157 @@
1
- import { Errors } from '~/agnostic/errors';
2
1
  export declare enum Codes {
3
2
  NO_DOCUMENT = "no-window-document-on-runtime",
4
3
  NO_DOCUMENT_PLEASE_PROVIDE = "no-window-document-on-runtime-please-provide"
5
4
  }
6
- export declare const register: Errors.Register<{
7
- "no-window-document-on-runtime": {
5
+ export declare const register: {
6
+ getMessage: <Code extends Codes>(code: Code) => {
7
+ "no-window-document-on-runtime": {
8
+ message: string;
9
+ };
10
+ "no-window-document-on-runtime-please-provide": {
11
+ message: string;
12
+ detailsMaker: (tips?: string) => string | undefined;
13
+ };
14
+ }[Code]["message"];
15
+ getDetailsMaker: <Code extends Codes>(code: Code) => {
16
+ "no-window-document-on-runtime": {
17
+ message: string;
18
+ };
19
+ "no-window-document-on-runtime-please-provide": {
20
+ message: string;
21
+ detailsMaker: (tips?: string) => string | undefined;
22
+ };
23
+ }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
24
+ "no-window-document-on-runtime": {
25
+ message: string;
26
+ };
27
+ "no-window-document-on-runtime-please-provide": {
28
+ message: string;
29
+ detailsMaker: (tips?: string) => string | undefined;
30
+ };
31
+ }[Code]["detailsMaker"] : undefined;
32
+ getDetails: <Code extends Codes>(code: Code, ...params: ({
33
+ "no-window-document-on-runtime": {
34
+ message: string;
35
+ };
36
+ "no-window-document-on-runtime-please-provide": {
37
+ message: string;
38
+ detailsMaker: (tips?: string) => string | undefined;
39
+ };
40
+ }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
41
+ "no-window-document-on-runtime": {
42
+ message: string;
43
+ };
44
+ "no-window-document-on-runtime-please-provide": {
45
+ message: string;
46
+ detailsMaker: (tips?: string) => string | undefined;
47
+ };
48
+ }[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => ({
49
+ "no-window-document-on-runtime": {
50
+ message: string;
51
+ };
52
+ "no-window-document-on-runtime-please-provide": {
53
+ message: string;
54
+ detailsMaker: (tips?: string) => string | undefined;
55
+ };
56
+ }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
57
+ "no-window-document-on-runtime": {
58
+ message: string;
59
+ };
60
+ "no-window-document-on-runtime-please-provide": {
61
+ message: string;
62
+ detailsMaker: (tips?: string) => string | undefined;
63
+ };
64
+ }[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
65
+ getError: <Code extends Codes>(code: Code, ...params: ({
66
+ "no-window-document-on-runtime": {
67
+ message: string;
68
+ };
69
+ "no-window-document-on-runtime-please-provide": {
70
+ message: string;
71
+ detailsMaker: (tips?: string) => string | undefined;
72
+ };
73
+ }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
74
+ "no-window-document-on-runtime": {
75
+ message: string;
76
+ };
77
+ "no-window-document-on-runtime-please-provide": {
78
+ message: string;
79
+ detailsMaker: (tips?: string) => string | undefined;
80
+ };
81
+ }[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => {
82
+ code: Code;
83
+ details: ({
84
+ "no-window-document-on-runtime": {
85
+ message: string;
86
+ };
87
+ "no-window-document-on-runtime-please-provide": {
88
+ message: string;
89
+ detailsMaker: (tips?: string) => string | undefined;
90
+ };
91
+ }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
92
+ "no-window-document-on-runtime": {
93
+ message: string;
94
+ };
95
+ "no-window-document-on-runtime-please-provide": {
96
+ message: string;
97
+ detailsMaker: (tips?: string) => string | undefined;
98
+ };
99
+ }[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
100
+ name: string;
8
101
  message: string;
102
+ stack?: string;
9
103
  };
10
- "no-window-document-on-runtime-please-provide": {
11
- message: string;
12
- makeDetails: (tips?: string) => string | undefined;
104
+ CustomError: {
105
+ new <Code extends Codes>(code: Code, ...params: ({
106
+ "no-window-document-on-runtime": {
107
+ message: string;
108
+ };
109
+ "no-window-document-on-runtime-please-provide": {
110
+ message: string;
111
+ detailsMaker: (tips?: string) => string | undefined;
112
+ };
113
+ }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
114
+ "no-window-document-on-runtime": {
115
+ message: string;
116
+ };
117
+ "no-window-document-on-runtime-please-provide": {
118
+ message: string;
119
+ detailsMaker: (tips?: string) => string | undefined;
120
+ };
121
+ }[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []): {
122
+ code: Code;
123
+ details: ({
124
+ "no-window-document-on-runtime": {
125
+ message: string;
126
+ };
127
+ "no-window-document-on-runtime-please-provide": {
128
+ message: string;
129
+ detailsMaker: (tips?: string) => string | undefined;
130
+ };
131
+ }[Code]["detailsMaker"] extends (...params: any[]) => any ? {
132
+ "no-window-document-on-runtime": {
133
+ message: string;
134
+ };
135
+ "no-window-document-on-runtime-please-provide": {
136
+ message: string;
137
+ detailsMaker: (tips?: string) => string | undefined;
138
+ };
139
+ }[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never;
140
+ name: string;
141
+ message: string;
142
+ stack?: string;
143
+ };
144
+ captureStackTrace(targetObject: object, constructorOpt?: Function): void;
145
+ prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
146
+ stackTraceLimit: number;
147
+ };
148
+ source: {
149
+ "no-window-document-on-runtime": {
150
+ message: string;
151
+ };
152
+ "no-window-document-on-runtime-please-provide": {
153
+ message: string;
154
+ detailsMaker: (tips?: string) => string | undefined;
155
+ };
13
156
  };
14
- }>;
157
+ };
@@ -1,41 +0,0 @@
1
- // src/agnostic/errors/index.ts
2
- var Errors;
3
- ((Errors2) => {
4
- class CustomError extends Error {
5
- code;
6
- details;
7
- constructor(data) {
8
- const { code, message, details } = data;
9
- super(message);
10
- this.code = code;
11
- this.details = details;
12
- }
13
- }
14
- Errors2.CustomError = CustomError;
15
- class Register {
16
- index;
17
- constructor(index) {
18
- this.index = index;
19
- }
20
- getFactory(code) {
21
- return this.index[code];
22
- }
23
- getData(code, ...params) {
24
- const core = this.getFactory(code);
25
- const { message, makeDetails } = core;
26
- return {
27
- code,
28
- message,
29
- details: makeDetails?.(...params)
30
- };
31
- }
32
- getError(code, ...params) {
33
- return new CustomError(this.getData(code, ...params));
34
- }
35
- }
36
- Errors2.Register = Register;
37
- })(Errors || (Errors = {}));
38
-
39
- export {
40
- Errors
41
- };
@@ -1,9 +1,9 @@
1
- import {
2
- isValidClassName
3
- } from "./chunk-W5A2TON3.js";
4
1
  import {
5
2
  isFalsy
6
3
  } from "./chunk-QXAJXTXV.js";
4
+ import {
5
+ isValidClassName
6
+ } from "./chunk-W5A2TON3.js";
7
7
 
8
8
  // src/agnostic/css/bem/getNamesArr.ts
9
9
  function getNamesArr(arg) {