@augment-vir/common 31.64.1 → 31.65.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.
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes a prefix from a string type.
|
|
3
|
+
*
|
|
4
|
+
* @category Type
|
|
5
|
+
* @category Package : @augment-vir/common
|
|
6
|
+
* @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
|
|
7
|
+
*/
|
|
8
|
+
export type RemovePrefix<Original extends string, Prefix extends string> = Prefix extends unknown ? Original extends `${Prefix}${infer Rest}` ? Rest : never : never;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes a tuple of suffixes from a string. Note that the suffix removal happens in order, so
|
|
3
|
+
* place your longest suffixes first.
|
|
4
|
+
*
|
|
5
|
+
* @category Type
|
|
6
|
+
* @category Package : @augment-vir/common
|
|
7
|
+
* @package [`@augment-vir/common`](https://www.npmjs.com/package/@augment-vir/common)
|
|
8
|
+
*/
|
|
9
|
+
export type RemoveSuffix<Original extends string, Suffixes extends readonly string[]> = Suffixes extends readonly [infer First extends string, ...infer Rest extends string[]] ? Original extends `${infer Prefix}-${First}` ? Prefix : RemoveSuffix<Original, Rest> : Original;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -98,6 +98,8 @@ export * from './augments/type/boolean.js';
|
|
|
98
98
|
export * from './augments/type/ensure-type.js';
|
|
99
99
|
export * from './augments/type/partial.js';
|
|
100
100
|
export * from './augments/type/readonly.js';
|
|
101
|
+
export * from './augments/type/remove-prefix.js';
|
|
102
|
+
export * from './augments/type/remove-suffix.js';
|
|
101
103
|
export * from './augments/type/type-recursion.js';
|
|
102
104
|
export * from './augments/type/union.js';
|
|
103
105
|
export * from './augments/type/void-type.js';
|
package/dist/index.js
CHANGED
|
@@ -98,6 +98,8 @@ export * from './augments/type/boolean.js';
|
|
|
98
98
|
export * from './augments/type/ensure-type.js';
|
|
99
99
|
export * from './augments/type/partial.js';
|
|
100
100
|
export * from './augments/type/readonly.js';
|
|
101
|
+
export * from './augments/type/remove-prefix.js';
|
|
102
|
+
export * from './augments/type/remove-suffix.js';
|
|
101
103
|
export * from './augments/type/type-recursion.js';
|
|
102
104
|
export * from './augments/type/union.js';
|
|
103
105
|
export * from './augments/type/void-type.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@augment-vir/common",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.65.0",
|
|
4
4
|
"description": "A collection of augments, helpers types, functions, and classes for any JavaScript environment.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"augment",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"test:web": "virmator --no-deps test web"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@augment-vir/assert": "^31.
|
|
44
|
-
"@augment-vir/core": "^31.
|
|
43
|
+
"@augment-vir/assert": "^31.65.0",
|
|
44
|
+
"@augment-vir/core": "^31.65.0",
|
|
45
45
|
"@date-vir/duration": "^8.1.1",
|
|
46
46
|
"ansi-styles": "^6.2.3",
|
|
47
47
|
"deepcopy-esm": "^2.1.1",
|