umsizi 0.1.0 → 0.2.2
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/README.md +40 -0
- package/dist/index-DtjbEW43.d.ts +19 -0
- package/dist/index-dktuz4mv.d.ts +22 -0
- package/dist/index-rZiv1o95.d.ts +23 -0
- package/dist/index.d.ts +15 -3
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/dist/next-C3wp7UoQ.js +29 -0
- package/dist/next-C3wp7UoQ.js.map +1 -0
- package/dist/next.d.ts +1 -1
- package/dist/next.js +1 -1
- package/dist/node-D-nlzpmG.js +23 -0
- package/dist/node-D-nlzpmG.js.map +1 -0
- package/dist/node.d.ts +1 -1
- package/dist/node.js +1 -1
- package/dist/react-BCidSnzT.js +25 -0
- package/dist/react-BCidSnzT.js.map +1 -0
- package/dist/react.d.ts +1 -1
- package/dist/react.js +1 -1
- package/package.json +109 -84
- package/dist/index-Bi-DJKKn.d.ts +0 -5
- package/dist/index-Cfup-UnB.d.ts +0 -5
- package/dist/index-uHJbGgdS.d.ts +0 -5
- package/dist/next-B9pvCR1P.js +0 -11
- package/dist/next-B9pvCR1P.js.map +0 -1
- package/dist/node-Di-uva1n.js +0 -9
- package/dist/node-Di-uva1n.js.map +0 -1
- package/dist/react-DPRQiKYh.js +0 -8
- package/dist/react-DPRQiKYh.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Umsizi
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/umsizi)
|
|
4
|
+
[](https://github.com/Jack-WebDev/umsizi/actions/workflows/ci.yml)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
|
|
3
7
|
> The missing TypeScript standard library.
|
|
4
8
|
|
|
5
9
|
**Umsizi** (pronounced *oom-see-zee*) is a modern, zero-dependency utility library built from the ground up for TypeScript applications. The name comes from the Zulu word for **"helper"** or **"assistant"**—which is exactly what this library is designed to be.
|
|
@@ -163,6 +167,36 @@ hasFileExtension("package.json", "json");
|
|
|
163
167
|
|
|
164
168
|
---
|
|
165
169
|
|
|
170
|
+
## Compatibility
|
|
171
|
+
|
|
172
|
+
- **ESM-only.** Umsizi ships only as ECMAScript modules (no CommonJS build). `require("umsizi")` will not work; use `import`. If your project is on CommonJS, you'll need a dynamic `import()` or a bundler that handles ESM dependencies.
|
|
173
|
+
- **Node.js 20+.** Enforced via `engines.node` in `package.json`.
|
|
174
|
+
- **Browsers:** the code targets ES2022 and has no Node-specific APIs in `umsizi` (core), `umsizi/react`, and `umsizi/next`; `umsizi/node` is Node-only by design. Bundle through your usual toolchain (Vite, Webpack, etc.) — there's no separate browser build.
|
|
175
|
+
|
|
176
|
+
## Error Handling Philosophy
|
|
177
|
+
|
|
178
|
+
Umsizi utilities **trust their inputs** to match their TypeScript signatures. They do not perform runtime validation, and they do not throw — invalid input (e.g. calling a Node-typed function with a non-string) produces an unspecified but non-throwing result rather than an exception.
|
|
179
|
+
|
|
180
|
+
If you're handling untrusted input (user input, network responses, `unknown`/`any` values), validate or narrow it *before* passing it into Umsizi. This keeps the utilities small, predictable, and fast, matching their role as thin building blocks rather than a validation layer.
|
|
181
|
+
|
|
182
|
+
## Versioning & Stability
|
|
183
|
+
|
|
184
|
+
Umsizi follows [semantic versioning](https://semver.org/). While the package is `0.x`:
|
|
185
|
+
|
|
186
|
+
- Minor versions (`0.x.0`) may include breaking changes to the public API.
|
|
187
|
+
- Patch versions (`0.0.x`) are bug fixes only.
|
|
188
|
+
- Once the API stabilizes, `1.0.0` will commit to standard semver guarantees (breaking changes only on major versions).
|
|
189
|
+
|
|
190
|
+
Releases are managed via [Changesets](https://github.com/changesets/changesets) and npm trusted publishing from GitHub Actions; see the generated `CHANGELOG.md` for version history.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Examples
|
|
195
|
+
|
|
196
|
+
See [`examples/`](./examples) for runnable, slightly more realistic usage of each utility beyond the snippets below.
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
166
200
|
## Current Status
|
|
167
201
|
|
|
168
202
|
Umsizi is still in early development. The package structure is in place, the initial utilities are implemented, and the public API is intentionally small.
|
|
@@ -197,6 +231,12 @@ If you want to introduce a helper, ensure it meets the baseline:
|
|
|
197
231
|
|
|
198
232
|
---
|
|
199
233
|
|
|
234
|
+
## Security
|
|
235
|
+
|
|
236
|
+
See [SECURITY.md](./SECURITY.md) for the vulnerability reporting policy.
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
200
240
|
## License
|
|
201
241
|
|
|
202
242
|
MIT
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/node/has-file-extension.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Checks whether a file path ends with the given extension.
|
|
4
|
+
*
|
|
5
|
+
* The leading dot on `extension` is optional — both `"ts"` and `".ts"` are
|
|
6
|
+
* accepted. The comparison is case-sensitive and is a plain `endsWith`
|
|
7
|
+
* check, so it does not validate that `filePath` is a well-formed path.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* hasFileExtension("src/index.ts", ".ts"); // true
|
|
12
|
+
* hasFileExtension("package.json", "json"); // true
|
|
13
|
+
* hasFileExtension("README.md", "ts"); // false
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
declare function hasFileExtension(filePath: string, extension: string): boolean;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { hasFileExtension as t };
|
|
19
|
+
//# sourceMappingURL=index-DtjbEW43.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/react/is-render-function.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Type guard for values that are callable in render-oriented code paths
|
|
4
|
+
* (e.g. `children` passed as a render prop).
|
|
5
|
+
*
|
|
6
|
+
* Matches any callable value, including async functions, generator
|
|
7
|
+
* functions, and class constructors — it does not distinguish between
|
|
8
|
+
* function kinds, only "is this safe to call as a function".
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const children: unknown = () => "ready";
|
|
13
|
+
*
|
|
14
|
+
* if (isRenderFunction(children)) {
|
|
15
|
+
* children();
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
declare function isRenderFunction(value: unknown): value is (...args: readonly unknown[]) => unknown;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { isRenderFunction as t };
|
|
22
|
+
//# sourceMappingURL=index-dktuz4mv.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/next/normalize-pathname.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes a path-like string for routing/comparison purposes.
|
|
4
|
+
*
|
|
5
|
+
* - Ensures a leading slash.
|
|
6
|
+
* - Collapses consecutive slashes into one.
|
|
7
|
+
* - Strips a trailing slash (except for the root path).
|
|
8
|
+
* - An empty string normalizes to `"/"`.
|
|
9
|
+
*
|
|
10
|
+
* Query strings and fragments are treated as opaque path characters and are
|
|
11
|
+
* not parsed or stripped — pass only the pathname segment of a URL.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* normalizePathname("dashboard"); // "/dashboard"
|
|
16
|
+
* normalizePathname("//dashboard///settings/"); // "/dashboard/settings"
|
|
17
|
+
* normalizePathname(""); // "/"
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
declare function normalizePathname(pathname: string): string;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { normalizePathname as t };
|
|
23
|
+
//# sourceMappingURL=index-rZiv1o95.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import { t as normalizePathname } from "./index-
|
|
2
|
-
import { t as hasFileExtension } from "./index-
|
|
3
|
-
import { t as isRenderFunction } from "./index-
|
|
1
|
+
import { t as normalizePathname } from "./index-rZiv1o95.js";
|
|
2
|
+
import { t as hasFileExtension } from "./index-DtjbEW43.js";
|
|
3
|
+
import { t as isRenderFunction } from "./index-dktuz4mv.js";
|
|
4
4
|
|
|
5
5
|
//#region src/core/identity.d.ts
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Returns the given value unchanged.
|
|
9
|
+
*
|
|
10
|
+
* Useful as a default callback, a type-inference anchor, or a no-op
|
|
11
|
+
* placeholder where a transform function is expected.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* identity("umsizi"); // "umsizi"
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
6
18
|
declare function identity<T>(value: T): T;
|
|
7
19
|
//#endregion
|
|
8
20
|
export { hasFileExtension, identity, isRenderFunction, normalizePathname };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import { t as normalizePathname } from "./next-
|
|
2
|
-
import { t as hasFileExtension } from "./node-
|
|
3
|
-
import { t as isRenderFunction } from "./react-
|
|
1
|
+
import { t as normalizePathname } from "./next-C3wp7UoQ.js";
|
|
2
|
+
import { t as hasFileExtension } from "./node-D-nlzpmG.js";
|
|
3
|
+
import { t as isRenderFunction } from "./react-BCidSnzT.js";
|
|
4
4
|
|
|
5
5
|
//#region src/core/identity.ts
|
|
6
|
+
/**
|
|
7
|
+
* Returns the given value unchanged.
|
|
8
|
+
*
|
|
9
|
+
* Useful as a default callback, a type-inference anchor, or a no-op
|
|
10
|
+
* placeholder where a transform function is expected.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* identity("umsizi"); // "umsizi"
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
6
17
|
function identity(value) {
|
|
7
18
|
return value;
|
|
8
19
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/core/identity.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/core/identity.ts"],"sourcesContent":["/**\n * Returns the given value unchanged.\n *\n * Useful as a default callback, a type-inference anchor, or a no-op\n * placeholder where a transform function is expected.\n *\n * @example\n * ```ts\n * identity(\"umsizi\"); // \"umsizi\"\n * ```\n */\nexport function identity<T>(value: T): T {\n\treturn value;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAWA,SAAgB,SAAY,OAAa;AACxC,QAAO"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/next/normalize-pathname.ts
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes a path-like string for routing/comparison purposes.
|
|
4
|
+
*
|
|
5
|
+
* - Ensures a leading slash.
|
|
6
|
+
* - Collapses consecutive slashes into one.
|
|
7
|
+
* - Strips a trailing slash (except for the root path).
|
|
8
|
+
* - An empty string normalizes to `"/"`.
|
|
9
|
+
*
|
|
10
|
+
* Query strings and fragments are treated as opaque path characters and are
|
|
11
|
+
* not parsed or stripped — pass only the pathname segment of a URL.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* normalizePathname("dashboard"); // "/dashboard"
|
|
16
|
+
* normalizePathname("//dashboard///settings/"); // "/dashboard/settings"
|
|
17
|
+
* normalizePathname(""); // "/"
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
function normalizePathname(pathname) {
|
|
21
|
+
if (pathname === "") return "/";
|
|
22
|
+
const normalized = pathname.replace(/\/{2,}/g, "/").replace(/\/$/, "");
|
|
23
|
+
if (normalized === "") return "/";
|
|
24
|
+
return normalized.startsWith("/") ? normalized : `/${normalized}`;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { normalizePathname as t };
|
|
29
|
+
//# sourceMappingURL=next-C3wp7UoQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-C3wp7UoQ.js","names":[],"sources":["../src/next/normalize-pathname.ts"],"sourcesContent":["/**\n * Normalizes a path-like string for routing/comparison purposes.\n *\n * - Ensures a leading slash.\n * - Collapses consecutive slashes into one.\n * - Strips a trailing slash (except for the root path).\n * - An empty string normalizes to `\"/\"`.\n *\n * Query strings and fragments are treated as opaque path characters and are\n * not parsed or stripped — pass only the pathname segment of a URL.\n *\n * @example\n * ```ts\n * normalizePathname(\"dashboard\"); // \"/dashboard\"\n * normalizePathname(\"//dashboard///settings/\"); // \"/dashboard/settings\"\n * normalizePathname(\"\"); // \"/\"\n * ```\n */\nexport function normalizePathname(pathname: string): string {\n\tif (pathname === \"\") {\n\t\treturn \"/\";\n\t}\n\n\tconst normalized = pathname.replace(/\\/{2,}/g, \"/\").replace(/\\/$/, \"\");\n\n\tif (normalized === \"\") {\n\t\treturn \"/\";\n\t}\n\n\treturn normalized.startsWith(\"/\") ? normalized : `/${normalized}`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,kBAAkB,UAA0B;AAC3D,KAAI,aAAa,GAChB,QAAO;CAGR,MAAM,aAAa,SAAS,QAAQ,WAAW,IAAI,CAAC,QAAQ,OAAO,GAAG;AAEtE,KAAI,eAAe,GAClB,QAAO;AAGR,QAAO,WAAW,WAAW,IAAI,GAAG,aAAa,IAAI"}
|
package/dist/next.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as normalizePathname } from "./index-
|
|
1
|
+
import { t as normalizePathname } from "./index-rZiv1o95.js";
|
|
2
2
|
export { normalizePathname };
|
package/dist/next.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/node/has-file-extension.ts
|
|
2
|
+
/**
|
|
3
|
+
* Checks whether a file path ends with the given extension.
|
|
4
|
+
*
|
|
5
|
+
* The leading dot on `extension` is optional — both `"ts"` and `".ts"` are
|
|
6
|
+
* accepted. The comparison is case-sensitive and is a plain `endsWith`
|
|
7
|
+
* check, so it does not validate that `filePath` is a well-formed path.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* hasFileExtension("src/index.ts", ".ts"); // true
|
|
12
|
+
* hasFileExtension("package.json", "json"); // true
|
|
13
|
+
* hasFileExtension("README.md", "ts"); // false
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
function hasFileExtension(filePath, extension) {
|
|
17
|
+
const normalizedExtension = extension.startsWith(".") ? extension : `.${extension}`;
|
|
18
|
+
return filePath.endsWith(normalizedExtension);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { hasFileExtension as t };
|
|
23
|
+
//# sourceMappingURL=node-D-nlzpmG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-D-nlzpmG.js","names":[],"sources":["../src/node/has-file-extension.ts"],"sourcesContent":["/**\n * Checks whether a file path ends with the given extension.\n *\n * The leading dot on `extension` is optional — both `\"ts\"` and `\".ts\"` are\n * accepted. The comparison is case-sensitive and is a plain `endsWith`\n * check, so it does not validate that `filePath` is a well-formed path.\n *\n * @example\n * ```ts\n * hasFileExtension(\"src/index.ts\", \".ts\"); // true\n * hasFileExtension(\"package.json\", \"json\"); // true\n * hasFileExtension(\"README.md\", \"ts\"); // false\n * ```\n */\nexport function hasFileExtension(filePath: string, extension: string): boolean {\n\tconst normalizedExtension = extension.startsWith(\".\")\n\t\t? extension\n\t\t: `.${extension}`;\n\n\treturn filePath.endsWith(normalizedExtension);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAcA,SAAgB,iBAAiB,UAAkB,WAA4B;CAC9E,MAAM,sBAAsB,UAAU,WAAW,IAAI,GAClD,YACA,IAAI;AAEP,QAAO,SAAS,SAAS,oBAAoB"}
|
package/dist/node.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as hasFileExtension } from "./index-
|
|
1
|
+
import { t as hasFileExtension } from "./index-DtjbEW43.js";
|
|
2
2
|
export { hasFileExtension };
|
package/dist/node.js
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/react/is-render-function.ts
|
|
2
|
+
/**
|
|
3
|
+
* Type guard for values that are callable in render-oriented code paths
|
|
4
|
+
* (e.g. `children` passed as a render prop).
|
|
5
|
+
*
|
|
6
|
+
* Matches any callable value, including async functions, generator
|
|
7
|
+
* functions, and class constructors — it does not distinguish between
|
|
8
|
+
* function kinds, only "is this safe to call as a function".
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const children: unknown = () => "ready";
|
|
13
|
+
*
|
|
14
|
+
* if (isRenderFunction(children)) {
|
|
15
|
+
* children();
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
function isRenderFunction(value) {
|
|
20
|
+
return typeof value === "function";
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { isRenderFunction as t };
|
|
25
|
+
//# sourceMappingURL=react-BCidSnzT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-BCidSnzT.js","names":[],"sources":["../src/react/is-render-function.ts"],"sourcesContent":["/**\n * Type guard for values that are callable in render-oriented code paths\n * (e.g. `children` passed as a render prop).\n *\n * Matches any callable value, including async functions, generator\n * functions, and class constructors — it does not distinguish between\n * function kinds, only \"is this safe to call as a function\".\n *\n * @example\n * ```ts\n * const children: unknown = () => \"ready\";\n *\n * if (isRenderFunction(children)) {\n * children();\n * }\n * ```\n */\nexport function isRenderFunction(\n\tvalue: unknown,\n): value is (...args: readonly unknown[]) => unknown {\n\treturn typeof value === \"function\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,SAAgB,iBACf,OACoD;AACpD,QAAO,OAAO,UAAU"}
|
package/dist/react.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as isRenderFunction } from "./index-
|
|
1
|
+
import { t as isRenderFunction } from "./index-dktuz4mv.js";
|
|
2
2
|
export { isRenderFunction };
|
package/dist/react.js
CHANGED
package/package.json
CHANGED
|
@@ -1,85 +1,110 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
2
|
+
"name": "umsizi",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "A zero-dependency TypeScript utility library.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Jack-WebDev",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/Jack-WebDev/umsizi.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/Jack-WebDev/umsizi#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/Jack-WebDev/umsizi/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"typescript",
|
|
18
|
+
"utilities",
|
|
19
|
+
"helpers",
|
|
20
|
+
"toolkit",
|
|
21
|
+
"zero-dependency"
|
|
22
|
+
],
|
|
23
|
+
"files": [
|
|
24
|
+
"dist"
|
|
25
|
+
],
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./react": {
|
|
33
|
+
"types": "./dist/react.d.ts",
|
|
34
|
+
"import": "./dist/react.js"
|
|
35
|
+
},
|
|
36
|
+
"./next": {
|
|
37
|
+
"types": "./dist/next.d.ts",
|
|
38
|
+
"import": "./dist/next.js"
|
|
39
|
+
},
|
|
40
|
+
"./node": {
|
|
41
|
+
"types": "./dist/node.d.ts",
|
|
42
|
+
"import": "./dist/node.js"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"main": "./dist/index.js",
|
|
47
|
+
"module": "./dist/index.js",
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@biomejs/biome": "2.5.1",
|
|
50
|
+
"@changesets/cli": "2.31.0",
|
|
51
|
+
"@size-limit/preset-small-lib": "12.1.0",
|
|
52
|
+
"@vitest/coverage-v8": "4.1.9",
|
|
53
|
+
"husky": "^9.1.7",
|
|
54
|
+
"lint-staged": "^16.1.2",
|
|
55
|
+
"size-limit": "12.1.0",
|
|
56
|
+
"tsdown": "^0.16.8",
|
|
57
|
+
"typescript": "5.9.2",
|
|
58
|
+
"vitest": "4.1.9"
|
|
59
|
+
},
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
63
|
+
"lint-staged": {
|
|
64
|
+
"*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}": [
|
|
65
|
+
"biome check --write ."
|
|
66
|
+
]
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=20"
|
|
70
|
+
},
|
|
71
|
+
"size-limit": [
|
|
72
|
+
{
|
|
73
|
+
"name": "umsizi (core)",
|
|
74
|
+
"path": "dist/index.js",
|
|
75
|
+
"limit": "512 B"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"name": "umsizi/react",
|
|
79
|
+
"path": "dist/react.js",
|
|
80
|
+
"limit": "512 B"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "umsizi/next",
|
|
84
|
+
"path": "dist/next.js",
|
|
85
|
+
"limit": "512 B"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "umsizi/node",
|
|
89
|
+
"path": "dist/node.js",
|
|
90
|
+
"limit": "512 B"
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"scripts": {
|
|
94
|
+
"build": "tsdown",
|
|
95
|
+
"ci": "pnpm run lint && pnpm run check-types && pnpm run test:coverage && pnpm run build && pnpm exec size-limit && pnpm run check:package",
|
|
96
|
+
"check:package": "pnpm run check:package:npm && pnpm run check:package:jsr",
|
|
97
|
+
"check:package:jsr": "pnpm dlx jsr publish --dry-run --allow-dirty",
|
|
98
|
+
"check:package:npm": "HUSKY=0 npm_config_cache=/tmp/umsizi-npm-cache npm pack --dry-run --ignore-scripts",
|
|
99
|
+
"dev": "tsdown --watch",
|
|
100
|
+
"format": "biome format --write .",
|
|
101
|
+
"lint": "biome check .",
|
|
102
|
+
"lint:fix": "biome check --write .",
|
|
103
|
+
"check-types": "tsc --noEmit",
|
|
104
|
+
"release:publish": "pnpm run build && pnpm exec changeset publish && pnpm dlx jsr publish --allow-dirty",
|
|
105
|
+
"release:version": "pnpm exec changeset version && node ./scripts/sync-release-version.mjs",
|
|
106
|
+
"test": "vitest run",
|
|
107
|
+
"test:coverage": "vitest run --coverage",
|
|
108
|
+
"size": "pnpm run build && size-limit"
|
|
109
|
+
}
|
|
110
|
+
}
|
package/dist/index-Bi-DJKKn.d.ts
DELETED
package/dist/index-Cfup-UnB.d.ts
DELETED
package/dist/index-uHJbGgdS.d.ts
DELETED
package/dist/next-B9pvCR1P.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//#region src/next/normalize-pathname.ts
|
|
2
|
-
function normalizePathname(pathname) {
|
|
3
|
-
if (pathname === "") return "/";
|
|
4
|
-
const normalized = pathname.replace(/\/{2,}/g, "/").replace(/\/$/, "");
|
|
5
|
-
if (normalized === "") return "/";
|
|
6
|
-
return normalized.startsWith("/") ? normalized : `/${normalized}`;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
export { normalizePathname as t };
|
|
11
|
-
//# sourceMappingURL=next-B9pvCR1P.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"next-B9pvCR1P.js","names":[],"sources":["../src/next/normalize-pathname.ts"],"sourcesContent":["export function normalizePathname(pathname: string): string {\n\tif (pathname === \"\") {\n\t\treturn \"/\";\n\t}\n\n\tconst normalized = pathname.replace(/\\/{2,}/g, \"/\").replace(/\\/$/, \"\");\n\n\tif (normalized === \"\") {\n\t\treturn \"/\";\n\t}\n\n\treturn normalized.startsWith(\"/\") ? normalized : `/${normalized}`;\n}\n"],"mappings":";AAAA,SAAgB,kBAAkB,UAA0B;AAC3D,KAAI,aAAa,GAChB,QAAO;CAGR,MAAM,aAAa,SAAS,QAAQ,WAAW,IAAI,CAAC,QAAQ,OAAO,GAAG;AAEtE,KAAI,eAAe,GAClB,QAAO;AAGR,QAAO,WAAW,WAAW,IAAI,GAAG,aAAa,IAAI"}
|
package/dist/node-Di-uva1n.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//#region src/node/has-file-extension.ts
|
|
2
|
-
function hasFileExtension(filePath, extension) {
|
|
3
|
-
const normalizedExtension = extension.startsWith(".") ? extension : `.${extension}`;
|
|
4
|
-
return filePath.endsWith(normalizedExtension);
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { hasFileExtension as t };
|
|
9
|
-
//# sourceMappingURL=node-Di-uva1n.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node-Di-uva1n.js","names":[],"sources":["../src/node/has-file-extension.ts"],"sourcesContent":["export function hasFileExtension(filePath: string, extension: string): boolean {\n\tconst normalizedExtension = extension.startsWith(\".\")\n\t\t? extension\n\t\t: `.${extension}`;\n\n\treturn filePath.endsWith(normalizedExtension);\n}\n"],"mappings":";AAAA,SAAgB,iBAAiB,UAAkB,WAA4B;CAC9E,MAAM,sBAAsB,UAAU,WAAW,IAAI,GAClD,YACA,IAAI;AAEP,QAAO,SAAS,SAAS,oBAAoB"}
|
package/dist/react-DPRQiKYh.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-DPRQiKYh.js","names":[],"sources":["../src/react/is-render-function.ts"],"sourcesContent":["export function isRenderFunction(\n\tvalue: unknown,\n): value is (...args: readonly unknown[]) => unknown {\n\treturn typeof value === \"function\";\n}\n"],"mappings":";AAAA,SAAgB,iBACf,OACoD;AACpD,QAAO,OAAO,UAAU"}
|