@awsless/validate 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.
- package/dist/index.cjs +228 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +194 -0
- package/package.json +40 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
Struct: () => import_superstruct7.Struct,
|
|
24
|
+
StructError: () => import_superstruct7.StructError,
|
|
25
|
+
any: () => import_superstruct7.any,
|
|
26
|
+
array: () => import_superstruct7.array,
|
|
27
|
+
assert: () => import_superstruct7.assert,
|
|
28
|
+
assign: () => import_superstruct7.assign,
|
|
29
|
+
bigfloat: () => bigfloat,
|
|
30
|
+
bigint: () => import_superstruct7.bigint,
|
|
31
|
+
boolean: () => import_superstruct7.boolean,
|
|
32
|
+
coerce: () => import_superstruct7.coerce,
|
|
33
|
+
create: () => import_superstruct7.create,
|
|
34
|
+
date: () => date,
|
|
35
|
+
defaulted: () => import_superstruct7.defaulted,
|
|
36
|
+
define: () => import_superstruct7.define,
|
|
37
|
+
deprecated: () => import_superstruct7.deprecated,
|
|
38
|
+
dynamic: () => import_superstruct7.dynamic,
|
|
39
|
+
empty: () => import_superstruct7.empty,
|
|
40
|
+
enums: () => import_superstruct7.enums,
|
|
41
|
+
func: () => import_superstruct7.func,
|
|
42
|
+
instance: () => import_superstruct7.instance,
|
|
43
|
+
integer: () => import_superstruct7.integer,
|
|
44
|
+
intersection: () => import_superstruct7.intersection,
|
|
45
|
+
is: () => import_superstruct7.is,
|
|
46
|
+
json: () => json,
|
|
47
|
+
lazy: () => import_superstruct7.lazy,
|
|
48
|
+
literal: () => import_superstruct7.literal,
|
|
49
|
+
lowercase: () => lowercase,
|
|
50
|
+
map: () => import_superstruct7.map,
|
|
51
|
+
mask: () => import_superstruct7.mask,
|
|
52
|
+
max: () => import_superstruct7.max,
|
|
53
|
+
min: () => import_superstruct7.min,
|
|
54
|
+
never: () => import_superstruct7.never,
|
|
55
|
+
nonempty: () => import_superstruct7.nonempty,
|
|
56
|
+
nullable: () => import_superstruct7.nullable,
|
|
57
|
+
number: () => import_superstruct7.number,
|
|
58
|
+
object: () => import_superstruct7.object,
|
|
59
|
+
omit: () => import_superstruct7.omit,
|
|
60
|
+
optional: () => import_superstruct7.optional,
|
|
61
|
+
partial: () => import_superstruct7.partial,
|
|
62
|
+
pattern: () => import_superstruct7.pattern,
|
|
63
|
+
pick: () => import_superstruct7.pick,
|
|
64
|
+
positive: () => positive,
|
|
65
|
+
precision: () => precision,
|
|
66
|
+
record: () => import_superstruct7.record,
|
|
67
|
+
refine: () => import_superstruct7.refine,
|
|
68
|
+
regexp: () => import_superstruct7.regexp,
|
|
69
|
+
set: () => import_superstruct7.set,
|
|
70
|
+
size: () => import_superstruct7.size,
|
|
71
|
+
string: () => import_superstruct7.string,
|
|
72
|
+
struct: () => import_superstruct7.struct,
|
|
73
|
+
trimmed: () => import_superstruct7.trimmed,
|
|
74
|
+
tuple: () => import_superstruct7.tuple,
|
|
75
|
+
type: () => import_superstruct7.type,
|
|
76
|
+
union: () => import_superstruct7.union,
|
|
77
|
+
unique: () => unique,
|
|
78
|
+
unknown: () => import_superstruct7.unknown,
|
|
79
|
+
uppercase: () => uppercase,
|
|
80
|
+
uuid: () => uuid
|
|
81
|
+
});
|
|
82
|
+
module.exports = __toCommonJS(src_exports);
|
|
83
|
+
|
|
84
|
+
// src/types/bigfloat.ts
|
|
85
|
+
var import_superstruct = require("superstruct");
|
|
86
|
+
var import_big_float = require("@awsless/big-float");
|
|
87
|
+
var bigfloat = () => {
|
|
88
|
+
const base = (0, import_superstruct.define)("bigfloat", (value) => {
|
|
89
|
+
return value instanceof import_big_float.BigFloat || "Invalid number";
|
|
90
|
+
});
|
|
91
|
+
return (0, import_superstruct.coerce)(base, (0, import_superstruct.union)([(0, import_superstruct.string)(), (0, import_superstruct.number)()]), (value) => {
|
|
92
|
+
if (typeof value === "string" && value !== "" || typeof value === "number") {
|
|
93
|
+
if (!isNaN(Number(value))) {
|
|
94
|
+
return new import_big_float.BigFloat(value);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return null;
|
|
98
|
+
});
|
|
99
|
+
};
|
|
100
|
+
var positive = (struct2) => {
|
|
101
|
+
const expected = `Expected a positive ${struct2.type}`;
|
|
102
|
+
const zero = new import_big_float.BigFloat(0);
|
|
103
|
+
return (0, import_superstruct.refine)(struct2, "positive", (value) => {
|
|
104
|
+
return (0, import_big_float.gt)(value, zero) || `${expected} but received '${value}'`;
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
var precision = (struct2, decimals) => {
|
|
108
|
+
const expected = `Expected a ${struct2.type}`;
|
|
109
|
+
return (0, import_superstruct.refine)(struct2, "precision", (value) => {
|
|
110
|
+
return -value.exponent <= decimals || `${expected} with ${decimals} decimals`;
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
// src/types/date.ts
|
|
115
|
+
var import_superstruct2 = require("superstruct");
|
|
116
|
+
var date = () => {
|
|
117
|
+
return (0, import_superstruct2.coerce)((0, import_superstruct2.date)(), (0, import_superstruct2.string)(), (value) => {
|
|
118
|
+
return new Date(value);
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// src/types/uuid.ts
|
|
123
|
+
var import_superstruct3 = require("superstruct");
|
|
124
|
+
var uuid = () => {
|
|
125
|
+
return (0, import_superstruct3.define)("uuid", (value) => {
|
|
126
|
+
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(String(value));
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// src/types/json.ts
|
|
131
|
+
var import_superstruct4 = require("superstruct");
|
|
132
|
+
var json = (struct2) => {
|
|
133
|
+
return (0, import_superstruct4.coerce)(struct2, (0, import_superstruct4.string)(), (value) => {
|
|
134
|
+
try {
|
|
135
|
+
return JSON.parse(value);
|
|
136
|
+
} catch (error) {
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// src/types/string.ts
|
|
143
|
+
var import_superstruct5 = require("superstruct");
|
|
144
|
+
var lowercase = (struct2) => {
|
|
145
|
+
return (0, import_superstruct5.coerce)(struct2, (0, import_superstruct5.string)(), (value) => value.toLowerCase());
|
|
146
|
+
};
|
|
147
|
+
var uppercase = (struct2) => {
|
|
148
|
+
return (0, import_superstruct5.coerce)(struct2, (0, import_superstruct5.string)(), (value) => value.toUpperCase());
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// src/types/array.ts
|
|
152
|
+
var import_superstruct6 = require("superstruct");
|
|
153
|
+
function unique(struct2, compare = (a, b) => a === b) {
|
|
154
|
+
return (0, import_superstruct6.refine)(struct2, "unique", (value) => {
|
|
155
|
+
for (const x in value) {
|
|
156
|
+
for (const y in value) {
|
|
157
|
+
if (x !== y && compare(value[x], value[y])) {
|
|
158
|
+
return `Expected a ${struct2.type} with unique values, but received "${value}"`;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return true;
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// src/index.ts
|
|
167
|
+
var import_superstruct7 = require("superstruct");
|
|
168
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
169
|
+
0 && (module.exports = {
|
|
170
|
+
Struct,
|
|
171
|
+
StructError,
|
|
172
|
+
any,
|
|
173
|
+
array,
|
|
174
|
+
assert,
|
|
175
|
+
assign,
|
|
176
|
+
bigfloat,
|
|
177
|
+
bigint,
|
|
178
|
+
boolean,
|
|
179
|
+
coerce,
|
|
180
|
+
create,
|
|
181
|
+
date,
|
|
182
|
+
defaulted,
|
|
183
|
+
define,
|
|
184
|
+
deprecated,
|
|
185
|
+
dynamic,
|
|
186
|
+
empty,
|
|
187
|
+
enums,
|
|
188
|
+
func,
|
|
189
|
+
instance,
|
|
190
|
+
integer,
|
|
191
|
+
intersection,
|
|
192
|
+
is,
|
|
193
|
+
json,
|
|
194
|
+
lazy,
|
|
195
|
+
literal,
|
|
196
|
+
lowercase,
|
|
197
|
+
map,
|
|
198
|
+
mask,
|
|
199
|
+
max,
|
|
200
|
+
min,
|
|
201
|
+
never,
|
|
202
|
+
nonempty,
|
|
203
|
+
nullable,
|
|
204
|
+
number,
|
|
205
|
+
object,
|
|
206
|
+
omit,
|
|
207
|
+
optional,
|
|
208
|
+
partial,
|
|
209
|
+
pattern,
|
|
210
|
+
pick,
|
|
211
|
+
positive,
|
|
212
|
+
precision,
|
|
213
|
+
record,
|
|
214
|
+
refine,
|
|
215
|
+
regexp,
|
|
216
|
+
set,
|
|
217
|
+
size,
|
|
218
|
+
string,
|
|
219
|
+
struct,
|
|
220
|
+
trimmed,
|
|
221
|
+
tuple,
|
|
222
|
+
type,
|
|
223
|
+
union,
|
|
224
|
+
unique,
|
|
225
|
+
unknown,
|
|
226
|
+
uppercase,
|
|
227
|
+
uuid
|
|
228
|
+
});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Struct } from 'superstruct';
|
|
2
|
+
export { Coercer, Context, Describe, Failure, Infer, Refiner, Result, Struct, StructError, Validator, any, array, assert, assign, bigint, boolean, coerce, create, defaulted, define, deprecated, dynamic, empty, enums, func, instance, integer, intersection, is, lazy, literal, map, mask, max, min, never, nonempty, nullable, number, object, omit, optional, partial, pattern, pick, record, refine, regexp, set, size, string, struct, trimmed, tuple, type, union, unknown } from 'superstruct';
|
|
3
|
+
import { BigFloat } from '@awsless/big-float';
|
|
4
|
+
|
|
5
|
+
declare const bigfloat: () => Struct<BigFloat, null>;
|
|
6
|
+
declare const positive: <T extends BigFloat, S extends unknown>(struct: Struct<T, S>) => Struct<T, S>;
|
|
7
|
+
declare const precision: <T extends BigFloat, S extends unknown>(struct: Struct<T, S>, decimals: number) => Struct<T, S>;
|
|
8
|
+
|
|
9
|
+
declare const date: () => Struct<Date, null>;
|
|
10
|
+
|
|
11
|
+
declare const uuid: () => Struct<string, null>;
|
|
12
|
+
|
|
13
|
+
declare const json: <T, S>(struct: Struct<T, S>) => Struct<T, S>;
|
|
14
|
+
|
|
15
|
+
declare const lowercase: <T, S>(struct: Struct<T, S>) => Struct<T, S>;
|
|
16
|
+
declare const uppercase: <T, S>(struct: Struct<T, S>) => Struct<T, S>;
|
|
17
|
+
|
|
18
|
+
declare function unique<T extends any[], S extends any>(struct: Struct<T, S>, compare?: (a: T[number], b: T[number]) => boolean): Struct<T, S>;
|
|
19
|
+
|
|
20
|
+
export { bigfloat, date, json, lowercase, positive, precision, unique, uppercase, uuid };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
// src/types/bigfloat.ts
|
|
2
|
+
import { coerce, define, number, string, union, refine } from "superstruct";
|
|
3
|
+
import { BigFloat, gt } from "@awsless/big-float";
|
|
4
|
+
var bigfloat = () => {
|
|
5
|
+
const base = define("bigfloat", (value) => {
|
|
6
|
+
return value instanceof BigFloat || "Invalid number";
|
|
7
|
+
});
|
|
8
|
+
return coerce(base, union([string(), number()]), (value) => {
|
|
9
|
+
if (typeof value === "string" && value !== "" || typeof value === "number") {
|
|
10
|
+
if (!isNaN(Number(value))) {
|
|
11
|
+
return new BigFloat(value);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var positive = (struct2) => {
|
|
18
|
+
const expected = `Expected a positive ${struct2.type}`;
|
|
19
|
+
const zero = new BigFloat(0);
|
|
20
|
+
return refine(struct2, "positive", (value) => {
|
|
21
|
+
return gt(value, zero) || `${expected} but received '${value}'`;
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
var precision = (struct2, decimals) => {
|
|
25
|
+
const expected = `Expected a ${struct2.type}`;
|
|
26
|
+
return refine(struct2, "precision", (value) => {
|
|
27
|
+
return -value.exponent <= decimals || `${expected} with ${decimals} decimals`;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/types/date.ts
|
|
32
|
+
import { coerce as coerce2, date as sdate, string as string2 } from "superstruct";
|
|
33
|
+
var date = () => {
|
|
34
|
+
return coerce2(sdate(), string2(), (value) => {
|
|
35
|
+
return new Date(value);
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/types/uuid.ts
|
|
40
|
+
import { define as define2 } from "superstruct";
|
|
41
|
+
var uuid = () => {
|
|
42
|
+
return define2("uuid", (value) => {
|
|
43
|
+
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(String(value));
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// src/types/json.ts
|
|
48
|
+
import { coerce as coerce3, string as string3 } from "superstruct";
|
|
49
|
+
var json = (struct2) => {
|
|
50
|
+
return coerce3(struct2, string3(), (value) => {
|
|
51
|
+
try {
|
|
52
|
+
return JSON.parse(value);
|
|
53
|
+
} catch (error) {
|
|
54
|
+
return value;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/types/string.ts
|
|
60
|
+
import { coerce as coerce4, string as string4 } from "superstruct";
|
|
61
|
+
var lowercase = (struct2) => {
|
|
62
|
+
return coerce4(struct2, string4(), (value) => value.toLowerCase());
|
|
63
|
+
};
|
|
64
|
+
var uppercase = (struct2) => {
|
|
65
|
+
return coerce4(struct2, string4(), (value) => value.toUpperCase());
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// src/types/array.ts
|
|
69
|
+
import { refine as refine2 } from "superstruct";
|
|
70
|
+
function unique(struct2, compare = (a, b) => a === b) {
|
|
71
|
+
return refine2(struct2, "unique", (value) => {
|
|
72
|
+
for (const x in value) {
|
|
73
|
+
for (const y in value) {
|
|
74
|
+
if (x !== y && compare(value[x], value[y])) {
|
|
75
|
+
return `Expected a ${struct2.type} with unique values, but received "${value}"`;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// src/index.ts
|
|
84
|
+
import {
|
|
85
|
+
coerce as coerce5,
|
|
86
|
+
defaulted,
|
|
87
|
+
trimmed,
|
|
88
|
+
empty,
|
|
89
|
+
max,
|
|
90
|
+
min,
|
|
91
|
+
nonempty,
|
|
92
|
+
pattern,
|
|
93
|
+
size,
|
|
94
|
+
refine as refine3,
|
|
95
|
+
any,
|
|
96
|
+
array,
|
|
97
|
+
bigint,
|
|
98
|
+
boolean,
|
|
99
|
+
enums,
|
|
100
|
+
func,
|
|
101
|
+
instance,
|
|
102
|
+
integer,
|
|
103
|
+
intersection,
|
|
104
|
+
literal,
|
|
105
|
+
map,
|
|
106
|
+
never,
|
|
107
|
+
nullable,
|
|
108
|
+
number as number2,
|
|
109
|
+
object,
|
|
110
|
+
optional,
|
|
111
|
+
record,
|
|
112
|
+
regexp,
|
|
113
|
+
set,
|
|
114
|
+
string as string5,
|
|
115
|
+
tuple,
|
|
116
|
+
type,
|
|
117
|
+
union as union2,
|
|
118
|
+
unknown,
|
|
119
|
+
assign,
|
|
120
|
+
define as define3,
|
|
121
|
+
deprecated,
|
|
122
|
+
dynamic,
|
|
123
|
+
lazy,
|
|
124
|
+
omit,
|
|
125
|
+
partial,
|
|
126
|
+
pick,
|
|
127
|
+
struct,
|
|
128
|
+
assert,
|
|
129
|
+
create,
|
|
130
|
+
mask,
|
|
131
|
+
is,
|
|
132
|
+
Struct as Struct7,
|
|
133
|
+
StructError
|
|
134
|
+
} from "superstruct";
|
|
135
|
+
export {
|
|
136
|
+
Struct7 as Struct,
|
|
137
|
+
StructError,
|
|
138
|
+
any,
|
|
139
|
+
array,
|
|
140
|
+
assert,
|
|
141
|
+
assign,
|
|
142
|
+
bigfloat,
|
|
143
|
+
bigint,
|
|
144
|
+
boolean,
|
|
145
|
+
coerce5 as coerce,
|
|
146
|
+
create,
|
|
147
|
+
date,
|
|
148
|
+
defaulted,
|
|
149
|
+
define3 as define,
|
|
150
|
+
deprecated,
|
|
151
|
+
dynamic,
|
|
152
|
+
empty,
|
|
153
|
+
enums,
|
|
154
|
+
func,
|
|
155
|
+
instance,
|
|
156
|
+
integer,
|
|
157
|
+
intersection,
|
|
158
|
+
is,
|
|
159
|
+
json,
|
|
160
|
+
lazy,
|
|
161
|
+
literal,
|
|
162
|
+
lowercase,
|
|
163
|
+
map,
|
|
164
|
+
mask,
|
|
165
|
+
max,
|
|
166
|
+
min,
|
|
167
|
+
never,
|
|
168
|
+
nonempty,
|
|
169
|
+
nullable,
|
|
170
|
+
number2 as number,
|
|
171
|
+
object,
|
|
172
|
+
omit,
|
|
173
|
+
optional,
|
|
174
|
+
partial,
|
|
175
|
+
pattern,
|
|
176
|
+
pick,
|
|
177
|
+
positive,
|
|
178
|
+
precision,
|
|
179
|
+
record,
|
|
180
|
+
refine3 as refine,
|
|
181
|
+
regexp,
|
|
182
|
+
set,
|
|
183
|
+
size,
|
|
184
|
+
string5 as string,
|
|
185
|
+
struct,
|
|
186
|
+
trimmed,
|
|
187
|
+
tuple,
|
|
188
|
+
type,
|
|
189
|
+
union2 as union,
|
|
190
|
+
unique,
|
|
191
|
+
unknown,
|
|
192
|
+
uppercase,
|
|
193
|
+
uuid
|
|
194
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@awsless/validate",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/awsless/awsless.git"
|
|
9
|
+
},
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/awsless/awsless/issues"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"main": "./dist/index.cjs",
|
|
17
|
+
"module": "./dist/index.js",
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"require": "./dist/index.cjs",
|
|
22
|
+
"import": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@awsless/big-float": "^0.0.1"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@awsless/big-float": "^0.0.1"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"superstruct": "^1.0.3"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"test": "pnpm code test",
|
|
37
|
+
"build": "pnpm tsup src/index.ts --format cjs,esm --dts --clean",
|
|
38
|
+
"prepublish": "pnpm build"
|
|
39
|
+
}
|
|
40
|
+
}
|