@opencode/codemode 0.0.0-dev-19433 → 0.0.0-dev-19435
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/interpreter/methods.js +11 -0
- package/dist/stdlib/date.js +6 -0
- package/dist/stdlib/string.js +5 -0
- package/package.json +1 -1
|
@@ -92,9 +92,11 @@ const invokeStringMethod = (value, name, args, node) => {
|
|
|
92
92
|
result = value.trim();
|
|
93
93
|
break;
|
|
94
94
|
case "trimStart":
|
|
95
|
+
case "trimLeft":
|
|
95
96
|
result = value.trimStart();
|
|
96
97
|
break;
|
|
97
98
|
case "trimEnd":
|
|
99
|
+
case "trimRight":
|
|
98
100
|
result = value.trimEnd();
|
|
99
101
|
break;
|
|
100
102
|
// Locale/options are deliberately unsupported; comparison uses the host default locale.
|
|
@@ -209,6 +211,15 @@ const invokeStringMethod = (value, name, args, node) => {
|
|
|
209
211
|
case "substring":
|
|
210
212
|
result = value.substring(optNum(0) ?? 0, optNum(1));
|
|
211
213
|
break;
|
|
214
|
+
case "substr":
|
|
215
|
+
result = value.substr(optNum(0) ?? 0, optNum(1));
|
|
216
|
+
break;
|
|
217
|
+
case "isWellFormed":
|
|
218
|
+
result = value.isWellFormed();
|
|
219
|
+
break;
|
|
220
|
+
case "toWellFormed":
|
|
221
|
+
result = value.toWellFormed();
|
|
222
|
+
break;
|
|
212
223
|
case "charCodeAt":
|
|
213
224
|
result = value.charCodeAt(optNum(0) ?? 0);
|
|
214
225
|
break;
|
package/dist/stdlib/date.js
CHANGED
|
@@ -27,6 +27,8 @@ export const dateMethods = new Set([
|
|
|
27
27
|
"toISOString",
|
|
28
28
|
"toJSON",
|
|
29
29
|
"toString",
|
|
30
|
+
"toDateString",
|
|
31
|
+
"toTimeString",
|
|
30
32
|
"toUTCString",
|
|
31
33
|
"toGMTString",
|
|
32
34
|
"getFullYear",
|
|
@@ -89,6 +91,10 @@ export const invokeDateMethod = (value, name, args, node, initialTime = value.ti
|
|
|
89
91
|
return Number.isFinite(value.time) ? hosted.toISOString() : null;
|
|
90
92
|
case "toString":
|
|
91
93
|
return coerceToString(value);
|
|
94
|
+
case "toDateString":
|
|
95
|
+
return hosted.toDateString();
|
|
96
|
+
case "toTimeString":
|
|
97
|
+
return hosted.toTimeString();
|
|
92
98
|
case "toUTCString":
|
|
93
99
|
case "toGMTString":
|
|
94
100
|
return hosted.toUTCString();
|
package/dist/stdlib/string.js
CHANGED
|
@@ -7,9 +7,12 @@ export const stringMethods = new Set([
|
|
|
7
7
|
"trim",
|
|
8
8
|
"trimStart",
|
|
9
9
|
"trimEnd",
|
|
10
|
+
"trimLeft",
|
|
11
|
+
"trimRight",
|
|
10
12
|
"split",
|
|
11
13
|
"slice",
|
|
12
14
|
"substring",
|
|
15
|
+
"substr",
|
|
13
16
|
"includes",
|
|
14
17
|
"startsWith",
|
|
15
18
|
"endsWith",
|
|
@@ -31,6 +34,8 @@ export const stringMethods = new Set([
|
|
|
31
34
|
"search",
|
|
32
35
|
"localeCompare",
|
|
33
36
|
"normalize",
|
|
37
|
+
"isWellFormed",
|
|
38
|
+
"toWellFormed",
|
|
34
39
|
]);
|
|
35
40
|
const codeUnits = (name, op) => sync(`String.${name}`, (args, node) => op(...args.map((arg) => {
|
|
36
41
|
if (typeof arg !== "number")
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/codemode",
|
|
4
|
-
"version": "0.0.0-dev-
|
|
4
|
+
"version": "0.0.0-dev-19435",
|
|
5
5
|
"description": "Effect-native confined code execution over schema-described tools",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|