jsfe 1.81.2 → 1.81.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.
@@ -1 +1 @@
1
- {"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src/helpers/numbers.js"],"names":[],"mappings":"AAoFA;;;;;GAKG;AACH;;;;;;IAqBC;AAED;;;;;;;GAOG;AACH;;;;EA0BC;AAED;mFACmF;AACnF,qEASC;AArJD;;;4EAG4E;AAC5E,+BAAqF"}
1
+ {"version":3,"file":"numbers.d.ts","sourceRoot":"","sources":["../../src/helpers/numbers.js"],"names":[],"mappings":"AAmGA;;;;;GAKG;AACH;;;;;;IAqBC;AAED;;;;;;;GAOG;AACH;;;;EA0BC;AAED;mFACmF;AACnF,qEASC;AApKD;;;4EAG4E;AAC5E,+BAAqF"}
@@ -26,6 +26,23 @@ function wordNumbers(raw) {
26
26
  const found = [];
27
27
  for (let i = 0; i < tokens.length; i++) {
28
28
  const first = tokens[i].word;
29
+ // Spanish says "y" inside a number, and speech-to-text keeps it between the digits (owner 2026-11-19; prod 11-19 17:10
30
+ // "9 y 5, 55, 31" was the code 955531): tens and a digit add up ("40 y 3" → 43, "cuarenta y tres"); two single digits
31
+ // join ("9 y 5" → 95) unless the first ends a number already being said digit by digit ("1 2 3 4 y 0 5 1 2 1 9 8 0" is two
32
+ // numbers). "y" between longer groups still separates two numbers ("1382 y 5603").
33
+ const and = tokens[i + 1], unit = tokens[i + 2];
34
+ if (/^\d{1,2}$/.test(first) && and?.word === 'y' && unit && /^\d$/.test(unit.word) && gapOk(tokens[i], and) && gapOk(and, unit)
35
+ && !/\d/.test(raw[unit.end] || '')) {
36
+ const tensAndUnit = /^[2-9]0$/.test(first) && unit.word !== '0';
37
+ const digitPair = /^\d$/.test(first) && !/\d[\s.,-]*$/.test(raw.slice(0, tokens[i].start));
38
+ if (tensAndUnit || digitPair) {
39
+ found.push({ start: tokens[i].start, end: unit.end, digits: tensAndUnit ? String(Number(first) + Number(unit.word)) : first + unit.word });
40
+ i += 2;
41
+ continue;
42
+ }
43
+ else { /* "15 y 3": two numbers */ }
44
+ }
45
+ else { /* no "y" inside a number here */ }
29
46
  if (!isNumberWord(first) || CONNECTORS.has(first)) {
30
47
  continue;
31
48
  }
@@ -1 +1 @@
1
- export const JSFE_RUNTIME_FINGERPRINT = "sha256:bb1babc51b4174455afca1da5de8d831eecd1e4d5835962d2b16c2280c778395";
1
+ export const JSFE_RUNTIME_FINGERPRINT = "sha256:3d731a036910c77393b8dc78e4ea00412c176a335b235bf420480f466cc7a191";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsfe",
3
- "version": "1.81.2",
3
+ "version": "1.81.3",
4
4
  "description": "TypeScript workflow engine for conversational/automation apps: multi-flow orchestration, interrupt/resume, stack-based control, robust errors, and flexible tool/REST integration.",
5
5
  "license": "MIT",
6
6
  "author": "Ron Pinkas",