inferred-types 0.45.2 → 0.45.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/inferred-types/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/literals/retainAfter.d.ts +1 -1
- package/dist/runtime/literals/retainAfter.js +1 -1
- package/dist/runtime/literals/retainWhile.d.ts +1 -2
- package/dist/runtime/literals/retainWhile.d.ts.map +1 -1
- package/dist/runtime/literals/retainWhile.js +2 -1
- package/dist/runtime/literals/stripUntil.d.ts +9 -0
- package/dist/runtime/literals/stripUntil.d.ts.map +1 -0
- package/dist/runtime/literals/stripUntil.js +12 -0
- package/dist/runtime/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RetainAfter } from "../../types/index";
|
|
2
2
|
/**
|
|
3
|
-
* **
|
|
3
|
+
* **retainAfter**(content, find)
|
|
4
4
|
*
|
|
5
5
|
* Runtime utility which removes all characters in a given string _until_
|
|
6
6
|
* it finds the first instance of a substring defined in **find** variable.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"retainWhile.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/retainWhile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"retainWhile.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/retainWhile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,WAAW,EAAE,YAAY,EAAE,0BAAwB;AAI7D;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,wEAIb,QAAQ,aACN,OAAO,iDAMnB,CAAA"}
|
|
@@ -7,6 +7,7 @@ import { asChars } from "../type-conversion/index.js";
|
|
|
7
7
|
* passed in for `retain[]`
|
|
8
8
|
*/
|
|
9
9
|
export const retainWhile = (content, ...retain) => {
|
|
10
|
-
const stopIdx = asChars(content)
|
|
10
|
+
const stopIdx = asChars(content)
|
|
11
|
+
.findIndex(c => !retain.includes(c));
|
|
11
12
|
return content.slice(0, stopIdx);
|
|
12
13
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TupleToUnion, StripUntil } from "../../types/index";
|
|
2
|
+
/**
|
|
3
|
+
* **stripUntil**`(content, ...until)`
|
|
4
|
+
*
|
|
5
|
+
* Strips the characters at the start of the string
|
|
6
|
+
* until a character specified in `until` is found.
|
|
7
|
+
*/
|
|
8
|
+
export declare const stripUntil: <TContent extends string, TUntil extends readonly string[]>(content: TContent, ...until: TUntil) => StripUntil<TContent, TupleToUnion<TUntil>>;
|
|
9
|
+
//# sourceMappingURL=stripUntil.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripUntil.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/stripUntil.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAC,UAAU,EAAE,0BAAwB;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,UAAU,uEAGZ,QAAQ,YAAY,MAAM,+CAKpC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { asChars } from "../type-conversion/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* **stripUntil**`(content, ...until)`
|
|
4
|
+
*
|
|
5
|
+
* Strips the characters at the start of the string
|
|
6
|
+
* until a character specified in `until` is found.
|
|
7
|
+
*/
|
|
8
|
+
export const stripUntil = (content, ...until) => {
|
|
9
|
+
const stopIdx = asChars(content)
|
|
10
|
+
.findIndex(c => until.includes(c));
|
|
11
|
+
return content.slice(stopIdx);
|
|
12
|
+
};
|