Skip to content

Commit

Permalink
Remove TextEncoder dependency, this is included in NodeJS now
Browse files Browse the repository at this point in the history
  • Loading branch information
warpr committed Apr 20, 2023
1 parent 52b2077 commit 703551c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 23 deletions.
20 changes: 3 additions & 17 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zbase32",
"version": "2.0.2",
"version": "2.0.3",
"description": "z-base-32 encoding/decoding library",
"main": "index.js",
"typings": "index.d.ts",
Expand All @@ -18,8 +18,7 @@
"jsverify": "^0.8.4",
"lint-staged": "^13.0.3",
"mocha": "^10.0.0",
"prettier": "^2.7.1",
"text-encoding": "^0.7.0"
"prettier": "^2.7.1"
},
"husky": {
"hooks": {
Expand Down
5 changes: 2 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@
'use strict';

import { assert } from 'chai';
import text_encoding from 'text-encoding';
import jsverify from 'jsverify';
import zbase32 from '../index.js';

function toUTF8(str) {
return new text_encoding.TextEncoder('utf-8').encode(str);
return new TextEncoder('utf-8').encode(str);
}

function fromUTF8(arrayBuffer) {
return new text_encoding.TextDecoder('utf-8').decode(arrayBuffer);
return new TextDecoder('utf-8').decode(arrayBuffer);
}

suite('zbase32', function () {
Expand Down

0 comments on commit 703551c

Please sign in to comment.