@thi.ng/strings 3.7.15 → 3.7.17
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 +1 -1
- package/README.md +1 -1
- package/ansi.d.ts +2 -0
- package/case.d.ts +2 -0
- package/center.d.ts +14 -0
- package/cursor.d.ts +2 -0
- package/escape.d.ts +2 -0
- package/hollerith.d.ts +2 -0
- package/join.d.ts +4 -0
- package/package.json +6 -6
- package/ruler.d.ts +4 -0
- package/slugify.d.ts +4 -0
- package/tabs.d.ts +2 -0
- package/trim.d.ts +2 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
[](https://mastodon.thi.ng/@toxi)
|
|
19
19
|
|
|
20
20
|
> [!NOTE]
|
|
21
|
-
> This is one of
|
|
21
|
+
> This is one of 190 standalone projects, maintained as part
|
|
22
22
|
> of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
|
|
23
23
|
> and anti-framework.
|
|
24
24
|
>
|
package/ansi.d.ts
CHANGED
package/case.d.ts
CHANGED
package/center.d.ts
CHANGED
|
@@ -11,10 +11,24 @@ import type { Stringer } from "./api.js";
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
|
+
* import { center, wrap } from "@thi.ng/strings";
|
|
15
|
+
*
|
|
14
16
|
* center(20, "<>")(wrap(" ")("thi.ng"))
|
|
15
17
|
* // "<><><> thi.ng <><><>"
|
|
16
18
|
* ```
|
|
17
19
|
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { comp } from "@thi.ng/compose";
|
|
23
|
+
* import { center, wrap } from "@thi.ng/strings";
|
|
24
|
+
*
|
|
25
|
+
* // compose formatting function
|
|
26
|
+
* const fmt = comp(center(20,"<>"), wrap(" "));
|
|
27
|
+
*
|
|
28
|
+
* fmt("thi.ng")
|
|
29
|
+
* // "<><><> thi.ng <><><>"
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
18
32
|
* @param lineWidth - target length
|
|
19
33
|
* @param pad - pad character(s)
|
|
20
34
|
*/
|
package/cursor.d.ts
CHANGED
package/escape.d.ts
CHANGED
package/hollerith.d.ts
CHANGED
package/join.d.ts
CHANGED
|
@@ -6,11 +6,15 @@ import type { Stringer } from "./api.js";
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```ts
|
|
9
|
+
* import { format, join } from "@thi.ng/strings";
|
|
10
|
+
* import { partial } from "@thi.ng/compose";
|
|
11
|
+
*
|
|
9
12
|
* const slashes = join("/");
|
|
10
13
|
*
|
|
11
14
|
* slashes([1, 2, 3]);
|
|
12
15
|
* // "1/2/3"
|
|
13
16
|
*
|
|
17
|
+
* // pre-compose formatter function w/ partial arguments
|
|
14
18
|
* const formatOBJFace = partial(
|
|
15
19
|
* format, ["f ", slashes, " ", slashes, " ", slashes]
|
|
16
20
|
* );
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/strings",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.17",
|
|
4
4
|
"description": "Various string formatting & utility functions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"test": "bun test"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.9.
|
|
39
|
-
"@thi.ng/errors": "^2.4.
|
|
40
|
-
"@thi.ng/hex": "^2.3.
|
|
41
|
-
"@thi.ng/memoize": "^3.1.
|
|
38
|
+
"@thi.ng/api": "^8.9.26",
|
|
39
|
+
"@thi.ng/errors": "^2.4.18",
|
|
40
|
+
"@thi.ng/hex": "^2.3.37",
|
|
41
|
+
"@thi.ng/memoize": "^3.1.60"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@microsoft/api-extractor": "^7.40.1",
|
|
@@ -203,5 +203,5 @@
|
|
|
203
203
|
"thi.ng": {
|
|
204
204
|
"year": 2015
|
|
205
205
|
},
|
|
206
|
-
"gitHead": "
|
|
206
|
+
"gitHead": "6e20f80dd9df1c8055ffa3c1e4d6f7598add0c0b\n"
|
|
207
207
|
}
|
package/ruler.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* @example
|
|
6
6
|
* ```ts
|
|
7
|
+
* import { ruler } from "@thi.ng/strings";
|
|
8
|
+
*
|
|
7
9
|
* console.log(ruler(40))
|
|
8
10
|
* // |''''|''''|''''|''''|''''|''''|''''|''''
|
|
9
11
|
*
|
|
@@ -23,6 +25,8 @@ export declare const ruler: (width: number, major?: number, a?: string, b?: stri
|
|
|
23
25
|
*
|
|
24
26
|
* @example
|
|
25
27
|
* ```ts
|
|
28
|
+
* import { grid } from "@thi.ng/strings";
|
|
29
|
+
*
|
|
26
30
|
* console.log(grid(3, 3, 4, 2));
|
|
27
31
|
* // +---+---+---+
|
|
28
32
|
* // | | | |
|
package/slugify.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ import type { Stringer } from "./api.js";
|
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```ts
|
|
8
|
+
* import { slugify } from "@thi.ng/strings";
|
|
9
|
+
*
|
|
8
10
|
* slugify("Me, myself (& ëye) 😀!")
|
|
9
11
|
* // "me-myself-and-eye"
|
|
10
12
|
* ```
|
|
@@ -18,6 +20,8 @@ export declare const slugify: Stringer<string>;
|
|
|
18
20
|
*
|
|
19
21
|
* @example
|
|
20
22
|
* ```ts
|
|
23
|
+
* import { slugifyGH } from "@thi.ng/strings";
|
|
24
|
+
*
|
|
21
25
|
* slugifyGH("Me, myself (& ëye) 😀!")
|
|
22
26
|
* // "me-myself--ëye-"
|
|
23
27
|
* ```
|
package/tabs.d.ts
CHANGED