inferred-types 0.51.3 → 0.51.5
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/index.cjs +76 -2
- package/dist/index.js +68 -2
- package/dist/inferred-types/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/errors/KindError.d.ts.map +1 -1
- package/dist/runtime/errors/KindError.js +2 -2
- package/dist/runtime/literals/stripChars.d.ts +2 -2
- package/dist/runtime/literals/stripChars.d.ts.map +1 -1
- package/dist/runtime/literals/stripChars.js +1 -1
- package/dist/runtime/literals/toKebabCase.d.ts.map +1 -1
- package/dist/runtime/literals/toKebabCase.js +1 -1
- package/dist/runtime/tsconfig.tsbuildinfo +1 -1
- package/dist/runtime/type-conversion/index.d.ts +1 -0
- package/dist/runtime/type-conversion/index.d.ts.map +1 -1
- package/dist/runtime/type-conversion/index.js +1 -0
- package/dist/runtime/type-conversion/stripParenthesis.d.ts +9 -0
- package/dist/runtime/type-conversion/stripParenthesis.d.ts.map +1 -0
- package/dist/runtime/type-conversion/stripParenthesis.js +10 -0
- package/dist/runtime/type-guards/date-time/index.d.ts +4 -0
- package/dist/runtime/type-guards/date-time/index.d.ts.map +1 -0
- package/dist/runtime/type-guards/date-time/index.js +3 -0
- package/dist/runtime/type-guards/date-time/isDateTime.d.ts +3 -0
- package/dist/runtime/type-guards/date-time/isDateTime.d.ts.map +1 -0
- package/dist/runtime/type-guards/date-time/isDateTime.js +4 -0
- package/dist/runtime/type-guards/date-time/isIsoDate.d.ts +23 -0
- package/dist/runtime/type-guards/date-time/isIsoDate.d.ts.map +1 -0
- package/dist/runtime/type-guards/date-time/isIsoDate.js +53 -0
- package/dist/runtime/type-guards/date-time/isIsoTime.d.ts +8 -0
- package/dist/runtime/type-guards/date-time/isIsoTime.d.ts.map +1 -0
- package/dist/runtime/type-guards/date-time/isIsoTime.js +25 -0
- package/dist/runtime/type-guards/index.d.ts +1 -0
- package/dist/runtime/type-guards/index.d.ts.map +1 -1
- package/dist/runtime/type-guards/index.js +1 -0
- package/dist/types/errors/KindError.d.ts +2 -2
- package/dist/types/errors/KindError.d.ts.map +1 -1
- package/dist/types/string-literals/DateTime.d.ts +59 -1
- package/dist/types/string-literals/DateTime.d.ts.map +1 -1
- package/dist/types/string-literals/casing/KebabCase.d.ts +7 -5
- package/dist/types/string-literals/casing/KebabCase.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/type-conversion/StripChars.d.ts +1 -1
- package/dist/types/type-conversion/StripChars.d.ts.map +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KindError.d.ts","sourceRoot":"","sources":["../../../src/runtime/errors/KindError.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"KindError.d.ts","sourceRoot":"","sources":["../../../src/runtime/errors/KindError.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,aAAa,EAEb,UAAU,EACX,MAAM,iCAAiC,CAAC;AAazC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,SAAS,CACvB,KAAK,SAAS,MAAM,EACpB,YAAY,SAAS,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,EACvC,EAAE,SAAS,UAAU,GAAG,UAAU,EAElC,IAAI,EAAE,KAAK,EACX,WAAW,GAAE,YAAgD,GAC5D,aAAa,CACd,KAAK,EACL,YAAY,CACb,CA0CA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toKebabCase, toPascalCase } from "../literals";
|
|
1
|
+
import { stripChars, toKebabCase, toPascalCase } from "../literals";
|
|
2
2
|
import { parse } from "error-stack-parser-es/lite";
|
|
3
3
|
import { relative } from "pathe";
|
|
4
4
|
const IGNORABLES = [
|
|
@@ -44,7 +44,7 @@ export function kindError(kind, baseContext = {}) {
|
|
|
44
44
|
: undefined
|
|
45
45
|
}));
|
|
46
46
|
err.name = toPascalCase(kind);
|
|
47
|
-
err.kind = toKebabCase(kind);
|
|
47
|
+
err.kind = toKebabCase(stripChars(kind, "<", ">", "[", "]", "(", ")"));
|
|
48
48
|
err.file = stackTrace[0].file;
|
|
49
49
|
err.line = stackTrace[0].line;
|
|
50
50
|
err.col = stackTrace[0].col;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StripChars
|
|
1
|
+
import { StripChars } from "inferred-types/dist/types/index";
|
|
2
2
|
/**
|
|
3
3
|
* **stripChars**`(content, ...strip)`
|
|
4
4
|
*
|
|
@@ -6,5 +6,5 @@ import { StripChars, TupleToUnion } from "inferred-types/dist/types/index";
|
|
|
6
6
|
*
|
|
7
7
|
* **Related:** `retainChars()`
|
|
8
8
|
*/
|
|
9
|
-
export declare const stripChars: <TContent extends string, TRetain extends readonly string[]>(content: TContent, ...strip: TRetain) => StripChars<TContent,
|
|
9
|
+
export declare const stripChars: <TContent extends string, TRetain extends readonly string[]>(content: TContent, ...strip: TRetain) => StripChars<TContent, TRetain[number]>;
|
|
10
10
|
//# sourceMappingURL=stripChars.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripChars.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/stripChars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"stripChars.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/stripChars.ts"],"names":[],"mappings":"AAAA,OAAO,EAAG,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG9D;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GACrB,QAAQ,SAAS,MAAM,EACvB,OAAO,SAAS,SAAS,MAAM,EAAE,WAExB,QAAQ,YACP,OAAO,KAChB,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAMtC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toKebabCase.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/toKebabCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,OAAO,GAAG,KAAK,EACzB,KAAK,EAAE,CAAC,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"toKebabCase.d.ts","sourceRoot":"","sources":["../../../src/runtime/literals/toKebabCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAE5D;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CACzB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,OAAO,GAAG,KAAK,EACzB,KAAK,EAAE,CAAC,EAAE,mBAAmB,GAAE,CAAc,GAcd,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,CAC9C"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* **Related:** `toPascalCase`, `toCamelCase`, `toSnakeCase`
|
|
10
10
|
*/
|
|
11
|
-
export function toKebabCase(input, _preserveWhitespace) {
|
|
11
|
+
export function toKebabCase(input, _preserveWhitespace = false) {
|
|
12
12
|
const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(input);
|
|
13
13
|
const replaceWhitespace = (i) => i.replace(/\s/gs, "-");
|
|
14
14
|
const replaceUppercase = (i) => i.replace(/[A-Z]/g, (c) => `-${c[0].toLowerCase()}`);
|