complete-common 2.1.0 → 2.2.0
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/functions/array.d.cts +2 -2
- package/dist/functions/array.d.mts +2 -2
- package/dist/functions/array.d.ts +2 -2
- package/dist/functions/array.d.ts.map +1 -1
- package/dist/functions/string.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
- package/src/functions/array.ts +2 -2
- package/src/functions/string.ts +1 -5
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type { WidenLiteral } from "../
|
|
6
|
+
import type { WidenLiteral } from "../types/WidenLiteral.js";
|
|
7
7
|
/**
|
|
8
8
|
* Helper function to copy a two-dimensional array. Note that the sub-arrays will only be shallow
|
|
9
9
|
* copied (using the spread operator).
|
|
10
10
|
*/
|
|
11
|
-
export declare function arrayCopyTwoDimensional<T>(array: ReadonlyArray<readonly T[]>): readonly T[]
|
|
11
|
+
export declare function arrayCopyTwoDimensional<T>(array: ReadonlyArray<readonly T[]>): ReadonlyArray<readonly T[]>;
|
|
12
12
|
/**
|
|
13
13
|
* Helper function for determining if two arrays contain the exact same elements. Note that this
|
|
14
14
|
* only performs a shallow comparison.
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type { WidenLiteral } from "../
|
|
6
|
+
import type { WidenLiteral } from "../types/WidenLiteral.js";
|
|
7
7
|
/**
|
|
8
8
|
* Helper function to copy a two-dimensional array. Note that the sub-arrays will only be shallow
|
|
9
9
|
* copied (using the spread operator).
|
|
10
10
|
*/
|
|
11
|
-
export declare function arrayCopyTwoDimensional<T>(array: ReadonlyArray<readonly T[]>): readonly T[]
|
|
11
|
+
export declare function arrayCopyTwoDimensional<T>(array: ReadonlyArray<readonly T[]>): ReadonlyArray<readonly T[]>;
|
|
12
12
|
/**
|
|
13
13
|
* Helper function for determining if two arrays contain the exact same elements. Note that this
|
|
14
14
|
* only performs a shallow comparison.
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import type { WidenLiteral } from "../
|
|
6
|
+
import type { WidenLiteral } from "../types/WidenLiteral.js";
|
|
7
7
|
/**
|
|
8
8
|
* Helper function to copy a two-dimensional array. Note that the sub-arrays will only be shallow
|
|
9
9
|
* copied (using the spread operator).
|
|
10
10
|
*/
|
|
11
|
-
export declare function arrayCopyTwoDimensional<T>(array: ReadonlyArray<readonly T[]>): readonly T[]
|
|
11
|
+
export declare function arrayCopyTwoDimensional<T>(array: ReadonlyArray<readonly T[]>): ReadonlyArray<readonly T[]>;
|
|
12
12
|
/**
|
|
13
13
|
* Helper function for determining if two arrays contain the exact same elements. Note that this
|
|
14
14
|
* only performs a shallow comparison.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/functions/array.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/functions/array.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAI7D;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,KAAK,EAAE,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC,GACjC,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC,CAQ7B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,MAAM,EAAE,SAAS,CAAC,EAAE,EACpB,MAAM,EAAE,SAAS,CAAC,EAAE,GACnB,OAAO,CAST;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,aAAa,EAAE,SAAS,CAAC,EAAE,E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/D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAEzD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/functions/string.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/functions/string.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,kEAAkE;AAClE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAU5D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAO3D;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAqBlE;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAOpD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED,yFAAyF;AACzF,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAGhE;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAO3D;AAED,yEAAyE;AACzE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAiBtD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GACtD;IACE,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IAErB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IAErB,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;CACtB,GACD,SAAS,CAwBZ;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACb,MAAM,CAuBR;AAED,gGAAgG;AAChG,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAIzE;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,OAAO,UAAQ,GACd,MAAM,CAWR;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOjE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAMxE"}
|
package/dist/index.cjs
CHANGED
|
@@ -344,7 +344,7 @@ function todo(...args) {
|
|
|
344
344
|
const DIACRITIC_REGEX = /\p{Diacritic}/u;
|
|
345
345
|
const EMOJI_REGEX = /(\p{Extended_Pictographic}|\p{Emoji_Component})/u;
|
|
346
346
|
const FIRST_LETTER_CAPITALIZED_REGEX = /^\p{Lu}/u;
|
|
347
|
-
const KEBAB_CASE_REGEX = /^
|
|
347
|
+
const KEBAB_CASE_REGEX = /^[\da-z]+(?:-[\da-z]+)*$|^$/;
|
|
348
348
|
const SEMANTIC_VERSION_REGEX = /^v*(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/;
|
|
349
349
|
const WHITESPACE_REGEX = /\s/g;
|
|
350
350
|
function capitalizeFirstLetter(string) {
|
package/dist/index.mjs
CHANGED
|
@@ -342,7 +342,7 @@ function todo(...args) {
|
|
|
342
342
|
const DIACRITIC_REGEX = /\p{Diacritic}/u;
|
|
343
343
|
const EMOJI_REGEX = /(\p{Extended_Pictographic}|\p{Emoji_Component})/u;
|
|
344
344
|
const FIRST_LETTER_CAPITALIZED_REGEX = /^\p{Lu}/u;
|
|
345
|
-
const KEBAB_CASE_REGEX = /^
|
|
345
|
+
const KEBAB_CASE_REGEX = /^[\da-z]+(?:-[\da-z]+)*$|^$/;
|
|
346
346
|
const SEMANTIC_VERSION_REGEX = /^v*(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/;
|
|
347
347
|
const WHITESPACE_REGEX = /\s/g;
|
|
348
348
|
function capitalizeFirstLetter(string) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "complete-common",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Helper functions for TypeScript projects.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://complete-ts.github.io/",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"test": "glob \"./src/**/*.test.ts\" --cmd=\"node --import tsx --test --test-reporter spec\""
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/node": "22.
|
|
39
|
-
"complete-node": "5.1.
|
|
38
|
+
"@types/node": "22.14.1",
|
|
39
|
+
"complete-node": "5.1.3",
|
|
40
40
|
"eslint-plugin-sort-exports": "0.9.1",
|
|
41
41
|
"glob": "11.0.1",
|
|
42
|
-
"typescript": "5.8.
|
|
43
|
-
"typescript-eslint": "8.
|
|
42
|
+
"typescript": "5.8.3",
|
|
43
|
+
"typescript-eslint": "8.31.0",
|
|
44
44
|
"unbuild": "3.5.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/src/functions/array.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import type { WidenLiteral } from "../index.js";
|
|
8
7
|
import { ReadonlySet } from "../types/ReadonlySet.js";
|
|
8
|
+
import type { WidenLiteral } from "../types/WidenLiteral.js";
|
|
9
9
|
import { assertDefined } from "./assert.js";
|
|
10
10
|
import { getRandomInt } from "./random.js";
|
|
11
11
|
|
|
@@ -15,7 +15,7 @@ import { getRandomInt } from "./random.js";
|
|
|
15
15
|
*/
|
|
16
16
|
export function arrayCopyTwoDimensional<T>(
|
|
17
17
|
array: ReadonlyArray<readonly T[]>,
|
|
18
|
-
): readonly T[]
|
|
18
|
+
): ReadonlyArray<readonly T[]> {
|
|
19
19
|
const copiedArray: T[][] = [];
|
|
20
20
|
|
|
21
21
|
for (const subArray of array) {
|
package/src/functions/string.ts
CHANGED
|
@@ -15,11 +15,7 @@ const DIACRITIC_REGEX = /\p{Diacritic}/u;
|
|
|
15
15
|
const EMOJI_REGEX = /(\p{Extended_Pictographic}|\p{Emoji_Component})/u;
|
|
16
16
|
|
|
17
17
|
const FIRST_LETTER_CAPITALIZED_REGEX = /^\p{Lu}/u;
|
|
18
|
-
|
|
19
|
-
/** From: https://github.com/expandjs/expandjs/blob/master/lib/kebabCaseRegex.js */
|
|
20
|
-
const KEBAB_CASE_REGEX =
|
|
21
|
-
/^([a-z](?!\d)|\d(?![a-z]))+(-?([a-z](?!\d)|\d(?![a-z])))*$|^$/;
|
|
22
|
-
|
|
18
|
+
const KEBAB_CASE_REGEX = /^[\da-z]+(?:-[\da-z]+)*$|^$/;
|
|
23
19
|
const SEMANTIC_VERSION_REGEX = /^v*(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/;
|
|
24
20
|
const WHITESPACE_REGEX = /\s/g;
|
|
25
21
|
|