Skip to content

Commit

Permalink
Merge pull request #37 from cnSchwarzer/cnSchwarzer-patch-1
Browse files Browse the repository at this point in the history
修复 escape/unescape 对 @A@s 的顺序,避免 frank 解析失败
  • Loading branch information
flxxyz authored Jan 2, 2021
2 parents 9c498ee + d28872a commit 08021f9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stt.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ const util = require('./util')

class STT {
escape(v) {
return util.isUndefined(v) ? '' : v.toString().replace(/@/g, '@A').replace(/\//g, '@S')
return util.isUndefined(v) ? '' : v.toString().replace(/\//g, '@S').replace(/@/g, '@A')
}

unescape(v) {
return util.isUndefined(v) ? '' : v.toString().replace(/@A/g, '@').replace(/@S/g, '/')
return util.isUndefined(v) ? '' : v.toString().replace(/@S/g, '/').replace(/@A/g, '@')
}

serialize(raw) {
Expand Down Expand Up @@ -38,4 +38,4 @@ class STT {
}
}

module.exports = new STT()
module.exports = new STT()

0 comments on commit 08021f9

Please sign in to comment.