tova 0.11.12 → 0.11.21
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/package.json +1 -1
- package/src/analyzer/analyzer.js +5 -3
- package/src/cli/doctor.js +3 -3
- package/src/lsp/server.js +16 -8
- package/src/runtime/string-proto.js +3 -0
- package/src/version.js +1 -1
package/package.json
CHANGED
package/src/analyzer/analyzer.js
CHANGED
|
@@ -168,9 +168,11 @@ export class Analyzer {
|
|
|
168
168
|
// Async
|
|
169
169
|
'sleep',
|
|
170
170
|
// String functions
|
|
171
|
-
'upper', 'lower', 'contains', '
|
|
172
|
-
'
|
|
173
|
-
'
|
|
171
|
+
'upper', 'lower', 'contains', 'startsWith', 'endsWith',
|
|
172
|
+
'starts_with', 'ends_with',
|
|
173
|
+
'chars', 'words', 'lines', 'capitalize', 'titleCase',
|
|
174
|
+
'snakeCase', 'camelCase',
|
|
175
|
+
'title_case', 'snake_case', 'camel_case',
|
|
174
176
|
// Math extras
|
|
175
177
|
'min', 'max',
|
|
176
178
|
// Table operations
|
package/src/cli/doctor.js
CHANGED
|
@@ -28,12 +28,12 @@ export async function doctorCommand() {
|
|
|
28
28
|
|
|
29
29
|
// 2. Bun availability
|
|
30
30
|
try {
|
|
31
|
-
const bunProc = _compatSpawnSync('bun', ['--version'], { stdout: 'pipe', stderr: 'pipe' });
|
|
31
|
+
const bunProc = _compatSpawnSync('bun', ['--version'], { stdout: 'pipe', stderr: 'pipe', timeout: 10000 });
|
|
32
32
|
const bunVer = (bunProc.stdout || '').toString().trim();
|
|
33
33
|
if ((bunProc.exitCode ?? bunProc.status) === 0 && bunVer) {
|
|
34
34
|
const major = parseInt(bunVer.split('.')[0], 10);
|
|
35
35
|
if (major >= 1) {
|
|
36
|
-
const whichProc = _compatSpawnSync('which', ['bun'], { stdout: 'pipe', stderr: 'pipe' });
|
|
36
|
+
const whichProc = _compatSpawnSync('which', ['bun'], { stdout: 'pipe', stderr: 'pipe', timeout: 5000 });
|
|
37
37
|
pass(`Bun v${bunVer}`, (whichProc.stdout || '').toString().trim());
|
|
38
38
|
} else {
|
|
39
39
|
warn(`Bun v${bunVer}`, 'Bun >= 1.0 recommended');
|
|
@@ -82,7 +82,7 @@ export async function doctorCommand() {
|
|
|
82
82
|
|
|
83
83
|
// 5. git
|
|
84
84
|
try {
|
|
85
|
-
const gitProc = _compatSpawnSync('git', ['--version'], { stdout: 'pipe', stderr: 'pipe' });
|
|
85
|
+
const gitProc = _compatSpawnSync('git', ['--version'], { stdout: 'pipe', stderr: 'pipe', timeout: 10000 });
|
|
86
86
|
if ((gitProc.exitCode ?? gitProc.status) === 0) {
|
|
87
87
|
const gitVer = (gitProc.stdout || '').toString().trim();
|
|
88
88
|
pass('git available', gitVer);
|
package/src/lsp/server.js
CHANGED
|
@@ -872,18 +872,26 @@ class TovaLanguageServer {
|
|
|
872
872
|
'upper': '`fn upper(s) -> String` — Convert to uppercase',
|
|
873
873
|
'lower': '`fn lower(s) -> String` — Convert to lowercase',
|
|
874
874
|
'contains': '`fn contains(s, sub) -> Bool` — Check if string contains substring',
|
|
875
|
-
'
|
|
876
|
-
'
|
|
875
|
+
'startsWith': '`fn startsWith(s, prefix) -> Bool` — Check if string starts with prefix',
|
|
876
|
+
'starts_with': '`fn startsWith(s, prefix) -> Bool` — Check if string starts with prefix',
|
|
877
|
+
'endsWith': '`fn endsWith(s, suffix) -> Bool` — Check if string ends with suffix',
|
|
878
|
+
'ends_with': '`fn endsWith(s, suffix) -> Bool` — Check if string ends with suffix',
|
|
877
879
|
'chars': '`fn chars(s) -> [String]` — Split string into individual characters',
|
|
878
880
|
'words': '`fn words(s) -> [String]` — Split by whitespace',
|
|
879
881
|
'lines': '`fn lines(s) -> [String]` — Split by newlines',
|
|
880
882
|
'capitalize': '`fn capitalize(s) -> String` — Capitalize first letter',
|
|
881
|
-
'
|
|
882
|
-
'
|
|
883
|
-
'
|
|
884
|
-
'
|
|
885
|
-
'
|
|
886
|
-
'
|
|
883
|
+
'titleCase': '`fn titleCase(s) -> String` — Capitalize each word',
|
|
884
|
+
'title_case': '`fn titleCase(s) -> String` — Capitalize each word',
|
|
885
|
+
'snakeCase': '`fn snakeCase(s) -> String` — Convert to snake_case',
|
|
886
|
+
'snake_case': '`fn snakeCase(s) -> String` — Convert to snake_case',
|
|
887
|
+
'camelCase': '`fn camelCase(s) -> String` — Convert to camelCase',
|
|
888
|
+
'camel_case': '`fn camelCase(s) -> String` — Convert to camelCase',
|
|
889
|
+
'kebabCase': '`fn kebabCase(s) -> String` — Convert to kebab-case',
|
|
890
|
+
'kebab_case': '`fn kebabCase(s) -> String` — Convert to kebab-case',
|
|
891
|
+
'padStart': '`fn padStart(s, n, fill?) -> String` — Pad start to length n',
|
|
892
|
+
'pad_start': '`fn padStart(s, n, fill?) -> String` — Pad start to length n',
|
|
893
|
+
'padEnd': '`fn padEnd(s, n, fill?) -> String` — Pad end to length n',
|
|
894
|
+
'pad_end': '`fn padEnd(s, n, fill?) -> String` — Pad end to length n',
|
|
887
895
|
'char_at': '`fn char_at(s, i) -> String?` — Character at index (nil if out of bounds)',
|
|
888
896
|
'index_of': '`fn index_of(s, sub) -> Int?` — Index of first occurrence (nil if not found)',
|
|
889
897
|
'last_index_of': '`fn last_index_of(s, sub) -> Int?` — Index of last occurrence',
|
|
@@ -11,8 +11,11 @@ const methods = {
|
|
|
11
11
|
words() { return this.split(/\s+/).filter(Boolean); },
|
|
12
12
|
lines() { return this.split('\n'); },
|
|
13
13
|
capitalize() { return this.length ? this.charAt(0).toUpperCase() + this.slice(1) : this; },
|
|
14
|
+
titleCase() { return this.replace(/\b\w/g, c => c.toUpperCase()); },
|
|
14
15
|
title_case() { return this.replace(/\b\w/g, c => c.toUpperCase()); },
|
|
16
|
+
snakeCase() { return this.replace(/[-\s]+/g, '_').replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase().replace(/^_/, ''); },
|
|
15
17
|
snake_case() { return this.replace(/[-\s]+/g, '_').replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase().replace(/^_/, ''); },
|
|
18
|
+
camelCase() { return this.replace(/[-_\s]+(.)?/g, (_, c) => c ? c.toUpperCase() : '').replace(/^[A-Z]/, c => c.toLowerCase()); },
|
|
16
19
|
camel_case() { return this.replace(/[-_\s]+(.)?/g, (_, c) => c ? c.toUpperCase() : '').replace(/^[A-Z]/, c => c.toLowerCase()); },
|
|
17
20
|
};
|
|
18
21
|
|
package/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated by scripts/embed-runtime.js — do not edit
|
|
2
|
-
export const VERSION = "0.11.
|
|
2
|
+
export const VERSION = "0.11.21";
|