inferred-types 0.41.5 → 0.42.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/LICENSE +20 -0
- package/dist/constants/tsconfig.tsbuildinfo +1 -1
- package/dist/inferred-types/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/literals/ensureSurround.d.ts +15 -0
- package/dist/runtime/literals/ensureSurround.d.ts.map +1 -0
- package/dist/runtime/literals/ensureSurround.js +15 -0
- package/dist/runtime/literals/index.d.ts +1 -0
- package/dist/runtime/literals/index.d.ts.map +1 -1
- package/dist/runtime/literals/index.js +1 -0
- package/dist/runtime/literals/surround.d.ts +2 -0
- package/dist/runtime/literals/surround.d.ts.map +1 -1
- package/dist/runtime/literals/surround.js +2 -0
- package/dist/runtime/tsconfig.tsbuildinfo +1 -1
- package/dist/types/string-literals/StripAfter.d.ts +2 -2
- package/dist/types/string-literals/StripAfter.d.ts.map +1 -1
- package/dist/types/string-literals/StripBefore.d.ts +2 -5
- package/dist/types/string-literals/StripBefore.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +15 -10
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IfStringLiteral } from "../index";
|
|
2
2
|
/**
|
|
3
3
|
* **StripAfter**`<TStr, TBreak>`
|
|
4
4
|
*
|
|
@@ -11,5 +11,5 @@ import { AsTuple, First, Split } from "../index";
|
|
|
11
11
|
* type T = StripAfter<"hello world", " ">;
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export type StripAfter<TStr extends string, TBreak extends string> =
|
|
14
|
+
export type StripAfter<TStr extends string, TBreak extends string> = IfStringLiteral<TStr, IfStringLiteral<TBreak, TStr extends `${infer Before}${TBreak}${string}` ? Before : TStr, string>, string>;
|
|
15
15
|
//# sourceMappingURL=StripAfter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripAfter.d.ts","sourceRoot":"","sources":["../../../src/types/string-literals/StripAfter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,
|
|
1
|
+
{"version":3,"file":"StripAfter.d.ts","sourceRoot":"","sources":["../../../src/types/string-literals/StripAfter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,eAAe,EAAE,iBAAwB;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,UAAU,CACpB,IAAI,SAAS,MAAM,EACnB,MAAM,SAAS,MAAM,IACnB,eAAe,CACjB,IAAI,EACJ,eAAe,CACb,MAAM,EACN,IAAI,SAAS,GAAG,MAAM,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,GAC5C,MAAM,GACN,IAAI,EACR,MAAM,CACP,EACD,MAAM,CACP,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IfStringLiteral } from "../index";
|
|
2
2
|
/**
|
|
3
3
|
* **StripBefore**`<TStr, TBreak>`
|
|
4
4
|
*
|
|
@@ -11,8 +11,5 @@ import { IfAllLiteral } from "../index";
|
|
|
11
11
|
* type T = StripBefore<"hello world", " ">;
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export type StripBefore<TStr extends string, TBreak extends string> =
|
|
15
|
-
TStr,
|
|
16
|
-
TBreak
|
|
17
|
-
], TStr extends `${string}${TBreak}${infer REST}` ? `${REST}` : TStr, string>;
|
|
14
|
+
export type StripBefore<TStr extends string, TBreak extends string> = IfStringLiteral<TStr, IfStringLiteral<TBreak, TStr extends `${string}${TBreak}${infer REST}` ? `${REST}` : TStr, string>, string>;
|
|
18
15
|
//# sourceMappingURL=StripBefore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripBefore.d.ts","sourceRoot":"","sources":["../../../src/types/string-literals/StripBefore.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"StripBefore.d.ts","sourceRoot":"","sources":["../../../src/types/string-literals/StripBefore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,eAAe,EAAE,iBAAwB;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,CACrB,IAAI,SAAS,MAAM,EACnB,MAAM,SAAS,MAAM,IACnB,eAAe,CACjB,IAAI,EACJ,eAAe,CACb,MAAM,EACN,IAAI,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,IAAI,EAAE,GAC1C,GAAG,IAAI,EAAE,GACT,IAAI,EACR,MAAM,CACP,EACD,MAAM,CACP,CAAA"}
|