Remove encode-utf8
This commit is contained in:
parent
dc20f975a5
commit
b9c260d8a3
3 changed files with 3 additions and 9 deletions
|
@ -1,12 +1,12 @@
|
||||||
const encodeUtf8 = require('encode-utf8')
|
|
||||||
const Mode = require('./mode')
|
const Mode = require('./mode')
|
||||||
|
|
||||||
function ByteData (data) {
|
function ByteData (data) {
|
||||||
this.mode = Mode.BYTE
|
this.mode = Mode.BYTE
|
||||||
if (typeof (data) === 'string') {
|
if (typeof (data) === 'string') {
|
||||||
data = encodeUtf8(data)
|
this.data = new TextEncoder().encode(data)
|
||||||
}
|
} else {
|
||||||
this.data = new Uint8Array(data)
|
this.data = new Uint8Array(data)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ByteData.getBitsLength = function getBitsLength (length) {
|
ByteData.getBitsLength = function getBitsLength (length) {
|
||||||
|
|
5
package-lock.json
generated
5
package-lock.json
generated
|
@ -2529,11 +2529,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
|
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
|
||||||
},
|
},
|
||||||
"encode-utf8": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw=="
|
|
||||||
},
|
|
||||||
"encodeurl": {
|
"encodeurl": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dijkstrajs": "^1.0.1",
|
"dijkstrajs": "^1.0.1",
|
||||||
"encode-utf8": "^1.0.3",
|
|
||||||
"pngjs": "^5.0.0",
|
"pngjs": "^5.0.0",
|
||||||
"yargs": "^15.3.1"
|
"yargs": "^15.3.1"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue