@fraqjs/fraq 0.10.1 → 0.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/dist/index.mjs +12 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -241,6 +241,16 @@ var CommandBuilder = class {
|
|
|
241
241
|
};
|
|
242
242
|
//#endregion
|
|
243
243
|
//#region src/routing/tokenizer.ts
|
|
244
|
+
const WHITESPACE_CHARS = new Set([
|
|
245
|
+
" ",
|
|
246
|
+
" ",
|
|
247
|
+
"\n",
|
|
248
|
+
"\r",
|
|
249
|
+
"\v",
|
|
250
|
+
"\f",
|
|
251
|
+
"\xA0",
|
|
252
|
+
" "
|
|
253
|
+
]);
|
|
244
254
|
var Tokenizer = class {
|
|
245
255
|
segments;
|
|
246
256
|
offset = 0;
|
|
@@ -353,12 +363,12 @@ var Tokenizer = class {
|
|
|
353
363
|
}
|
|
354
364
|
findTextTokenStart(text, from) {
|
|
355
365
|
let offset = from;
|
|
356
|
-
while (offset < text.length && text[offset]
|
|
366
|
+
while (offset < text.length && WHITESPACE_CHARS.has(text[offset])) offset += 1;
|
|
357
367
|
return offset;
|
|
358
368
|
}
|
|
359
369
|
readTextToken(text, from) {
|
|
360
370
|
let offset = from;
|
|
361
|
-
while (offset < text.length && text[offset]
|
|
371
|
+
while (offset < text.length && !WHITESPACE_CHARS.has(text[offset])) offset += 1;
|
|
362
372
|
return text.slice(from, offset);
|
|
363
373
|
}
|
|
364
374
|
};
|