tina4-nodejs 3.10.1 → 3.10.2

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/CLAUDE.md CHANGED
@@ -1,10 +1,10 @@
1
- # CLAUDE.md — AI Developer Guide for tina4-nodejs (v3.10.1)
1
+ # CLAUDE.md — AI Developer Guide for tina4-nodejs (v3.10.2)
2
2
 
3
3
  > This file helps AI assistants (Claude, Copilot, Cursor, etc.) understand and work on this codebase effectively.
4
4
 
5
5
  ## What This Project Is
6
6
 
7
- Tina4 for Node.js/TypeScript v3.10.1 — a convention-over-configuration structural paradigm. **Not a framework.** The developer writes TypeScript; Tina4 is invisible infrastructure.
7
+ Tina4 for Node.js/TypeScript v3.10.2 — a convention-over-configuration structural paradigm. **Not a framework.** The developer writes TypeScript; Tina4 is invisible infrastructure.
8
8
 
9
9
  The philosophy: zero ceremony, batteries included, file system as source of truth.
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tina4-nodejs",
3
- "version": "3.10.1",
3
+ "version": "3.10.2",
4
4
  "type": "module",
5
5
  "description": "This is not a framework. Tina4 for Node.js/TypeScript — zero deps, 38 built-in features.",
6
6
  "keywords": ["tina4", "framework", "web", "api", "orm", "graphql", "websocket", "typescript"],
@@ -135,13 +135,67 @@ function resolveVar(expr: string, context: Record<string, unknown>): unknown {
135
135
  return items.map(item => evalExpr(item.trim(), context));
136
136
  }
137
137
 
138
- // Dotted path with bracket access
139
- const parts = expr.split(/\.|\[([^\]]+)\]/g).filter(p => p !== undefined && p !== "");
138
+ // Dotted path with bracket access — split on . and [...] but not . inside parentheses
139
+ const parts: string[] = [];
140
+ {
141
+ let current = "";
142
+ let depth = 0;
143
+ let inQuote: string | null = null;
144
+ for (let i = 0; i < expr.length; i++) {
145
+ const ch = expr[i];
146
+ if (inQuote) {
147
+ current += ch;
148
+ if (ch === inQuote) inQuote = null;
149
+ continue;
150
+ }
151
+ if (ch === '"' || ch === "'") { inQuote = ch; current += ch; continue; }
152
+ if (ch === '(') { depth++; current += ch; continue; }
153
+ if (ch === ')') { depth--; current += ch; continue; }
154
+ if (ch === '.' && depth === 0) {
155
+ if (current) parts.push(current);
156
+ current = "";
157
+ continue;
158
+ }
159
+ if (ch === '[' && depth === 0) {
160
+ if (current) parts.push(current);
161
+ current = "";
162
+ const end = expr.indexOf(']', i + 1);
163
+ if (end !== -1) {
164
+ parts.push(expr.slice(i + 1, end));
165
+ i = end;
166
+ }
167
+ continue;
168
+ }
169
+ current += ch;
170
+ }
171
+ if (current) parts.push(current);
172
+ }
140
173
 
141
174
  let value: unknown = context;
142
175
  for (const part of parts) {
143
176
  if (value === null || value === undefined) return null;
144
177
 
178
+ // Check for method call: name(args)
179
+ const methodMatch = part.match(/^(\w+)\s*\(([\s\S]*)?\)$/);
180
+ if (methodMatch) {
181
+ const methodName = methodMatch[1];
182
+ const rawArgs = methodMatch[2] || "";
183
+ if (typeof value === "object" && value !== null && methodName in (value as Record<string, unknown>)) {
184
+ const fn = (value as Record<string, unknown>)[methodName];
185
+ if (typeof fn === "function") {
186
+ if (rawArgs.trim()) {
187
+ const argParts = splitArgs(rawArgs);
188
+ const evalArgs = argParts.map(a => evalExpr(a.trim(), context));
189
+ value = fn.apply(value, evalArgs);
190
+ } else {
191
+ value = fn.call(value);
192
+ }
193
+ continue;
194
+ }
195
+ }
196
+ return null;
197
+ }
198
+
145
199
  let key: string | number = part.replace(/^['"]|['"]$/g, "");
146
200
  const asNum = parseInt(key, 10);
147
201
  if (!isNaN(asNum) && String(asNum) === key) {