@agentuity/core 0.0.109 → 0.0.110
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/AGENTS.md +1 -0
- package/dist/string.d.ts +3 -1
- package/dist/string.d.ts.map +1 -1
- package/dist/string.js +6 -2
- package/dist/string.js.map +1 -1
- package/package.json +2 -2
- package/src/string.ts +7 -2
package/AGENTS.md
CHANGED
package/dist/string.d.ts
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Convert a string to camelCase
|
|
6
6
|
* @param str - The string to convert (can contain dashes, underscores, or spaces)
|
|
7
|
-
* @returns The camelCase version of the string
|
|
7
|
+
* @returns The camelCase version of the string (always a valid JS/TS identifier)
|
|
8
8
|
* @example
|
|
9
9
|
* toCamelCase('my-agent') // 'myAgent'
|
|
10
10
|
* toCamelCase('my_agent') // 'myAgent'
|
|
11
11
|
* toCamelCase('my agent') // 'myAgent'
|
|
12
12
|
* toCamelCase('my--multiple--dashes') // 'myMultipleDashes'
|
|
13
|
+
* toCamelCase('123-agent') // '_123Agent' (prefixed to make valid identifier)
|
|
14
|
+
* toCamelCase('123') // '_123' (prefixed to make valid identifier)
|
|
13
15
|
*/
|
|
14
16
|
export declare function toCamelCase(str: string): string;
|
|
15
17
|
/**
|
package/dist/string.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAO/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGhD"}
|
package/dist/string.js
CHANGED
|
@@ -4,17 +4,21 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Convert a string to camelCase
|
|
6
6
|
* @param str - The string to convert (can contain dashes, underscores, or spaces)
|
|
7
|
-
* @returns The camelCase version of the string
|
|
7
|
+
* @returns The camelCase version of the string (always a valid JS/TS identifier)
|
|
8
8
|
* @example
|
|
9
9
|
* toCamelCase('my-agent') // 'myAgent'
|
|
10
10
|
* toCamelCase('my_agent') // 'myAgent'
|
|
11
11
|
* toCamelCase('my agent') // 'myAgent'
|
|
12
12
|
* toCamelCase('my--multiple--dashes') // 'myMultipleDashes'
|
|
13
|
+
* toCamelCase('123-agent') // '_123Agent' (prefixed to make valid identifier)
|
|
14
|
+
* toCamelCase('123') // '_123' (prefixed to make valid identifier)
|
|
13
15
|
*/
|
|
14
16
|
export function toCamelCase(str) {
|
|
15
|
-
|
|
17
|
+
const result = str
|
|
16
18
|
.replace(/[-_\s]+(.)?/g, (_, char) => (char ? char.toUpperCase() : ''))
|
|
17
19
|
.replace(/^(.)/, (char) => char.toLowerCase());
|
|
20
|
+
// Prefix with underscore if result starts with a digit (invalid JS/TS identifier)
|
|
21
|
+
return /^\d/.test(result) ? `_${result}` : result;
|
|
18
22
|
}
|
|
19
23
|
/**
|
|
20
24
|
* Convert a string to PascalCase
|
package/dist/string.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.js","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW;IACtC,MAAM,MAAM,GAAG,GAAG;SAChB,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACtE,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAEhD,kFAAkF;IAClF,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AACnD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACvC,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentuity/core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.110",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Agentuity employees and contributors",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"zod": "^4.1.12"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@agentuity/test-utils": "0.0.
|
|
35
|
+
"@agentuity/test-utils": "0.0.110",
|
|
36
36
|
"@types/bun": "latest",
|
|
37
37
|
"bun-types": "latest",
|
|
38
38
|
"typescript": "^5.9.0"
|
package/src/string.ts
CHANGED
|
@@ -5,17 +5,22 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* Convert a string to camelCase
|
|
7
7
|
* @param str - The string to convert (can contain dashes, underscores, or spaces)
|
|
8
|
-
* @returns The camelCase version of the string
|
|
8
|
+
* @returns The camelCase version of the string (always a valid JS/TS identifier)
|
|
9
9
|
* @example
|
|
10
10
|
* toCamelCase('my-agent') // 'myAgent'
|
|
11
11
|
* toCamelCase('my_agent') // 'myAgent'
|
|
12
12
|
* toCamelCase('my agent') // 'myAgent'
|
|
13
13
|
* toCamelCase('my--multiple--dashes') // 'myMultipleDashes'
|
|
14
|
+
* toCamelCase('123-agent') // '_123Agent' (prefixed to make valid identifier)
|
|
15
|
+
* toCamelCase('123') // '_123' (prefixed to make valid identifier)
|
|
14
16
|
*/
|
|
15
17
|
export function toCamelCase(str: string): string {
|
|
16
|
-
|
|
18
|
+
const result = str
|
|
17
19
|
.replace(/[-_\s]+(.)?/g, (_, char) => (char ? char.toUpperCase() : ''))
|
|
18
20
|
.replace(/^(.)/, (char) => char.toLowerCase());
|
|
21
|
+
|
|
22
|
+
// Prefix with underscore if result starts with a digit (invalid JS/TS identifier)
|
|
23
|
+
return /^\d/.test(result) ? `_${result}` : result;
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
/**
|