@inzero/ts-ut 0.0.1 → 0.1.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/CHANGELOG.md +13 -1
- package/README.md +5 -5
- package/dist/string/split.d.ts +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [0.
|
|
3
|
+
## [0.1.1] 2026-10-19
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
|
|
7
|
+
- Re-export `Split` and `Join` from the `string` group.
|
|
8
|
+
|
|
9
|
+
## [0.1.0] 2026-10-19
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- Added `Split<T, S>` and `Join<T, S>` string utility types.
|
|
14
|
+
|
|
15
|
+
## [0.0.1] 2026-10-15
|
|
4
16
|
|
|
5
17
|
First release.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# ts-ut
|
|
1
|
+
# @inzero/ts-ut
|
|
2
2
|
|
|
3
3
|
A TypeScript utility types library.
|
|
4
4
|
|
|
5
5
|
## Quick Examples
|
|
6
6
|
|
|
7
7
|
```ts
|
|
8
|
-
import { Param } from "ts-ut";
|
|
9
|
-
import { GetDeep } from "ts-ut/dict"; // Or category-specific imports
|
|
8
|
+
import { Param } from "@inzero/ts-ut";
|
|
9
|
+
import { GetDeep } from "@inzero/ts-ut/dict"; // Or category-specific imports
|
|
10
10
|
|
|
11
11
|
type Handler = (foo: string, bar: number) => boolean;
|
|
12
12
|
type LastParam = Param<Handler, -1>; // number [!code highlight]
|
|
@@ -17,8 +17,8 @@ type Target = GetDeep<Config, "b.c">; // 4 [!code highlight]
|
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
|
-
```
|
|
21
|
-
|
|
20
|
+
```sh
|
|
21
|
+
pnpm add -D @inzero/ts-ut
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
## Docs
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ROList } from "../list";
|
|
2
|
+
export type Split<T extends string, S extends string> = T extends "" ? [] : T extends `${infer L}${S}${infer R}` ? [L, ...Split<R, S>] : [T];
|
|
3
|
+
export type Join<T extends ROList<string>, S extends string = ""> = T extends readonly [
|
|
4
|
+
infer F extends string,
|
|
5
|
+
...infer R extends ROList<string>
|
|
6
|
+
] ? R["length"] extends 0 ? F : `${F}${S}${Join<R, S>}` : "";
|