@tolki/str 1.0.2 → 1.0.3
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/dist/ascii/index.d.ts.map +1 -1
- package/dist/ascii/index.js +23 -28
- package/dist/markdown/index.d.ts +1 -1
- package/dist/markdown/index.d.ts.map +1 -1
- package/dist/markdown/index.js +12 -11
- package/dist/replacer/index.d.ts +2 -0
- package/dist/replacer/index.d.ts.map +1 -1
- package/dist/replacer/index.js +31 -27
- package/dist/str.d.ts +4 -0
- package/dist/str.d.ts.map +1 -1
- package/dist/str.js +259 -263
- package/dist/stringable/index.d.ts +1 -1
- package/dist/stringable/index.d.ts.map +1 -1
- package/dist/stringable/index.js +109 -118
- package/dist/ulid/index.d.ts +1 -1
- package/dist/ulid/index.d.ts.map +1 -1
- package/dist/ulid/index.js +8 -8
- package/dist/uuid/index.d.ts +1 -1
- package/dist/uuid/index.d.ts.map +1 -1
- package/dist/uuid/index.js +6 -6
- package/package.json +3 -3
package/dist/ulid/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare function createUlidsNormally(): void;
|
|
|
29
29
|
*
|
|
30
30
|
* @requires {@link https://www.npmjs.com/package/ulid ulid package}
|
|
31
31
|
*/
|
|
32
|
-
export declare function createUlidsUsing(factory
|
|
32
|
+
export declare function createUlidsUsing(factory: (() => string) | null): void;
|
|
33
33
|
/**
|
|
34
34
|
* Set the sequence that will be used to generate ULIDs.
|
|
35
35
|
*
|
package/dist/ulid/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ulid/index.ts"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,IAAI,GAAG,MAAM,GAAG,IAAW,GAAG,MAAM,CAwB9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ulid/index.ts"],"names":[],"mappings":"AAQA;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,GAAE,IAAI,GAAG,MAAM,GAAG,IAAW,GAAG,MAAM,CAwB9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAErE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,MAAM,EAAE,EAClB,WAAW,GAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAW,GAC1C,IAAI,CAwBN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACvB,QAAQ,GAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAW,GACpD,MAAM,CAcR;AAED;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQ9C"}
|
package/dist/ulid/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isString as c } from "@tolki/utils";
|
|
2
2
|
import { ulid as e } from "ulid";
|
|
3
3
|
let l = null;
|
|
4
|
-
function
|
|
4
|
+
function i(n = null) {
|
|
5
5
|
if (l)
|
|
6
6
|
return l();
|
|
7
7
|
if (n == null)
|
|
@@ -18,7 +18,7 @@ function u(n = null) {
|
|
|
18
18
|
function a() {
|
|
19
19
|
l = null;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function u(n) {
|
|
22
22
|
l = n;
|
|
23
23
|
}
|
|
24
24
|
function U(n, t = null) {
|
|
@@ -26,15 +26,15 @@ function U(n, t = null) {
|
|
|
26
26
|
t ??= function() {
|
|
27
27
|
const o = l;
|
|
28
28
|
l = null;
|
|
29
|
-
const f =
|
|
29
|
+
const f = i();
|
|
30
30
|
return l = o, r++, f;
|
|
31
|
-
},
|
|
31
|
+
}, u(function() {
|
|
32
32
|
return r < n.length ? n[r++] : t();
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
function p(n = null) {
|
|
36
|
-
const t =
|
|
37
|
-
if (
|
|
36
|
+
const t = i();
|
|
37
|
+
if (u(() => t), n !== null)
|
|
38
38
|
try {
|
|
39
39
|
n(t);
|
|
40
40
|
} finally {
|
|
@@ -50,9 +50,9 @@ function y(n) {
|
|
|
50
50
|
}
|
|
51
51
|
export {
|
|
52
52
|
a as createUlidsNormally,
|
|
53
|
-
|
|
53
|
+
u as createUlidsUsing,
|
|
54
54
|
U as createUlidsUsingSequence,
|
|
55
55
|
p as freezeUlids,
|
|
56
56
|
y as isUlid,
|
|
57
|
-
|
|
57
|
+
i as ulid
|
|
58
58
|
};
|
package/dist/uuid/index.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare function uuid7(): string;
|
|
|
28
28
|
*
|
|
29
29
|
* @requires {@link https://www.npmjs.com/package/uuid uuid package}
|
|
30
30
|
*/
|
|
31
|
-
export declare function createUuidsUsing(factory
|
|
31
|
+
export declare function createUuidsUsing(factory: (() => string) | null): void;
|
|
32
32
|
/**
|
|
33
33
|
* Set the sequence that will be used to generate UUIDs.
|
|
34
34
|
*
|
package/dist/uuid/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uuid/index.ts"],"names":[],"mappings":"AAeA;;;;;;;;GAQG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,KAAK,IAAI,MAAM,CAE9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/uuid/index.ts"],"names":[],"mappings":"AAeA;;;;;;;;GAQG;AACH,wBAAgB,IAAI,IAAI,MAAM,CAE7B;AAED;;;;;;;;GAQG;AACH,wBAAgB,KAAK,IAAI,MAAM,CAE9B;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAErE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CACpC,QAAQ,EAAE,MAAM,EAAE,EAClB,WAAW,GAAE,CAAC,MAAM,MAAM,CAAC,GAAG,IAAW,GAC1C,IAAI,CAwBN;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CACvB,QAAQ,GAAE,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAW,GACpD,MAAM,CAcR;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,MAAM,CAClB,KAAK,EAAE,MAAM,GAAG,OAAO,EACvB,OAAO,GAAE,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,IAAW,GAC9C,OAAO,CAkCT"}
|
package/dist/uuid/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { isString as o } from "@tolki/utils";
|
|
2
|
-
import {
|
|
2
|
+
import { validate as a, NIL as c, MAX as d, version as s, v4 as U, v7 as m } from "uuid";
|
|
3
3
|
let u = null;
|
|
4
4
|
function f() {
|
|
5
|
-
return u ? u() :
|
|
5
|
+
return u ? u() : U();
|
|
6
6
|
}
|
|
7
7
|
function g() {
|
|
8
|
-
return u ? u() :
|
|
8
|
+
return u ? u() : m();
|
|
9
9
|
}
|
|
10
|
-
function e(n
|
|
10
|
+
function e(n) {
|
|
11
11
|
u = n;
|
|
12
12
|
}
|
|
13
13
|
function p(n, t = null) {
|
|
@@ -35,9 +35,9 @@ function A() {
|
|
|
35
35
|
u = null;
|
|
36
36
|
}
|
|
37
37
|
function C(n, t = null) {
|
|
38
|
-
return !o(n) || t !== null && !
|
|
38
|
+
return !o(n) || t !== null && !a(n) ? !1 : t === null ? /^[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}$/.test(
|
|
39
39
|
n
|
|
40
|
-
) : t === 0 || t === "nil" ? n.toLowerCase() ===
|
|
40
|
+
) : t === 0 || t === "nil" ? n.toLowerCase() === c : t === "max" ? n.toLowerCase() === d : t < 1 || t > 8 ? !1 : s(n) === t;
|
|
41
41
|
}
|
|
42
42
|
export {
|
|
43
43
|
A as createUuidsNormally,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tolki/str",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Utilities for working with strings similar to Laravel's Str & Stringable classes.",
|
|
5
5
|
"author": "Abraham Arango <https://github.com/abetwothree>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
],
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@tolki/
|
|
30
|
-
"@tolki/
|
|
29
|
+
"@tolki/utils": "^1.0.0",
|
|
30
|
+
"@tolki/num": "^1.0.3"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/markdown-it": "^14.1.2",
|