@zedtech/zedkit-core 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +41 -2
- package/dist/ids.d.ts +5 -0
- package/dist/ids.d.ts.map +1 -0
- package/dist/ids.js +23 -0
- package/dist/ids.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/result.d.ts +20 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +25 -0
- package/dist/result.js.map +1 -0
- package/dist/try-catch.d.ts +5 -0
- package/dist/try-catch.d.ts.map +1 -0
- package/dist/try-catch.js +28 -0
- package/dist/try-catch.js.map +1 -0
- package/package.json +42 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zedtech-fr
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @zedtech/zedkit-core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Foundational helpers with a stable public surface. Original work by the
|
|
4
|
+
same author.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
pnpm add @zedtech/zedkit-core
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { tryCatch } from "@zedtech/zedkit-core";
|
|
12
|
+
|
|
13
|
+
const parsed = tryCatch(() => JSON.parse(input));
|
|
14
|
+
if (!parsed.ok) return fallback(parsed.error);
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
- `Result<T, E = Error>` — `{ ok: true, value: T } | { ok: false, error: E }`
|
|
20
|
+
- `ok(value)`, `err(error)`, `isOk(result)`, `isErr(result)`
|
|
21
|
+
- `mapResult(result, fn)`, `unwrapOr(result, fallback)`
|
|
22
|
+
- `tryCatch(fn)`, `tryCatchAsync(fn)` — never swallow; non-`Error` throws
|
|
23
|
+
become `Error` with `cause` set. Raw `try`/`catch` stays banned
|
|
24
|
+
everywhere else.
|
|
25
|
+
- `newPrefixedId(prefix)`, `isPrefixedId(id, prefix)` — `"<prefix>_<ulid>"`
|
|
26
|
+
IDs via a thin wrapper over the `ulid` package (see the
|
|
27
|
+
[golden rule](../../docs/golden-rule.md)).
|
|
28
|
+
|
|
29
|
+
Find helpers by need in [CATALOG.md](CATALOG.md).
|
|
30
|
+
|
|
31
|
+
## Install or copy?
|
|
32
|
+
|
|
33
|
+
`result` and `try-catch` are tiny and dependency-free: source-copying the
|
|
34
|
+
two files is a sane alternative to installing (MIT allows it). Install
|
|
35
|
+
the package when you also want `ids` (which needs the `ulid`
|
|
36
|
+
dependency) or versioned updates.
|
|
37
|
+
|
|
38
|
+
## Verify
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
pnpm --filter @zedtech/zedkit-core typecheck && pnpm --filter @zedtech/zedkit-core lint && pnpm --filter @zedtech/zedkit-core build && pnpm --filter @zedtech/zedkit-core test
|
|
42
|
+
```
|
package/dist/ids.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** `"<prefix>_<ulid>"`, e.g. `order_01M5Q75SHJ9CVV6E3RBF0FGEM1`. */
|
|
2
|
+
export declare function newPrefixedId(prefix: string): string;
|
|
3
|
+
/** True when `id` is a `newPrefixedId(prefix)` output (shape-checked). */
|
|
4
|
+
export declare function isPrefixedId(id: string, prefix: string): boolean;
|
|
5
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAYA,oEAAoE;AACpE,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAMhE"}
|
package/dist/ids.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Thin wrapper over the mature `ulid` package (see the golden rule):
|
|
2
|
+
// prefixed, greppable, unconfusable unique IDs.
|
|
3
|
+
import { ulid } from "ulid";
|
|
4
|
+
function assertPrefix(prefix) {
|
|
5
|
+
if (prefix.length === 0 || prefix.includes("_")) {
|
|
6
|
+
throw new Error(`invalid id prefix ${JSON.stringify(prefix)}: expected a non-empty string without "_"`);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
/** `"<prefix>_<ulid>"`, e.g. `order_01M5Q75SHJ9CVV6E3RBF0FGEM1`. */
|
|
10
|
+
export function newPrefixedId(prefix) {
|
|
11
|
+
assertPrefix(prefix);
|
|
12
|
+
return `${prefix}_${ulid()}`;
|
|
13
|
+
}
|
|
14
|
+
/** True when `id` is a `newPrefixedId(prefix)` output (shape-checked). */
|
|
15
|
+
export function isPrefixedId(id, prefix) {
|
|
16
|
+
assertPrefix(prefix);
|
|
17
|
+
const head = `${prefix}_`;
|
|
18
|
+
if (!id.startsWith(head))
|
|
19
|
+
return false;
|
|
20
|
+
const raw = id.slice(head.length);
|
|
21
|
+
return raw.length === 26 && /^[0-9A-HJKMNP-TV-Z]{26}$/.test(raw);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ids.js.map
|
package/dist/ids.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.js","sourceRoot":"","sources":["../src/ids.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,gDAAgD;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,SAAS,YAAY,CAAC,MAAc;IAClC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,qBAAqB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,2CAA2C,CACvF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,aAAa,CAAC,MAAc;IAC1C,YAAY,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,GAAG,MAAM,IAAI,IAAI,EAAE,EAAE,CAAC;AAC/B,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,YAAY,CAAC,EAAU,EAAE,MAAc;IACrD,YAAY,CAAC,MAAM,CAAC,CAAC;IACrB,MAAM,IAAI,GAAG,GAAG,MAAM,GAAG,CAAC;IAC1B,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,MAAM,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,GAAG,CAAC,MAAM,KAAK,EAAE,IAAI,0BAA0B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnE,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/result.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type Result<T, E = Error> = {
|
|
2
|
+
ok: true;
|
|
3
|
+
value: T;
|
|
4
|
+
} | {
|
|
5
|
+
ok: false;
|
|
6
|
+
error: E;
|
|
7
|
+
};
|
|
8
|
+
export declare function ok<T>(value: T): Result<T, never>;
|
|
9
|
+
export declare function err<E>(error: E): Result<never, E>;
|
|
10
|
+
export declare function isOk<T, E>(result: Result<T, E>): result is {
|
|
11
|
+
ok: true;
|
|
12
|
+
value: T;
|
|
13
|
+
};
|
|
14
|
+
export declare function isErr<T, E>(result: Result<T, E>): result is {
|
|
15
|
+
ok: false;
|
|
16
|
+
error: E;
|
|
17
|
+
};
|
|
18
|
+
export declare function mapResult<T, U, E>(result: Result<T, E>, fn: (value: T) => U): Result<U, E>;
|
|
19
|
+
export declare function unwrapOr<T, E>(result: Result<T, E>, fallback: T): T;
|
|
20
|
+
//# sourceMappingURL=result.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.d.ts","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,IAC3B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,GACtB;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAAC;AAE5B,wBAAgB,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAEhD;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAEjD;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAEjF;AAED,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,MAAM,IAAI;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAEnF;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAC/B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EACpB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAClB,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAKd;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAKnE"}
|
package/dist/result.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function ok(value) {
|
|
2
|
+
return { ok: true, value };
|
|
3
|
+
}
|
|
4
|
+
export function err(error) {
|
|
5
|
+
return { ok: false, error };
|
|
6
|
+
}
|
|
7
|
+
export function isOk(result) {
|
|
8
|
+
return result.ok;
|
|
9
|
+
}
|
|
10
|
+
export function isErr(result) {
|
|
11
|
+
return !result.ok;
|
|
12
|
+
}
|
|
13
|
+
export function mapResult(result, fn) {
|
|
14
|
+
if (!result.ok) {
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
return ok(fn(result.value));
|
|
18
|
+
}
|
|
19
|
+
export function unwrapOr(result, fallback) {
|
|
20
|
+
if (result.ok) {
|
|
21
|
+
return result.value;
|
|
22
|
+
}
|
|
23
|
+
return fallback;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../src/result.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,EAAE,CAAI,KAAQ;IAC5B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,GAAG,CAAI,KAAQ;IAC7B,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,IAAI,CAAO,MAAoB;IAC7C,OAAO,MAAM,CAAC,EAAE,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,KAAK,CAAO,MAAoB;IAC9C,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;AACpB,CAAC;AAED,MAAM,UAAU,SAAS,CACvB,MAAoB,EACpB,EAAmB;IAEnB,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,QAAQ,CAAO,MAAoB,EAAE,QAAW;IAC9D,IAAI,MAAM,CAAC,EAAE,EAAE,CAAC;QACd,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Result } from "./result.js";
|
|
2
|
+
export declare function normalizeThrown(thrown: unknown): Error;
|
|
3
|
+
export declare function tryCatch<T>(fn: () => T): Result<T, Error>;
|
|
4
|
+
export declare function tryCatchAsync<T>(fn: () => Promise<T>): Promise<Result<T, Error>>;
|
|
5
|
+
//# sourceMappingURL=try-catch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"try-catch.d.ts","sourceRoot":"","sources":["../src/try-catch.ts"],"names":[],"mappings":"AAGA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAEnD,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,CAQtD;AAED,wBAAgB,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAMzD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAKhF"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// Original work by the same author.
|
|
2
|
+
// This file is the ONE documented exception to the TryStatement lint ban:
|
|
3
|
+
// it implements the wrappers everything else must use.
|
|
4
|
+
import { err, ok } from "./result.js";
|
|
5
|
+
export function normalizeThrown(thrown) {
|
|
6
|
+
if (thrown instanceof Error) {
|
|
7
|
+
return thrown;
|
|
8
|
+
}
|
|
9
|
+
const message = typeof thrown === "string" ? thrown : String(thrown);
|
|
10
|
+
const wrapped = new Error(message);
|
|
11
|
+
wrapped.cause = thrown;
|
|
12
|
+
return wrapped;
|
|
13
|
+
}
|
|
14
|
+
export function tryCatch(fn) {
|
|
15
|
+
try {
|
|
16
|
+
return ok(fn());
|
|
17
|
+
}
|
|
18
|
+
catch (thrown) {
|
|
19
|
+
return err(normalizeThrown(thrown));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export function tryCatchAsync(fn) {
|
|
23
|
+
return Promise.resolve()
|
|
24
|
+
.then(() => fn())
|
|
25
|
+
.then((value) => ok(value))
|
|
26
|
+
.catch((thrown) => err(normalizeThrown(thrown)));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=try-catch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"try-catch.js","sourceRoot":"","sources":["../src/try-catch.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,0EAA0E;AAC1E,uDAAuD;AACvD,OAAO,EAAE,GAAG,EAAE,EAAE,EAAe,MAAM,aAAa,CAAC;AAEnD,MAAM,UAAU,eAAe,CAAC,MAAe;IAC7C,IAAI,MAAM,YAAY,KAAK,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,OAAO,GAAG,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC;IACvB,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,QAAQ,CAAI,EAAW;IACrC,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,MAAM,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IACtC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,aAAa,CAAI,EAAoB;IACnD,OAAO,OAAO,CAAC,OAAO,EAAE;SACrB,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;SAChB,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;SAC1B,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zedtech/zedkit-core",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public",
|
|
6
|
+
"registry": "https://registry.npmjs.org/"
|
|
7
|
+
},
|
|
8
|
+
"description": "Foundational helpers: Result, tryCatch, prefixed IDs. Original work by the same author.",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/zedtech-fr/zedkit",
|
|
13
|
+
"directory": "packages/core"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"sideEffects": false,
|
|
17
|
+
"imports": {
|
|
18
|
+
"#*": "./src/*"
|
|
19
|
+
},
|
|
20
|
+
"main": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./package.json": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"ulid": "3.0.2"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"typescript": "5.9.3",
|
|
37
|
+
"vitest": "2.1.9"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc -p tsconfig.json",
|
|
41
|
+
"test": "vitest run",
|
|
42
|
+
"typecheck": "tsc --noEmit -p tsconfig.tests.json",
|
|
43
|
+
"lint": "eslint src tests"
|
|
44
|
+
}
|
|
6
45
|
}
|