diff --git a/lib/core/byte-data.js b/lib/core/byte-data.js index 289a601f..d562fcc9 100644 --- a/lib/core/byte-data.js +++ b/lib/core/byte-data.js @@ -1,12 +1,12 @@ -const encodeUtf8 = require('encode-utf8') const Mode = require('./mode') function ByteData (data) { this.mode = Mode.BYTE 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) { diff --git a/package-lock.json b/package-lock.json index 7215732c..895757ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2529,11 +2529,6 @@ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", "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": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", diff --git a/package.json b/package.json index 03f589a8..276817cf 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,6 @@ }, "dependencies": { "dijkstrajs": "^1.0.1", - "encode-utf8": "^1.0.3", "pngjs": "^5.0.0", "yargs": "^15.3.1" },