kyro-connect 0.1.2 → 0.1.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.
@@ -7,9 +7,11 @@ var import_path = require("path");
7
7
 
8
8
  // src/codegen.ts
9
9
  function capitalize(s) {
10
+ if (typeof s !== "string") return "";
10
11
  return s.replace(/[-_]\w/g, (m) => m[1].toUpperCase()).replace(/^\w/, (c) => c.toUpperCase());
11
12
  }
12
13
  function toTSName(slug) {
14
+ if (typeof slug !== "string") return "";
13
15
  return slug.replace(/[-_]\w/g, (m) => m[1].toUpperCase()).replace(/^_+/g, "");
14
16
  }
15
17
  function fieldToTS(field, depth = 0) {
@@ -6,9 +6,11 @@ import { resolve } from "path";
6
6
 
7
7
  // src/codegen.ts
8
8
  function capitalize(s) {
9
+ if (typeof s !== "string") return "";
9
10
  return s.replace(/[-_]\w/g, (m) => m[1].toUpperCase()).replace(/^\w/, (c) => c.toUpperCase());
10
11
  }
11
12
  function toTSName(slug) {
13
+ if (typeof slug !== "string") return "";
12
14
  return slug.replace(/[-_]\w/g, (m) => m[1].toUpperCase()).replace(/^_+/g, "");
13
15
  }
14
16
  function fieldToTS(field, depth = 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kyro-connect",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Universal SDK for Kyro CMS. Type-safe client + codegen for any platform.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -36,4 +36,4 @@
36
36
  "tsup": "^8.0.0",
37
37
  "typescript": "^5.0.0"
38
38
  }
39
- }
39
+ }