inferred-types 0.51.3 → 0.51.4

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 CHANGED
@@ -557,6 +557,7 @@ __export(inferred_types_exports, {
557
557
  stripBefore: () => stripBefore,
558
558
  stripChars: () => stripChars,
559
559
  stripLeading: () => stripLeading,
560
+ stripParenthesis: () => stripParenthesis,
560
561
  stripSurround: () => stripSurround,
561
562
  stripTrailing: () => stripTrailing,
562
563
  stripUntil: () => stripUntil,
@@ -3889,6 +3890,11 @@ var jsonValues = (...val) => {
3889
3890
  return val.map((i) => jsonValue(i));
3890
3891
  };
3891
3892
 
3893
+ // src/runtime/type-conversion/stripParenthesis.ts
3894
+ var stripParenthesis = (val) => {
3895
+ return stripTrailing(stripLeading(val.trim(), "("), ")").trim();
3896
+ };
3897
+
3892
3898
  // src/runtime/type-guards/hasWhitespace.ts
3893
3899
  var hasWhiteSpace = (val) => {
3894
3900
  return isString(val) && asChars(val).some((c) => WHITESPACE_CHARS.includes(c));
@@ -4714,7 +4720,7 @@ function toCamelCase(input, preserveWhitespace) {
4714
4720
  }
4715
4721
 
4716
4722
  // src/runtime/literals/toKebabCase.ts
4717
- function toKebabCase(input, _preserveWhitespace) {
4723
+ function toKebabCase(input, _preserveWhitespace = false) {
4718
4724
  const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(input);
4719
4725
  const replaceWhitespace = (i) => i.replace(/\s/gs, "-");
4720
4726
  const replaceUppercase = (i) => i.replace(/[A-Z]/g, (c) => `-${c[0].toLowerCase()}`);
@@ -4989,7 +4995,7 @@ function kindError(kind, baseContext = {}) {
4989
4995
  file: i.file ? (0, import_pathe.relative)(process.cwd(), i.file) : void 0
4990
4996
  }));
4991
4997
  err.name = toPascalCase(kind);
4992
- err.kind = toKebabCase(kind);
4998
+ err.kind = toKebabCase(stripChars(kind, "<", ">", "[", "]", "(", ")"));
4993
4999
  err.file = stackTrace[0].file;
4994
5000
  err.line = stackTrace[0].line;
4995
5001
  err.col = stackTrace[0].col;
@@ -6236,6 +6242,7 @@ var asVueRef = (value) => ({
6236
6242
  stripBefore,
6237
6243
  stripChars,
6238
6244
  stripLeading,
6245
+ stripParenthesis,
6239
6246
  stripSurround,
6240
6247
  stripTrailing,
6241
6248
  stripUntil,
package/dist/index.js CHANGED
@@ -3287,6 +3287,11 @@ var jsonValues = (...val) => {
3287
3287
  return val.map((i) => jsonValue(i));
3288
3288
  };
3289
3289
 
3290
+ // src/runtime/type-conversion/stripParenthesis.ts
3291
+ var stripParenthesis = (val) => {
3292
+ return stripTrailing(stripLeading(val.trim(), "("), ")").trim();
3293
+ };
3294
+
3290
3295
  // src/runtime/type-guards/hasWhitespace.ts
3291
3296
  var hasWhiteSpace = (val) => {
3292
3297
  return isString(val) && asChars(val).some((c) => WHITESPACE_CHARS.includes(c));
@@ -4112,7 +4117,7 @@ function toCamelCase(input, preserveWhitespace) {
4112
4117
  }
4113
4118
 
4114
4119
  // src/runtime/literals/toKebabCase.ts
4115
- function toKebabCase(input, _preserveWhitespace) {
4120
+ function toKebabCase(input, _preserveWhitespace = false) {
4116
4121
  const [_, preWhite, focus, postWhite] = /^(\s*)(.*?)(\s*)$/.exec(input);
4117
4122
  const replaceWhitespace = (i) => i.replace(/\s/gs, "-");
4118
4123
  const replaceUppercase = (i) => i.replace(/[A-Z]/g, (c) => `-${c[0].toLowerCase()}`);
@@ -4387,7 +4392,7 @@ function kindError(kind, baseContext = {}) {
4387
4392
  file: i.file ? relative(process.cwd(), i.file) : void 0
4388
4393
  }));
4389
4394
  err.name = toPascalCase(kind);
4390
- err.kind = toKebabCase(kind);
4395
+ err.kind = toKebabCase(stripChars(kind, "<", ">", "[", "]", "(", ")"));
4391
4396
  err.file = stackTrace[0].file;
4392
4397
  err.line = stackTrace[0].line;
4393
4398
  err.col = stackTrace[0].col;
@@ -5633,6 +5638,7 @@ export {
5633
5638
  stripBefore,
5634
5639
  stripChars,
5635
5640
  stripLeading,
5641
+ stripParenthesis,
5636
5642
  stripSurround,
5637
5643
  stripTrailing,
5638
5644
  stripUntil,