@design-edito/tools 0.1.11 → 0.1.13
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/index.js +12 -11
- package/agnostic/errors/index.js +3 -2
- package/agnostic/errors/register/index.d.ts +2 -0
- package/agnostic/errors/register/index.js +2 -1
- package/agnostic/html/index.js +15 -14
- package/agnostic/html/sanitize/index.js +5 -4
- package/agnostic/html/selector-to-element/index.js +5 -4
- package/agnostic/html/string-to-nodes/index.js +6 -5
- package/agnostic/misc/index.js +8 -8
- package/agnostic/misc/outcome/index.d.ts +4 -4
- package/agnostic/misc/outcome/index.js +3 -25
- package/agnostic/numbers/index.js +6 -6
- package/agnostic/objects/index.js +3 -3
- package/agnostic/strings/index.js +5 -5
- package/chunks/{chunk-SI3URYBN.js → chunk-4CMAH7Q4.js} +1 -1
- package/chunks/{chunk-T4WHRHA3.js → chunk-4S4UJG5A.js} +1 -1
- package/chunks/{chunk-UAND5PYN.js → chunk-DRXZ4YUW.js} +3 -3
- package/chunks/chunk-HDPSQ7WY.js +29 -0
- package/chunks/{chunk-JJFS2I7N.js → chunk-HEXR23CH.js} +10 -0
- package/chunks/{chunk-BIVZM5DE.js → chunk-NGL6BHCM.js} +2 -2
- package/chunks/{chunk-XVAGFNRL.js → chunk-R6W6KA2P.js} +1 -1
- package/node/files/index.js +3 -3
- package/package.json +1 -1
- package/shared/errors/index.d.ts +41 -0
package/agnostic/async/index.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
Transitions
|
3
|
-
} from "../../chunks/chunk-4GDNHUCZ.js";
|
4
1
|
import {
|
5
2
|
timeoutCall
|
6
3
|
} from "../../chunks/chunk-4VC5PT5T.js";
|
4
|
+
import {
|
5
|
+
Transitions
|
6
|
+
} from "../../chunks/chunk-4GDNHUCZ.js";
|
7
7
|
import {
|
8
8
|
wait
|
9
9
|
} from "../../chunks/chunk-DQNJQBC6.js";
|
package/agnostic/css/index.js
CHANGED
@@ -2,24 +2,25 @@ import {
|
|
2
2
|
Random
|
3
3
|
} from "../../chunks/chunk-WLL3FNVL.js";
|
4
4
|
import {
|
5
|
-
|
6
|
-
} from "../../chunks/chunk-
|
5
|
+
register
|
6
|
+
} from "../../chunks/chunk-DRXZ4YUW.js";
|
7
7
|
import {
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
Crossenv
|
9
|
+
} from "../../chunks/chunk-GJOU3UAL.js";
|
10
|
+
import "../../chunks/chunk-4CMAH7Q4.js";
|
11
|
+
import "../../chunks/chunk-HEXR23CH.js";
|
12
|
+
import "../../chunks/chunk-HDPSQ7WY.js";
|
11
13
|
import {
|
12
14
|
generateNiceColor,
|
13
15
|
niceColors
|
14
16
|
} from "../../chunks/chunk-EDVNAV3G.js";
|
15
17
|
import {
|
16
|
-
|
17
|
-
} from "../../chunks/chunk-
|
18
|
-
import "../../chunks/chunk-SI3URYBN.js";
|
19
|
-
import "../../chunks/chunk-JJFS2I7N.js";
|
18
|
+
Bem
|
19
|
+
} from "../../chunks/chunk-KIONYWA7.js";
|
20
20
|
import {
|
21
|
-
|
22
|
-
|
21
|
+
classNameRegex,
|
22
|
+
isValidClassName
|
23
|
+
} from "../../chunks/chunk-W5A2TON3.js";
|
23
24
|
import "../../chunks/chunk-QXAJXTXV.js";
|
24
25
|
import "../../chunks/chunk-HC6ZOHCS.js";
|
25
26
|
|
package/agnostic/errors/index.js
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { Outcome } from "~/agnostic/misc/outcome";
|
1
2
|
export declare namespace Register {
|
2
3
|
type RegisterEntry = {
|
3
4
|
message: string;
|
@@ -16,6 +17,7 @@ export declare namespace Register {
|
|
16
17
|
message: string;
|
17
18
|
stack?: string;
|
18
19
|
};
|
20
|
+
getFailureOutcome: <Code extends keyof Source>(code: Code, ...params: (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => Outcome.Failure<Code, Source[Code]["message"], (Source[Code]["detailsMaker"] extends (...params: any[]) => any ? Source[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never>;
|
19
21
|
CustomError: {
|
20
22
|
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
23
|
code: Code;
|
package/agnostic/html/index.js
CHANGED
@@ -1,19 +1,15 @@
|
|
1
1
|
import {
|
2
|
-
|
3
|
-
} from "../../chunks/chunk-
|
4
|
-
import {
|
5
|
-
stringToNodes
|
6
|
-
} from "../../chunks/chunk-BIVZM5DE.js";
|
7
|
-
import {
|
8
|
-
Sanitize
|
9
|
-
} from "../../chunks/chunk-T4WHRHA3.js";
|
2
|
+
insertNode
|
3
|
+
} from "../../chunks/chunk-XA4HVHJ4.js";
|
10
4
|
import {
|
11
5
|
Placeholders
|
12
6
|
} from "../../chunks/chunk-VYW4IADX.js";
|
13
|
-
import
|
14
|
-
|
15
|
-
|
16
|
-
import
|
7
|
+
import {
|
8
|
+
selectorToElement
|
9
|
+
} from "../../chunks/chunk-R6W6KA2P.js";
|
10
|
+
import {
|
11
|
+
stringToNodes
|
12
|
+
} from "../../chunks/chunk-NGL6BHCM.js";
|
17
13
|
import {
|
18
14
|
getNodeAncestors
|
19
15
|
} from "../../chunks/chunk-SQZGZ3VT.js";
|
@@ -21,8 +17,13 @@ import {
|
|
21
17
|
getPositionInsideParent
|
22
18
|
} from "../../chunks/chunk-VTPRO4NJ.js";
|
23
19
|
import {
|
24
|
-
|
25
|
-
} from "../../chunks/chunk-
|
20
|
+
Sanitize
|
21
|
+
} from "../../chunks/chunk-4S4UJG5A.js";
|
22
|
+
import "../../chunks/chunk-DRXZ4YUW.js";
|
23
|
+
import "../../chunks/chunk-GJOU3UAL.js";
|
24
|
+
import "../../chunks/chunk-4CMAH7Q4.js";
|
25
|
+
import "../../chunks/chunk-HEXR23CH.js";
|
26
|
+
import "../../chunks/chunk-HDPSQ7WY.js";
|
26
27
|
|
27
28
|
// src/agnostic/html/index.ts
|
28
29
|
var Html;
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import {
|
2
2
|
Sanitize
|
3
|
-
} from "../../../chunks/chunk-
|
4
|
-
import "../../../chunks/chunk-
|
5
|
-
import "../../../chunks/chunk-SI3URYBN.js";
|
6
|
-
import "../../../chunks/chunk-JJFS2I7N.js";
|
3
|
+
} from "../../../chunks/chunk-4S4UJG5A.js";
|
4
|
+
import "../../../chunks/chunk-DRXZ4YUW.js";
|
7
5
|
import "../../../chunks/chunk-GJOU3UAL.js";
|
6
|
+
import "../../../chunks/chunk-4CMAH7Q4.js";
|
7
|
+
import "../../../chunks/chunk-HEXR23CH.js";
|
8
|
+
import "../../../chunks/chunk-HDPSQ7WY.js";
|
8
9
|
export {
|
9
10
|
Sanitize
|
10
11
|
};
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import {
|
2
2
|
selectorToElement
|
3
|
-
} from "../../../chunks/chunk-
|
4
|
-
import "../../../chunks/chunk-
|
5
|
-
import "../../../chunks/chunk-SI3URYBN.js";
|
6
|
-
import "../../../chunks/chunk-JJFS2I7N.js";
|
3
|
+
} from "../../../chunks/chunk-R6W6KA2P.js";
|
4
|
+
import "../../../chunks/chunk-DRXZ4YUW.js";
|
7
5
|
import "../../../chunks/chunk-GJOU3UAL.js";
|
6
|
+
import "../../../chunks/chunk-4CMAH7Q4.js";
|
7
|
+
import "../../../chunks/chunk-HEXR23CH.js";
|
8
|
+
import "../../../chunks/chunk-HDPSQ7WY.js";
|
8
9
|
export {
|
9
10
|
selectorToElement
|
10
11
|
};
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import {
|
2
2
|
stringToNodes
|
3
|
-
} from "../../../chunks/chunk-
|
4
|
-
import "../../../chunks/chunk-
|
5
|
-
import "../../../chunks/chunk-
|
6
|
-
import "../../../chunks/chunk-SI3URYBN.js";
|
7
|
-
import "../../../chunks/chunk-JJFS2I7N.js";
|
3
|
+
} from "../../../chunks/chunk-NGL6BHCM.js";
|
4
|
+
import "../../../chunks/chunk-4S4UJG5A.js";
|
5
|
+
import "../../../chunks/chunk-DRXZ4YUW.js";
|
8
6
|
import "../../../chunks/chunk-GJOU3UAL.js";
|
7
|
+
import "../../../chunks/chunk-4CMAH7Q4.js";
|
8
|
+
import "../../../chunks/chunk-HEXR23CH.js";
|
9
|
+
import "../../../chunks/chunk-HDPSQ7WY.js";
|
9
10
|
export {
|
10
11
|
stringToNodes
|
11
12
|
};
|
package/agnostic/misc/index.js
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
import {
|
2
|
+
getCurrentDownlink
|
3
|
+
} from "../../chunks/chunk-7AWTHZLY.js";
|
4
|
+
import {
|
5
|
+
Logs
|
6
|
+
} from "../../chunks/chunk-HEJV6JIO.js";
|
1
7
|
import {
|
2
8
|
Assert
|
3
9
|
} from "../../chunks/chunk-W7YBGJ4H.js";
|
@@ -5,20 +11,14 @@ import {
|
|
5
11
|
Cast
|
6
12
|
} from "../../chunks/chunk-4QQBKBYH.js";
|
7
13
|
import {
|
8
|
-
|
9
|
-
} from "../../chunks/chunk-
|
10
|
-
import {
|
11
|
-
getCurrentDownlink
|
12
|
-
} from "../../chunks/chunk-7AWTHZLY.js";
|
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,
|
@@ -3,15 +3,15 @@ export declare namespace Outcome {
|
|
3
3
|
success: true;
|
4
4
|
payload: Payload;
|
5
5
|
};
|
6
|
-
type Failure<Code extends
|
6
|
+
type Failure<Code extends any = any, Msg extends string = string, Details extends any = any> = {
|
7
7
|
success: false;
|
8
8
|
code: Code;
|
9
9
|
message: Msg;
|
10
10
|
details?: Details;
|
11
11
|
};
|
12
|
-
type Either<Payload extends any = any, Code extends
|
12
|
+
type Either<Payload extends any = any, Code extends any = any, Msg extends string = string, Details extends any = any> = Success<Payload> | Failure<Code, Msg, Details>;
|
13
13
|
function makeSuccess<Payload extends any>(payload: Payload): Success<Payload>;
|
14
|
-
function makeFailure<Code extends
|
14
|
+
function makeFailure<Code extends any = any, Msg extends string = string, Details extends any | undefined = undefined>(code: Code, message: Msg, details?: Details): Failure<Code, Msg, Details>;
|
15
15
|
function make<Payload extends any>(success: true, payload: Payload): Success<Payload>;
|
16
|
-
function make<Code extends
|
16
|
+
function make<Code extends any = any, Msg extends string = string, Details extends any | undefined = undefined>(success: false, code: Code, message: Msg, details?: Details): Failure<Code, Msg, Details>;
|
17
17
|
}
|
@@ -1,28 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
function makeSuccess(payload) {
|
5
|
-
return {
|
6
|
-
success: true,
|
7
|
-
payload
|
8
|
-
};
|
9
|
-
}
|
10
|
-
Outcome2.makeSuccess = makeSuccess;
|
11
|
-
function makeFailure(code, message, details) {
|
12
|
-
return {
|
13
|
-
success: false,
|
14
|
-
code,
|
15
|
-
message,
|
16
|
-
details
|
17
|
-
};
|
18
|
-
}
|
19
|
-
Outcome2.makeFailure = makeFailure;
|
20
|
-
function make(success, payloadOrCode, message, details) {
|
21
|
-
if (success) return makeSuccess(payloadOrCode);
|
22
|
-
return makeFailure(payloadOrCode, message, details);
|
23
|
-
}
|
24
|
-
Outcome2.make = make;
|
25
|
-
})(Outcome || (Outcome = {}));
|
1
|
+
import {
|
2
|
+
Outcome
|
3
|
+
} from "../../../chunks/chunk-HDPSQ7WY.js";
|
26
4
|
export {
|
27
5
|
Outcome
|
28
6
|
};
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import {
|
2
|
-
absoluteModulo
|
3
|
-
} from "../../chunks/chunk-DNIOWD7K.js";
|
4
1
|
import {
|
5
2
|
interpolate
|
6
3
|
} from "../../chunks/chunk-EW46EXFB.js";
|
7
|
-
import {
|
8
|
-
clamp
|
9
|
-
} from "../../chunks/chunk-OSAXBA7G.js";
|
10
4
|
import {
|
11
5
|
createScale,
|
12
6
|
getHarmonic
|
13
7
|
} from "../../chunks/chunk-UYTXXUU7.js";
|
8
|
+
import {
|
9
|
+
absoluteModulo
|
10
|
+
} from "../../chunks/chunk-DNIOWD7K.js";
|
11
|
+
import {
|
12
|
+
clamp
|
13
|
+
} from "../../chunks/chunk-OSAXBA7G.js";
|
14
14
|
import {
|
15
15
|
round
|
16
16
|
} from "../../chunks/chunk-32IRF4OP.js";
|
@@ -5,12 +5,12 @@ import {
|
|
5
5
|
isNonNullObject,
|
6
6
|
isObject
|
7
7
|
} from "../../chunks/chunk-HQLRJ7XW.js";
|
8
|
-
import {
|
9
|
-
isRecord
|
10
|
-
} from "../../chunks/chunk-YDIBNEGA.js";
|
11
8
|
import {
|
12
9
|
Validation
|
13
10
|
} from "../../chunks/chunk-FPEW3A27.js";
|
11
|
+
import {
|
12
|
+
isRecord
|
13
|
+
} from "../../chunks/chunk-YDIBNEGA.js";
|
14
14
|
import {
|
15
15
|
Enums
|
16
16
|
} from "../../chunks/chunk-WOAYU6LB.js";
|
@@ -1,17 +1,17 @@
|
|
1
|
+
import {
|
2
|
+
CharCodes
|
3
|
+
} from "../../chunks/chunk-34U4HX4V.js";
|
1
4
|
import {
|
2
5
|
matches,
|
3
6
|
matchesEvery,
|
4
7
|
matchesSome
|
5
8
|
} from "../../chunks/chunk-LQFKUNVQ.js";
|
6
9
|
import {
|
7
|
-
|
8
|
-
} from "../../chunks/chunk-
|
10
|
+
replaceAll
|
11
|
+
} from "../../chunks/chunk-MF56TTC5.js";
|
9
12
|
import {
|
10
13
|
normalizeIndent
|
11
14
|
} from "../../chunks/chunk-JQXNEJAP.js";
|
12
|
-
import {
|
13
|
-
replaceAll
|
14
|
-
} from "../../chunks/chunk-MF56TTC5.js";
|
15
15
|
import {
|
16
16
|
toAlphanum
|
17
17
|
} from "../../chunks/chunk-COVPTTAD.js";
|
@@ -0,0 +1,29 @@
|
|
1
|
+
// src/agnostic/misc/outcome/index.ts
|
2
|
+
var Outcome;
|
3
|
+
((Outcome2) => {
|
4
|
+
function makeSuccess(payload) {
|
5
|
+
return {
|
6
|
+
success: true,
|
7
|
+
payload
|
8
|
+
};
|
9
|
+
}
|
10
|
+
Outcome2.makeSuccess = makeSuccess;
|
11
|
+
function makeFailure(code, message, details) {
|
12
|
+
return {
|
13
|
+
success: false,
|
14
|
+
code,
|
15
|
+
message,
|
16
|
+
details
|
17
|
+
};
|
18
|
+
}
|
19
|
+
Outcome2.makeFailure = makeFailure;
|
20
|
+
function make(success, payloadOrCode, message, details) {
|
21
|
+
if (success) return makeSuccess(payloadOrCode);
|
22
|
+
return makeFailure(payloadOrCode, message, details);
|
23
|
+
}
|
24
|
+
Outcome2.make = make;
|
25
|
+
})(Outcome || (Outcome = {}));
|
26
|
+
|
27
|
+
export {
|
28
|
+
Outcome
|
29
|
+
};
|
@@ -1,3 +1,7 @@
|
|
1
|
+
import {
|
2
|
+
Outcome
|
3
|
+
} from "./chunk-HDPSQ7WY.js";
|
4
|
+
|
1
5
|
// src/agnostic/errors/register/index.ts
|
2
6
|
var Register;
|
3
7
|
((Register2) => {
|
@@ -15,6 +19,11 @@ var Register;
|
|
15
19
|
const details = maker?.(...params);
|
16
20
|
return details;
|
17
21
|
}
|
22
|
+
function getFailureOutcome(code, ...params) {
|
23
|
+
const message = getMessage(code);
|
24
|
+
const details = getDetails(code, ...params);
|
25
|
+
return Outcome.makeFailure(code, message, details);
|
26
|
+
}
|
18
27
|
class CustomError extends Error {
|
19
28
|
code;
|
20
29
|
details;
|
@@ -33,6 +42,7 @@ var Register;
|
|
33
42
|
getDetailsMaker,
|
34
43
|
getDetails,
|
35
44
|
getError,
|
45
|
+
getFailureOutcome,
|
36
46
|
CustomError,
|
37
47
|
source
|
38
48
|
};
|
package/node/files/index.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import {
|
2
|
-
isInDirectory
|
3
|
-
} from "../../chunks/chunk-NRITRUZW.js";
|
4
1
|
import {
|
5
2
|
readWrite
|
6
3
|
} from "../../chunks/chunk-7DBNMU6N.js";
|
4
|
+
import {
|
5
|
+
isInDirectory
|
6
|
+
} from "../../chunks/chunk-NRITRUZW.js";
|
7
7
|
import {
|
8
8
|
Subpaths
|
9
9
|
} from "../../chunks/chunk-HGCG2J77.js";
|
package/package.json
CHANGED
package/shared/errors/index.d.ts
CHANGED
@@ -101,6 +101,47 @@ export declare const register: {
|
|
101
101
|
message: string;
|
102
102
|
stack?: string;
|
103
103
|
};
|
104
|
+
getFailureOutcome: <Code extends Codes>(code: Code, ...params: ({
|
105
|
+
"no-window-document-on-runtime": {
|
106
|
+
message: string;
|
107
|
+
};
|
108
|
+
"no-window-document-on-runtime-please-provide": {
|
109
|
+
message: string;
|
110
|
+
detailsMaker: (tips?: string) => string | undefined;
|
111
|
+
};
|
112
|
+
}[Code]["detailsMaker"] extends (...params: any[]) => any ? {
|
113
|
+
"no-window-document-on-runtime": {
|
114
|
+
message: string;
|
115
|
+
};
|
116
|
+
"no-window-document-on-runtime-please-provide": {
|
117
|
+
message: string;
|
118
|
+
detailsMaker: (tips?: string) => string | undefined;
|
119
|
+
};
|
120
|
+
}[Code]["detailsMaker"] : undefined) extends (...params: infer P) => any ? P : []) => import("../../agnostic/misc/outcome").Outcome.Failure<Code, {
|
121
|
+
"no-window-document-on-runtime": {
|
122
|
+
message: string;
|
123
|
+
};
|
124
|
+
"no-window-document-on-runtime-please-provide": {
|
125
|
+
message: string;
|
126
|
+
detailsMaker: (tips?: string) => string | undefined;
|
127
|
+
};
|
128
|
+
}[Code]["message"], ({
|
129
|
+
"no-window-document-on-runtime": {
|
130
|
+
message: string;
|
131
|
+
};
|
132
|
+
"no-window-document-on-runtime-please-provide": {
|
133
|
+
message: string;
|
134
|
+
detailsMaker: (tips?: string) => string | undefined;
|
135
|
+
};
|
136
|
+
}[Code]["detailsMaker"] extends (...params: any[]) => any ? {
|
137
|
+
"no-window-document-on-runtime": {
|
138
|
+
message: string;
|
139
|
+
};
|
140
|
+
"no-window-document-on-runtime-please-provide": {
|
141
|
+
message: string;
|
142
|
+
detailsMaker: (tips?: string) => string | undefined;
|
143
|
+
};
|
144
|
+
}[Code]["detailsMaker"] : undefined) extends (...params: any[]) => infer R ? R : never>;
|
104
145
|
CustomError: {
|
105
146
|
new <Code extends Codes>(code: Code, ...params: ({
|
106
147
|
"no-window-document-on-runtime": {
|