@design-edito/tools 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- package/agnostic/async/index.js +3 -3
- package/agnostic/css/bem/index.js +2 -2
- package/agnostic/css/index.js +11 -10
- package/agnostic/errors/index.d.ts +2 -28
- package/agnostic/errors/index.js +2 -1
- package/agnostic/errors/register/index.d.ts +33 -0
- package/agnostic/errors/register/index.js +6 -0
- package/agnostic/html/index.js +12 -11
- package/agnostic/html/sanitize/index.js +4 -3
- package/agnostic/html/selector-to-element/index.js +4 -3
- package/agnostic/html/string-to-nodes/index.js +5 -4
- package/agnostic/misc/index.js +3 -3
- package/agnostic/misc/outcome/index.d.ts +9 -16
- package/agnostic/misc/outcome/index.js +6 -5
- package/agnostic/numbers/index.js +6 -6
- package/agnostic/objects/index.js +3 -3
- package/agnostic/optim/index.js +3 -3
- package/agnostic/strings/index.js +8 -8
- package/chunks/{chunk-XPM2OFLI.js → chunk-5WIF34SV.js} +2 -2
- package/chunks/chunk-JJFS2I7N.js +45 -0
- package/chunks/{chunk-RASYEJ6T.js → chunk-NHJPS3IB.js} +1 -1
- package/chunks/{chunk-5FU3AIZ4.js → chunk-OCEN35QZ.js} +1 -1
- package/chunks/chunk-SI3URYBN.js +13 -0
- package/chunks/{chunk-B27DVNRX.js → chunk-TN2VNSUT.js} +3 -3
- package/node/files/index.js +3 -3
- package/package.json +1 -1
- package/shared/errors/index.d.ts +150 -7
- package/chunks/chunk-RLESUSTH.js +0 -41
- package/chunks/{chunk-KIONYWA7.js → chunk-7YW5HL6N.js} +3 -3
package/agnostic/async/index.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
+
import {
|
2
|
+
timeoutCall
|
3
|
+
} from "../../chunks/chunk-4VC5PT5T.js";
|
1
4
|
import {
|
2
5
|
Transitions
|
3
6
|
} from "../../chunks/chunk-4GDNHUCZ.js";
|
4
7
|
import {
|
5
8
|
wait
|
6
9
|
} from "../../chunks/chunk-DQNJQBC6.js";
|
7
|
-
import {
|
8
|
-
timeoutCall
|
9
|
-
} from "../../chunks/chunk-4VC5PT5T.js";
|
10
10
|
|
11
11
|
// src/agnostic/async/index.ts
|
12
12
|
var Async;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import {
|
2
2
|
Bem
|
3
|
-
} from "../../../chunks/chunk-
|
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
|
};
|
package/agnostic/css/index.js
CHANGED
@@ -1,26 +1,27 @@
|
|
1
1
|
import {
|
2
2
|
Random
|
3
3
|
} from "../../chunks/chunk-WLL3FNVL.js";
|
4
|
+
import {
|
5
|
+
register
|
6
|
+
} from "../../chunks/chunk-TN2VNSUT.js";
|
7
|
+
import {
|
8
|
+
Crossenv
|
9
|
+
} from "../../chunks/chunk-GJOU3UAL.js";
|
10
|
+
import "../../chunks/chunk-SI3URYBN.js";
|
11
|
+
import "../../chunks/chunk-JJFS2I7N.js";
|
4
12
|
import {
|
5
13
|
generateNiceColor,
|
6
14
|
niceColors
|
7
15
|
} from "../../chunks/chunk-EDVNAV3G.js";
|
8
16
|
import {
|
9
17
|
Bem
|
10
|
-
} from "../../chunks/chunk-
|
18
|
+
} from "../../chunks/chunk-7YW5HL6N.js";
|
19
|
+
import "../../chunks/chunk-QXAJXTXV.js";
|
20
|
+
import "../../chunks/chunk-HC6ZOHCS.js";
|
11
21
|
import {
|
12
22
|
classNameRegex,
|
13
23
|
isValidClassName
|
14
24
|
} from "../../chunks/chunk-W5A2TON3.js";
|
15
|
-
import {
|
16
|
-
register
|
17
|
-
} from "../../chunks/chunk-B27DVNRX.js";
|
18
|
-
import {
|
19
|
-
Crossenv
|
20
|
-
} from "../../chunks/chunk-GJOU3UAL.js";
|
21
|
-
import "../../chunks/chunk-RLESUSTH.js";
|
22
|
-
import "../../chunks/chunk-QXAJXTXV.js";
|
23
|
-
import "../../chunks/chunk-HC6ZOHCS.js";
|
24
25
|
|
25
26
|
// src/agnostic/css/styles-set/index.tsx
|
26
27
|
import { Component } from "react";
|
@@ -1,30 +1,4 @@
|
|
1
|
-
|
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
|
-
|
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 {};
|
package/agnostic/errors/index.js
CHANGED
@@ -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
|
+
}
|
package/agnostic/html/index.js
CHANGED
@@ -1,27 +1,28 @@
|
|
1
|
+
import {
|
2
|
+
getPositionInsideParent
|
3
|
+
} from "../../chunks/chunk-VTPRO4NJ.js";
|
1
4
|
import {
|
2
5
|
Placeholders
|
3
6
|
} from "../../chunks/chunk-VYW4IADX.js";
|
4
7
|
import {
|
5
8
|
insertNode
|
6
9
|
} from "../../chunks/chunk-XA4HVHJ4.js";
|
10
|
+
import {
|
11
|
+
selectorToElement
|
12
|
+
} from "../../chunks/chunk-OCEN35QZ.js";
|
7
13
|
import {
|
8
14
|
stringToNodes
|
9
|
-
} from "../../chunks/chunk-
|
15
|
+
} from "../../chunks/chunk-5WIF34SV.js";
|
10
16
|
import {
|
11
17
|
Sanitize
|
12
|
-
} from "../../chunks/chunk-
|
13
|
-
import {
|
14
|
-
selectorToElement
|
15
|
-
} from "../../chunks/chunk-5FU3AIZ4.js";
|
16
|
-
import "../../chunks/chunk-B27DVNRX.js";
|
17
|
-
import "../../chunks/chunk-GJOU3UAL.js";
|
18
|
+
} from "../../chunks/chunk-NHJPS3IB.js";
|
18
19
|
import {
|
19
20
|
getNodeAncestors
|
20
21
|
} from "../../chunks/chunk-SQZGZ3VT.js";
|
21
|
-
import
|
22
|
-
|
23
|
-
|
24
|
-
import "../../chunks/chunk-
|
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-
|
4
|
-
import "../../../chunks/chunk-
|
3
|
+
} from "../../../chunks/chunk-NHJPS3IB.js";
|
4
|
+
import "../../../chunks/chunk-TN2VNSUT.js";
|
5
5
|
import "../../../chunks/chunk-GJOU3UAL.js";
|
6
|
-
import "../../../chunks/chunk-
|
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-
|
4
|
-
import "../../../chunks/chunk-
|
3
|
+
} from "../../../chunks/chunk-OCEN35QZ.js";
|
4
|
+
import "../../../chunks/chunk-TN2VNSUT.js";
|
5
5
|
import "../../../chunks/chunk-GJOU3UAL.js";
|
6
|
-
import "../../../chunks/chunk-
|
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-
|
4
|
-
import "../../../chunks/chunk-
|
5
|
-
import "../../../chunks/chunk-
|
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-
|
7
|
+
import "../../../chunks/chunk-SI3URYBN.js";
|
8
|
+
import "../../../chunks/chunk-JJFS2I7N.js";
|
8
9
|
export {
|
9
10
|
stringToNodes
|
10
11
|
};
|
package/agnostic/misc/index.js
CHANGED
@@ -10,15 +10,15 @@ import {
|
|
10
10
|
import {
|
11
11
|
Cast
|
12
12
|
} from "../../chunks/chunk-4QQBKBYH.js";
|
13
|
+
import {
|
14
|
+
isConstructorFunction
|
15
|
+
} from "../../chunks/chunk-RCO57B6F.js";
|
13
16
|
import {
|
14
17
|
Random
|
15
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,
|
@@ -1,22 +1,15 @@
|
|
1
|
-
import { Errors } from '../../errors';
|
2
1
|
export declare namespace Outcome {
|
3
|
-
type Success<Payload =
|
2
|
+
type Success<Payload extends any = any> = {
|
4
3
|
success: true;
|
5
|
-
|
4
|
+
payload: Payload;
|
6
5
|
};
|
7
|
-
type Failure<
|
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
|
-
|
12
|
-
|
8
|
+
code: Code;
|
9
|
+
message: Msg;
|
10
|
+
details?: Details;
|
13
11
|
};
|
14
|
-
type Outcome<
|
15
|
-
|
16
|
-
|
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(
|
4
|
+
function makeSuccess(payload) {
|
5
5
|
return {
|
6
6
|
success: true,
|
7
|
-
|
7
|
+
payload
|
8
8
|
};
|
9
9
|
}
|
10
10
|
Outcome2.makeSuccess = makeSuccess;
|
11
|
-
function makeFailure(
|
11
|
+
function makeFailure(code, message, details) {
|
12
12
|
return {
|
13
13
|
success: false,
|
14
|
-
|
15
|
-
|
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,3 +1,6 @@
|
|
1
|
+
import {
|
2
|
+
flattenGetters
|
3
|
+
} from "../../chunks/chunk-PO3V3I57.js";
|
1
4
|
import {
|
2
5
|
isNonNullObject,
|
3
6
|
isObject
|
@@ -12,9 +15,6 @@ import {
|
|
12
15
|
Enums
|
13
16
|
} from "../../chunks/chunk-WOAYU6LB.js";
|
14
17
|
import "../../chunks/chunk-E6MSDKON.js";
|
15
|
-
import {
|
16
|
-
flattenGetters
|
17
|
-
} from "../../chunks/chunk-PO3V3I57.js";
|
18
18
|
import "../../chunks/chunk-4QQBKBYH.js";
|
19
19
|
import "../../chunks/chunk-QXAJXTXV.js";
|
20
20
|
import "../../chunks/chunk-HC6ZOHCS.js";
|
package/agnostic/optim/index.js
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
import {
|
2
|
+
matches,
|
3
|
+
matchesEvery,
|
4
|
+
matchesSome
|
5
|
+
} from "../../chunks/chunk-LQFKUNVQ.js";
|
6
|
+
import {
|
7
|
+
CharCodes
|
8
|
+
} from "../../chunks/chunk-34U4HX4V.js";
|
1
9
|
import {
|
2
10
|
normalizeIndent
|
3
11
|
} from "../../chunks/chunk-JQXNEJAP.js";
|
@@ -7,14 +15,6 @@ import {
|
|
7
15
|
import {
|
8
16
|
toAlphanum
|
9
17
|
} from "../../chunks/chunk-COVPTTAD.js";
|
10
|
-
import {
|
11
|
-
matches,
|
12
|
-
matchesEvery,
|
13
|
-
matchesSome
|
14
|
-
} from "../../chunks/chunk-LQFKUNVQ.js";
|
15
|
-
import {
|
16
|
-
CharCodes
|
17
|
-
} from "../../chunks/chunk-34U4HX4V.js";
|
18
18
|
|
19
19
|
// src/agnostic/strings/index.ts
|
20
20
|
var Strings;
|
@@ -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
|
+
};
|
@@ -3,16 +3,16 @@ import {
|
|
3
3
|
} from "./chunk-GJOU3UAL.js";
|
4
4
|
import {
|
5
5
|
Errors
|
6
|
-
} from "./chunk-
|
6
|
+
} from "./chunk-SI3URYBN.js";
|
7
7
|
|
8
8
|
// src/shared/errors/index.ts
|
9
|
-
var 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
|
-
|
15
|
+
detailsMaker: (tips) => tips
|
16
16
|
}
|
17
17
|
});
|
18
18
|
|
package/node/files/index.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import {
|
2
2
|
isInDirectory
|
3
3
|
} from "../../chunks/chunk-NRITRUZW.js";
|
4
|
-
import {
|
5
|
-
readWrite
|
6
|
-
} from "../../chunks/chunk-7DBNMU6N.js";
|
7
4
|
import {
|
8
5
|
Subpaths
|
9
6
|
} from "../../chunks/chunk-HGCG2J77.js";
|
7
|
+
import {
|
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
package/shared/errors/index.d.ts
CHANGED
@@ -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:
|
7
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
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
|
+
};
|
package/chunks/chunk-RLESUSTH.js
DELETED
@@ -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
|
-
};
|