@arbor-css/tokens 0.0.1

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.
@@ -0,0 +1,138 @@
1
+ export declare const TOKEN_PREFIX = "--";
2
+ /**
3
+ * Allowed types of properties - specifying one allows defining
4
+ * a custom property in CSS which enables interpolation in animations
5
+ * and other optimizations.
6
+ *
7
+ * "*" doesn't really do much but does allow any kind of value.
8
+ *
9
+ * "computed" will not generate a property definition and is assumed
10
+ * to be a complex CSS property value like calc() or other things.
11
+ */
12
+ export type PropertyType = 'angle' | 'color' | 'custom-ident' | 'image' | 'integer' | 'length' | 'length-percentage' | 'number' | 'percentage' | 'resolution' | 'string' | 'time' | 'transform-function' | 'transform-list' | 'url' | '*';
13
+ /**
14
+ * Roughly mapped / inspired by designtokens.org.
15
+ * Not currently used... but I wrote them down, so...
16
+ */
17
+ export type TokenType = 'color' | 'dimension' | 'font-family' | 'font-weight' | 'duration' | 'cubic-bezier' | 'number' | 'font-style' | 'ratio' | 'url' | TokenCompositeType;
18
+ export type TokenCompositeTypeShapes = {
19
+ strokeStyle: {
20
+ dashArray: {
21
+ value: string;
22
+ unit: string;
23
+ }[];
24
+ lineCap: string;
25
+ } | string;
26
+ border: {
27
+ color: string;
28
+ width: string;
29
+ style: string;
30
+ };
31
+ transition: {
32
+ duration: string;
33
+ delay: string;
34
+ timingFunction: string;
35
+ };
36
+ shadow: {
37
+ offsetX: string;
38
+ offsetY: string;
39
+ blur: string;
40
+ spread: string;
41
+ color: string;
42
+ } | {
43
+ offsetX: string;
44
+ offsetY: string;
45
+ blur: string;
46
+ spread: string;
47
+ color: string;
48
+ }[];
49
+ gradient: {
50
+ color: string;
51
+ position: string;
52
+ }[];
53
+ typography: {
54
+ fontFamily: string;
55
+ fontSize: string;
56
+ fontWeight: string;
57
+ letterSpacing: string;
58
+ lineHeight: string;
59
+ };
60
+ };
61
+ export type TokenCompositeType = keyof TokenCompositeTypeShapes;
62
+ export type TokenPurpose = 'color' | 'font-size' | 'font-weight' | 'font-family' | 'line-height' | 'spacing' | 'shadow' | 'border-radius' | 'border-width' | 'shadow-x' | 'shadow-y' | 'shadow-blur' | 'shadow-spread' | 'shadow-color' | 'size' | 'other';
63
+ export declare function getTypeFromPurpose(purpose: TokenPurpose): PropertyType;
64
+ export declare function createToken(name: string, { fallback, inherits, forceDefinition, purpose, type, group, tag, }: {
65
+ /** Inferred from purpose if not provided, defaults to "*" */
66
+ type?: PropertyType;
67
+ purpose?: TokenPurpose;
68
+ group?: string;
69
+ fallback?: string | number;
70
+ tag?: string;
71
+ inherits?: boolean;
72
+ /**
73
+ * Force the generation of a @property rule definition, even if it's not meaningful.
74
+ * Otherwise tokens whose properties have no special concerns like inherit:false will
75
+ * skip generating an @property
76
+ */
77
+ forceDefinition?: boolean;
78
+ }): {
79
+ "@@TOKEN@@": true;
80
+ name: string;
81
+ type: PropertyType;
82
+ tag: string | undefined;
83
+ purpose: TokenPurpose;
84
+ group: string | undefined;
85
+ fallback: string | number | undefined;
86
+ var: string;
87
+ varFallback: (fallbackOverride?: string | number) => string;
88
+ assign: (value?: string | number) => string;
89
+ readonly definition: string;
90
+ suffixed: (suffix: string) => {
91
+ "@@TOKEN@@": true;
92
+ name: string;
93
+ type: PropertyType;
94
+ tag: string | undefined;
95
+ purpose: TokenPurpose;
96
+ group: string | undefined;
97
+ fallback: string | number | undefined;
98
+ var: string;
99
+ varFallback: (fallbackOverride?: string | number) => string;
100
+ assign: (value?: string | number) => string;
101
+ readonly definition: string;
102
+ suffixed: /*elided*/ any;
103
+ prefixed: (prefix: string) => /*elided*/ any;
104
+ };
105
+ prefixed: (prefix: string) => {
106
+ "@@TOKEN@@": true;
107
+ name: string;
108
+ type: PropertyType;
109
+ tag: string | undefined;
110
+ purpose: TokenPurpose;
111
+ group: string | undefined;
112
+ fallback: string | number | undefined;
113
+ var: string;
114
+ varFallback: (fallbackOverride?: string | number) => string;
115
+ assign: (value?: string | number) => string;
116
+ readonly definition: string;
117
+ suffixed: (suffix: string) => /*elided*/ any;
118
+ prefixed: /*elided*/ any;
119
+ };
120
+ };
121
+ export type Token = ReturnType<typeof createToken>;
122
+ export type TokenSchema = {
123
+ [Key: string]: Token | TokenSchema;
124
+ };
125
+ export declare function isToken(value: any): value is ReturnType<typeof createToken>;
126
+ /**
127
+ * Maps all token values to themselves - i.e.
128
+ * {
129
+ * '--🌗-black': 'var(--🌗-black)',
130
+ * ...
131
+ * }
132
+ */
133
+ export declare function selfReferencedProps(schema: TokenSchema, { valuePrefix: prefix, }?: {
134
+ /** Apply a prefix to the referenced value, i.e. 'Ⓜ️' = '--🌗-black': '--🌗-Ⓜ️-black' */
135
+ valuePrefix?: string;
136
+ }): Record<string, string>;
137
+ export declare function tokenSchemaToList(schema: TokenSchema): Token[];
138
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,OAAO,CAAC;AAEjC;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GACrB,OAAO,GACP,OAAO,GACP,cAAc,GACd,OAAO,GACP,SAAS,GACT,QAAQ,GACR,mBAAmB,GACnB,QAAQ,GACR,YAAY,GACZ,YAAY,GACZ,QAAQ,GACR,MAAM,GACN,oBAAoB,GACpB,gBAAgB,GAChB,KAAK,GACL,GAAG,CAAC;AAEP;;;GAGG;AACH,MAAM,MAAM,SAAS,GAClB,OAAO,GACP,WAAW,GACX,aAAa,GACb,aAAa,GACb,UAAU,GACV,cAAc,GACd,QAAQ,GACR,YAAY,GACZ,OAAO,GACP,KAAK,GACL,kBAAkB,CAAC;AAEtB,MAAM,MAAM,wBAAwB,GAAG;IACtC,WAAW,EACR;QACA,SAAS,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;QAC7C,OAAO,EAAE,MAAM,CAAC;KACf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
@@ -0,0 +1,105 @@
1
+ export const TOKEN_PREFIX = '--';
2
+ export function getTypeFromPurpose(purpose) {
3
+ switch (purpose) {
4
+ case 'color':
5
+ return 'color';
6
+ case 'font-size':
7
+ return 'length';
8
+ case 'font-weight':
9
+ return 'number';
10
+ case 'line-height':
11
+ return 'length-percentage';
12
+ case 'font-family':
13
+ return 'string';
14
+ case 'spacing':
15
+ return 'length';
16
+ case 'shadow':
17
+ return 'string';
18
+ default:
19
+ return '*';
20
+ }
21
+ }
22
+ const TOKEN_BRAND = '@@TOKEN@@';
23
+ export function createToken(name, { fallback, inherits = true, forceDefinition, purpose = 'other', type = getTypeFromPurpose(purpose), group, tag, }) {
24
+ const escapedName = name.replace('$', '');
25
+ const taggedName = tag ? `${tag}-${escapedName}` : escapedName;
26
+ const resolvedName = `${TOKEN_PREFIX}${taggedName}`;
27
+ return {
28
+ [TOKEN_BRAND]: true,
29
+ name: resolvedName,
30
+ type,
31
+ tag,
32
+ purpose,
33
+ group,
34
+ fallback,
35
+ var: `var(${resolvedName}${fallback ? `, ${fallback}` : ''})`,
36
+ varFallback: (fallbackOverride) => `var(${resolvedName}, ${fallbackOverride ?? fallback ?? 'initial'})`,
37
+ assign: (value) => `${resolvedName}: ${value ?? fallback};`,
38
+ get definition() {
39
+ if (inherits === false || forceDefinition) {
40
+ return `@property ${resolvedName} { syntax: '${type === '*' ? '*' : `<${type}>`}'; inherits: ${inherits}; initial-value: ${fallback ?? 'initial'}; }`;
41
+ }
42
+ return '';
43
+ },
44
+ suffixed: (suffix) => createToken(`${name}-${suffix}`, {
45
+ type,
46
+ fallback,
47
+ inherits,
48
+ tag,
49
+ }),
50
+ prefixed: (prefix) => createToken(`${prefix}-${name}`, {
51
+ type,
52
+ fallback,
53
+ inherits,
54
+ tag,
55
+ }),
56
+ };
57
+ }
58
+ export function isToken(value) {
59
+ return typeof value === 'object' && value !== null && TOKEN_BRAND in value;
60
+ }
61
+ /**
62
+ * Maps all token values to themselves - i.e.
63
+ * {
64
+ * '--🌗-black': 'var(--🌗-black)',
65
+ * ...
66
+ * }
67
+ */
68
+ export function selfReferencedProps(schema, { valuePrefix: prefix, } = {}) {
69
+ const result = {};
70
+ function walk(node) {
71
+ for (const key in node) {
72
+ const value = node[key];
73
+ if (isToken(value)) {
74
+ if (prefix) {
75
+ result[value.name] = value.prefixed(prefix).var;
76
+ }
77
+ else {
78
+ result[value.name] = value.var;
79
+ }
80
+ }
81
+ else if (typeof value === 'object') {
82
+ walk(value);
83
+ }
84
+ }
85
+ }
86
+ walk(schema);
87
+ return result;
88
+ }
89
+ export function tokenSchemaToList(schema) {
90
+ const result = [];
91
+ function walk(node) {
92
+ for (const key in node) {
93
+ const value = node[key];
94
+ if (isToken(value)) {
95
+ result.push(value);
96
+ }
97
+ else if (typeof value === 'object') {
98
+ walk(value);
99
+ }
100
+ }
101
+ }
102
+ walk(schema);
103
+ return result;
104
+ }
105
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AA+GjC,MAAM,UAAU,kBAAkB,CAAC,OAAqB;IACvD,QAAQ,OAAO,EAAE,CAAC;QACjB,KAAK,OAAO;YACX,OAAO,OAAO,CAAC;QAChB,KAAK,WAAW;YACf,OAAO,QAAQ,CAAC;QACjB,KAAK,aAAa;YACjB,OAAO,QAAQ,CAAC;QACjB,KAAK,aAAa;YACjB,OAAO,mBAAmB,CAAC;QAC5B,KAAK,aAAa;YACjB,OAAO,QAAQ,CAAC;QACjB,KAAK,SAAS;YACb,OAAO,QAAQ,CAAC;QACjB,KAAK,QAAQ;YACZ,OAAO,QAAQ,CAAC;QACjB;YACC,OAAO,GAAG,CAAC;IACb,CAAC;AACF,CAAC;AAED,MAAM,WAAW,GAAG,WAAW,CAAC;AAEhC,MAAM,UAAU,WAAW,CAC1B,IAAY,EACZ,EACC,QAAQ,E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MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;YACxB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;YACxB,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACpB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC;iBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;gBACtC,IAAI,CAAC,KAAK,CAAC,CAAC;YACb,CAAC;QACF,CAAC;IACF,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,CAAC;IACb,OAAO,MAAM,CAAC;AACf,CAAC"}
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@arbor-css/tokens",
3
+ "version": "0.0.1",
4
+ "type": "module",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "exports": {
9
+ ".": {
10
+ "development": "./src/index.ts",
11
+ "import": "./dist/index.js",
12
+ "node": "./dist/index.js",
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ }
16
+ },
17
+ "sideEffects": false,
18
+ "devDependencies": {
19
+ "@vitest/browser-playwright": "^4.1.5",
20
+ "typescript": "^6.0.3",
21
+ "vitest": "^4.1.5",
22
+ "vite": "^8.0.10"
23
+ },
24
+ "dependencies": {},
25
+ "scripts": {
26
+ "build": "tsc",
27
+ "dev": "tsc -w --preserveWatchOutput",
28
+ "test": "vitest",
29
+ "test:ci": "vitest --run"
30
+ }
31
+ }
package/src/index.ts ADDED
@@ -0,0 +1,258 @@
1
+ export const TOKEN_PREFIX = '--';
2
+
3
+ /**
4
+ * Allowed types of properties - specifying one allows defining
5
+ * a custom property in CSS which enables interpolation in animations
6
+ * and other optimizations.
7
+ *
8
+ * "*" doesn't really do much but does allow any kind of value.
9
+ *
10
+ * "computed" will not generate a property definition and is assumed
11
+ * to be a complex CSS property value like calc() or other things.
12
+ */
13
+ export type PropertyType =
14
+ | 'angle'
15
+ | 'color'
16
+ | 'custom-ident'
17
+ | 'image'
18
+ | 'integer'
19
+ | 'length'
20
+ | 'length-percentage'
21
+ | 'number'
22
+ | 'percentage'
23
+ | 'resolution'
24
+ | 'string'
25
+ | 'time'
26
+ | 'transform-function'
27
+ | 'transform-list'
28
+ | 'url'
29
+ | '*';
30
+
31
+ /**
32
+ * Roughly mapped / inspired by designtokens.org.
33
+ * Not currently used... but I wrote them down, so...
34
+ */
35
+ export type TokenType =
36
+ | 'color'
37
+ | 'dimension'
38
+ | 'font-family'
39
+ | 'font-weight'
40
+ | 'duration'
41
+ | 'cubic-bezier'
42
+ | 'number'
43
+ | 'font-style'
44
+ | 'ratio'
45
+ | 'url'
46
+ | TokenCompositeType;
47
+
48
+ export type TokenCompositeTypeShapes = {
49
+ strokeStyle:
50
+ | {
51
+ dashArray: { value: string; unit: string }[];
52
+ lineCap: string;
53
+ }
54
+ | string;
55
+ border: {
56
+ color: string;
57
+ width: string;
58
+ style: string;
59
+ };
60
+ transition: {
61
+ duration: string;
62
+ delay: string;
63
+ timingFunction: string;
64
+ };
65
+ shadow:
66
+ | {
67
+ offsetX: string;
68
+ offsetY: string;
69
+ blur: string;
70
+ spread: string;
71
+ color: string;
72
+ }
73
+ | {
74
+ offsetX: string;
75
+ offsetY: string;
76
+ blur: string;
77
+ spread: string;
78
+ color: string;
79
+ }[];
80
+ gradient: {
81
+ color: string;
82
+ position: string;
83
+ }[];
84
+ typography: {
85
+ fontFamily: string;
86
+ fontSize: string;
87
+ fontWeight: string;
88
+ letterSpacing: string;
89
+ lineHeight: string;
90
+ };
91
+ };
92
+ export type TokenCompositeType = keyof TokenCompositeTypeShapes;
93
+
94
+ export type TokenPurpose =
95
+ | 'color'
96
+ | 'font-size'
97
+ | 'font-weight'
98
+ | 'font-family'
99
+ | 'line-height'
100
+ | 'spacing'
101
+ | 'shadow'
102
+ | 'border-radius'
103
+ | 'border-width'
104
+ | 'shadow-x'
105
+ | 'shadow-y'
106
+ | 'shadow-blur'
107
+ | 'shadow-spread'
108
+ | 'shadow-color'
109
+ | 'size'
110
+ | 'other';
111
+
112
+ export function getTypeFromPurpose(purpose: TokenPurpose): PropertyType {
113
+ switch (purpose) {
114
+ case 'color':
115
+ return 'color';
116
+ case 'font-size':
117
+ return 'length';
118
+ case 'font-weight':
119
+ return 'number';
120
+ case 'line-height':
121
+ return 'length-percentage';
122
+ case 'font-family':
123
+ return 'string';
124
+ case 'spacing':
125
+ return 'length';
126
+ case 'shadow':
127
+ return 'string';
128
+ default:
129
+ return '*';
130
+ }
131
+ }
132
+
133
+ const TOKEN_BRAND = '@@TOKEN@@';
134
+
135
+ export function createToken(
136
+ name: string,
137
+ {
138
+ fallback,
139
+ inherits = true,
140
+ forceDefinition,
141
+ purpose = 'other',
142
+ type = getTypeFromPurpose(purpose),
143
+ group,
144
+ tag,
145
+ }: {
146
+ /** Inferred from purpose if not provided, defaults to "*" */
147
+ type?: PropertyType;
148
+ purpose?: TokenPurpose;
149
+ group?: string;
150
+ fallback?: string | number;
151
+ tag?: string;
152
+ inherits?: boolean;
153
+ /**
154
+ * Force the generation of a @property rule definition, even if it's not meaningful.
155
+ * Otherwise tokens whose properties have no special concerns like inherit:false will
156
+ * skip generating an @property
157
+ */
158
+ forceDefinition?: boolean;
159
+ },
160
+ ) {
161
+ const escapedName = name.replace('$', '');
162
+ const taggedName = tag ? `${tag}-${escapedName}` : escapedName;
163
+ const resolvedName = `${TOKEN_PREFIX}${taggedName}`;
164
+ return {
165
+ [TOKEN_BRAND]: true as const,
166
+ name: resolvedName,
167
+ type,
168
+ tag,
169
+ purpose,
170
+ group,
171
+ fallback,
172
+ var: `var(${resolvedName}${fallback ? `, ${fallback}` : ''})`,
173
+ varFallback: (fallbackOverride?: string | number) =>
174
+ `var(${resolvedName}, ${fallbackOverride ?? fallback ?? 'initial'})`,
175
+ assign: (value?: string | number) =>
176
+ `${resolvedName}: ${value ?? fallback};`,
177
+ get definition() {
178
+ if (inherits === false || forceDefinition) {
179
+ return `@property ${resolvedName} { syntax: '${type === '*' ? '*' : `<${type}>`}'; inherits: ${inherits}; initial-value: ${fallback ?? 'initial'}; }`;
180
+ }
181
+ return '';
182
+ },
183
+ suffixed: (suffix: string) =>
184
+ createToken(`${name}-${suffix}`, {
185
+ type,
186
+ fallback,
187
+ inherits,
188
+ tag,
189
+ }),
190
+ prefixed: (prefix: string) =>
191
+ createToken(`${prefix}-${name}`, {
192
+ type,
193
+ fallback,
194
+ inherits,
195
+ tag,
196
+ }),
197
+ };
198
+ }
199
+
200
+ export type Token = ReturnType<typeof createToken>;
201
+ export type TokenSchema = {
202
+ [Key: string]: Token | TokenSchema;
203
+ };
204
+
205
+ export function isToken(value: any): value is ReturnType<typeof createToken> {
206
+ return typeof value === 'object' && value !== null && TOKEN_BRAND in value;
207
+ }
208
+
209
+ /**
210
+ * Maps all token values to themselves - i.e.
211
+ * {
212
+ * '--🌗-black': 'var(--🌗-black)',
213
+ * ...
214
+ * }
215
+ */
216
+ export function selfReferencedProps(
217
+ schema: TokenSchema,
218
+ {
219
+ valuePrefix: prefix,
220
+ }: {
221
+ /** Apply a prefix to the referenced value, i.e. 'Ⓜ️' = '--🌗-black': '--🌗-Ⓜ️-black' */
222
+ valuePrefix?: string;
223
+ } = {},
224
+ ): Record<string, string> {
225
+ const result: Record<string, string> = {};
226
+ function walk(node: Record<string, any>) {
227
+ for (const key in node) {
228
+ const value = node[key];
229
+ if (isToken(value)) {
230
+ if (prefix) {
231
+ result[value.name] = value.prefixed(prefix).var;
232
+ } else {
233
+ result[value.name] = value.var;
234
+ }
235
+ } else if (typeof value === 'object') {
236
+ walk(value);
237
+ }
238
+ }
239
+ }
240
+ walk(schema);
241
+ return result;
242
+ }
243
+
244
+ export function tokenSchemaToList(schema: TokenSchema): Token[] {
245
+ const result: Token[] = [];
246
+ function walk(node: Record<string, any>) {
247
+ for (const key in node) {
248
+ const value = node[key];
249
+ if (isToken(value)) {
250
+ result.push(value);
251
+ } else if (typeof value === 'object') {
252
+ walk(value);
253
+ }
254
+ }
255
+ }
256
+ walk(schema);
257
+ return result;
258
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "rootDir": "src"
6
+ },
7
+ "include": ["src"],
8
+ "references": []
9
+ }
@@ -0,0 +1 @@
1
+ {"fileNames":["../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.collection.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.float16.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.intl.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.promise.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.date.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.error.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/.pnpm/typescript@6.0.3/node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/index.ts"],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"3a5b4ad9db45af570b64048494b0a204e7384c95cdff7de2da2213c9d2ec72a2","signature":"8457eec87255b9ab29c87d69055f3a0a624bf00246c9fc8f439521cf734381bf","impliedFormat":99}],"root":[89],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":199,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7},"latestChangedDtsFile":"./dist/index.d.ts","version":"6.0.3"}
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vitest/config';
2
+
3
+ export default defineConfig({
4
+ test: {
5
+ include: ['src/**/*.test.ts'],
6
+ },
7
+ });