修复escape末尾字符串丢失问题

This commit is contained in:
2022-04-14 17:47:52 +08:00
parent ffa0869754
commit c84bf1503e
2 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "yizhi-html-escape", "name": "yizhi-html-escape",
"version": "1.0.2", "version": "1.0.3",
"description": "HTML escape character util", "description": "HTML escape character util",
"main": "dist/index.js", "main": "dist/index.js",
"types": "typing/index.d.ts", "types": "typing/index.d.ts",

View File

@ -17,6 +17,7 @@ export function escape(str: string) {
prev = i + 1 prev = i + 1
} }
} }
buffer.push(str.substring(prev))
return buffer.join('') return buffer.join('')
} }