修复某处正则的兼容性问题

This commit is contained in:
kuangshen04 2024-02-13 21:42:09 +08:00
parent c2c18b2913
commit 4913bf5989
1 changed files with 5 additions and 1 deletions

View File

@ -2251,7 +2251,11 @@ export class Get extends Uninstantable {
}
numStr = numStr.replace(/(?=(\d{4})+$)/g, ',').split(',').filter(Boolean);
const handleZero = str => str.replace(/零{2,}/g, '零').replace(/(?<=.+)零+$/g, '');
const handleZero = str => {
let result = str.replace(/零{2,}/g, '零');
if (result.length > 1) replace(/零+$/g, '');
return result;
};
const _transform = str => {
if (str === '2' && !ordinal) return '两';
let result = '';