浏览代码

Improve string sanitation for parsing

Ensure strings are properly sanitized before processing.
master
父节点
当前提交
bb15edd726
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. +3
    -0
      packages/core/src/systems/en-US/parse.ts

+ 3
- 0
packages/core/src/systems/en-US/parse.ts 查看文件

@@ -33,6 +33,9 @@ const FINAL_TOKEN = '' as const;

export const tokenize = (stringValue: string) => (
stringValue
.toLowerCase()
.trim()
.replace(/\s+/, ' ')
.replace(new RegExp(`${TENS_ONES_SEPARATOR}`, 'g'), ' ')
.split(' ')
.filter((maybeToken) => maybeToken.length > 0)


正在加载...
取消
保存