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.
Files changed (42) hide show
  1. package/dist/index.cjs +76 -2
  2. package/dist/index.js +68 -2
  3. package/dist/inferred-types/tsconfig.tsbuildinfo +1 -1
  4. package/dist/runtime/errors/KindError.d.ts.map +1 -1
  5. package/dist/runtime/errors/KindError.js +2 -2
  6. package/dist/runtime/literals/stripChars.d.ts +2 -2
  7. package/dist/runtime/literals/stripChars.d.ts.map +1 -1
  8. package/dist/runtime/literals/stripChars.js +1 -1
  9. package/dist/runtime/literals/toKebabCase.d.ts.map +1 -1
  10. package/dist/runtime/literals/toKebabCase.js +1 -1
  11. package/dist/runtime/tsconfig.tsbuildinfo +1 -1
  12. package/dist/runtime/type-conversion/index.d.ts +1 -0
  13. package/dist/runtime/type-conversion/index.d.ts.map +1 -1
  14. package/dist/runtime/type-conversion/index.js +1 -0
  15. package/dist/runtime/type-conversion/stripParenthesis.d.ts +9 -0
  16. package/dist/runtime/type-conversion/stripParenthesis.d.ts.map +1 -0
  17. package/dist/runtime/type-conversion/stripParenthesis.js +10 -0
  18. package/dist/runtime/type-guards/date-time/index.d.ts +4 -0
  19. package/dist/runtime/type-guards/date-time/index.d.ts.map +1 -0
  20. package/dist/runtime/type-guards/date-time/index.js +3 -0
  21. package/dist/runtime/type-guards/date-time/isDateTime.d.ts +3 -0
  22. package/dist/runtime/type-guards/date-time/isDateTime.d.ts.map +1 -0
  23. package/dist/runtime/type-guards/date-time/isDateTime.js +4 -0
  24. package/dist/runtime/type-guards/date-time/isIsoDate.d.ts +23 -0
  25. package/dist/runtime/type-guards/date-time/isIsoDate.d.ts.map +1 -0
  26. package/dist/runtime/type-guards/date-time/isIsoDate.js +53 -0
  27. package/dist/runtime/type-guards/date-time/isIsoTime.d.ts +8 -0
  28. package/dist/runtime/type-guards/date-time/isIsoTime.d.ts.map +1 -0
  29. package/dist/runtime/type-guards/date-time/isIsoTime.js +25 -0
  30. package/dist/runtime/type-guards/index.d.ts +1 -0
  31. package/dist/runtime/type-guards/index.d.ts.map +1 -1
  32. package/dist/runtime/type-guards/index.js +1 -0
  33. package/dist/types/errors/KindError.d.ts +2 -2
  34. package/dist/types/errors/KindError.d.ts.map +1 -1
  35. package/dist/types/string-literals/DateTime.d.ts +59 -1
  36. package/dist/types/string-literals/DateTime.d.ts.map +1 -1
  37. package/dist/types/string-literals/casing/KebabCase.d.ts +7 -5
  38. package/dist/types/string-literals/casing/KebabCase.d.ts.map +1 -1
  39. package/dist/types/tsconfig.tsbuildinfo +1 -1
  40. package/dist/types/type-conversion/StripChars.d.ts +1 -1
  41. package/dist/types/type-conversion/StripChars.d.ts.map +1 -1
  42. 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,EASL,aAAa,EAEb,UAAU,EACX,MAAM,iCAAiC,CAAC;AA6BzC;;;;;;;;;;;;;;;;;;;;;;;;;;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,CA6CA"}
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, TupleToUnion } from "inferred-types/dist/types/index";
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, TupleToUnion<TRetain>>;
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,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAG5E;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GACrB,QAAQ,SAAS,MAAM,EACvB,OAAO,SAAS,SAAS,MAAM,EAAE,WAExB,QAAQ,YACP,OAAO,KAChB,UAAU,CAAC,QAAQ,EAAE,YAAY,CAAC,OAAO,CAAC,CAM5C,CAAA"}
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,4 +1,4 @@
1
- import { asChars } from "src/runtime/index";
1
+ import { asChars } from "inferred-types/dist/runtime/index";
2
2
  /**
3
3
  * **stripChars**`(content, ...strip)`
4
4
  *
@@ -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,CAAC,EAAE,CAAC,GAcF,SAAS,CAAC,CAAC,EAAC,CAAC,CAAC,CAC9C"}
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()}`);