@thi.ng/strings 3.3.19 → 3.3.21
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 +6 -9
- package/api.d.ts +2 -2
- package/hollerith.d.ts +1 -1
- package/hollerith.js +1 -1
- package/package.json +11 -11
- package/slugify.d.ts +1 -1
- package/slugify.js +1 -1
- package/units.d.ts +1 -1
- package/uuid.d.ts +5 -4
- package/uuid.js +5 -4
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
3
|
+
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/strings)
|
|
6
6
|

|
|
7
|
-
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
This project is part of the
|
|
10
10
|
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
|
|
@@ -136,11 +136,8 @@ ES module import:
|
|
|
136
136
|
|
|
137
137
|
For Node.js REPL:
|
|
138
138
|
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
node --experimental-repl-await
|
|
142
|
-
|
|
143
|
-
> const strings = await import("@thi.ng/strings");
|
|
139
|
+
```js
|
|
140
|
+
const strings = await import("@thi.ng/strings");
|
|
144
141
|
```
|
|
145
142
|
|
|
146
143
|
Package sizes (brotli'd, pre-treeshake): ESM: 4.29 KB
|
|
@@ -195,7 +192,7 @@ fmt("eur", 1.2345, 0.25)
|
|
|
195
192
|
|
|
196
193
|
## Authors
|
|
197
194
|
|
|
198
|
-
Karsten Schmidt
|
|
195
|
+
- [Karsten Schmidt](https://thi.ng)
|
|
199
196
|
|
|
200
197
|
If this project contributes to an academic publication, please cite it as:
|
|
201
198
|
|
|
@@ -210,4 +207,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
210
207
|
|
|
211
208
|
## License
|
|
212
209
|
|
|
213
|
-
© 2015 - 2022 Karsten Schmidt // Apache
|
|
210
|
+
© 2015 - 2022 Karsten Schmidt // Apache License 2.0
|
package/api.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import type { Fn, Fn2, FnU } from "@thi.ng/api";
|
|
|
4
4
|
* https://en.wikipedia.org/wiki/Byte_order_mark
|
|
5
5
|
*/
|
|
6
6
|
export declare const BOM = "\uFEFF";
|
|
7
|
-
export
|
|
8
|
-
export
|
|
7
|
+
export type Stringer<T> = (x: T, ...xs: any[]) => string;
|
|
8
|
+
export type FnS = FnU<string>;
|
|
9
9
|
export interface WordWrapOpts {
|
|
10
10
|
/**
|
|
11
11
|
* Target line width for word wrapping.
|
package/hollerith.d.ts
CHANGED
package/hollerith.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/strings",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.21",
|
|
4
4
|
"description": "Various string formatting & utility functions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"url": "https://patreon.com/thing_umbrella"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"author": "Karsten Schmidt
|
|
24
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
25
|
"license": "Apache-2.0",
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "yarn clean && tsc --declaration",
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.
|
|
38
|
-
"@thi.ng/errors": "^2.2.
|
|
39
|
-
"@thi.ng/hex": "^2.3.
|
|
40
|
-
"@thi.ng/memoize": "^3.1.
|
|
37
|
+
"@thi.ng/api": "^8.6.1",
|
|
38
|
+
"@thi.ng/errors": "^2.2.6",
|
|
39
|
+
"@thi.ng/hex": "^2.3.2",
|
|
40
|
+
"@thi.ng/memoize": "^3.1.20"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@microsoft/api-extractor": "^7.33.
|
|
44
|
-
"@thi.ng/testament": "^0.3.
|
|
43
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
44
|
+
"@thi.ng/testament": "^0.3.7",
|
|
45
45
|
"rimraf": "^3.0.2",
|
|
46
46
|
"tools": "^0.0.1",
|
|
47
|
-
"typedoc": "^0.23.
|
|
48
|
-
"typescript": "^4.
|
|
47
|
+
"typedoc": "^0.23.22",
|
|
48
|
+
"typescript": "^4.9.4"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"ansi",
|
|
@@ -200,5 +200,5 @@
|
|
|
200
200
|
"thi.ng": {
|
|
201
201
|
"year": 2015
|
|
202
202
|
},
|
|
203
|
-
"gitHead": "
|
|
203
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
204
204
|
}
|
package/slugify.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Stringer } from "./api.js";
|
|
2
2
|
/**
|
|
3
3
|
* Based on:
|
|
4
|
-
*
|
|
4
|
+
* https://medium.com/@matthagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
|
|
5
5
|
*
|
|
6
6
|
* @example
|
|
7
7
|
* ```ts
|
package/slugify.js
CHANGED
|
@@ -3,7 +3,7 @@ const dest = "aaaaaaeeeeiiiioooouuuuncsyoarsnpwgnmuxzh------";
|
|
|
3
3
|
const re = new RegExp(src.split("").join("|"), "g");
|
|
4
4
|
/**
|
|
5
5
|
* Based on:
|
|
6
|
-
*
|
|
6
|
+
* https://medium.com/@matthagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* ```ts
|
package/units.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Stringer } from "./api.js";
|
|
2
|
-
|
|
2
|
+
type UnitDefs = [number, string, number?][];
|
|
3
3
|
export declare const units: (exp: UnitDefs, base: string, prec?: number) => Stringer<number>;
|
|
4
4
|
export declare const bits: Stringer<number>;
|
|
5
5
|
export declare const bytes: Stringer<number>;
|
package/uuid.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Same as
|
|
3
|
-
*
|
|
2
|
+
* Same as [`uuid()`](https://docs.thi.ng/umbrella/hex/functions/uuid.html).
|
|
3
|
+
* Returns UUID formatted string of given byte array from optional start index
|
|
4
|
+
* `i` (default: 0). Array must have min. length
|
|
4
5
|
* 16.
|
|
5
6
|
*
|
|
6
7
|
* @remarks
|
|
7
|
-
* Use
|
|
8
|
-
* than just format one).
|
|
8
|
+
* Use [`uuid()`](https://docs.thi.ng/umbrella/random/functions/uuid.html) to
|
|
9
|
+
* also generate an UUID from scratch (rather than just format one).
|
|
9
10
|
*
|
|
10
11
|
* @param id -
|
|
11
12
|
* @param i -
|
package/uuid.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { uuid as $uuid } from "@thi.ng/hex";
|
|
2
2
|
/**
|
|
3
|
-
* Same as
|
|
4
|
-
*
|
|
3
|
+
* Same as [`uuid()`](https://docs.thi.ng/umbrella/hex/functions/uuid.html).
|
|
4
|
+
* Returns UUID formatted string of given byte array from optional start index
|
|
5
|
+
* `i` (default: 0). Array must have min. length
|
|
5
6
|
* 16.
|
|
6
7
|
*
|
|
7
8
|
* @remarks
|
|
8
|
-
* Use
|
|
9
|
-
* than just format one).
|
|
9
|
+
* Use [`uuid()`](https://docs.thi.ng/umbrella/random/functions/uuid.html) to
|
|
10
|
+
* also generate an UUID from scratch (rather than just format one).
|
|
10
11
|
*
|
|
11
12
|
* @param id -
|
|
12
13
|
* @param i -
|