Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Remove warnings #670

Merged
merged 17 commits into from
Feb 4, 2020
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ env:
sudo: false
language: node_js
node_js:
- '10.0.0'
- '12.14.1'
before_install:
- npm i -g npm@6.4.1
- npm i -g npm@6.13.6
- yarn global add typescript
- yarn global add webpack
- yarn global add webpack
before_script:
- source ./scripts/is_latest.sh
script:
Expand All @@ -17,9 +17,9 @@ script:
deploy:
- provider: script
skip_cleanup: true
script:
script:
- ./scripts/publish-edge.sh
on:
on:
branch: develop
notifications:
webhooks:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ const { Api, JsonRpc, RpcError } = require('eosjs');
const { JsSignatureProvider } = require('eosjs/dist/eosjs-jssig'); // development only
const fetch = require('node-fetch'); // node only; not needed in browsers
const { TextEncoder, TextDecoder } = require('util'); // node only; native TextEncoder/Decoder
const { TextEncoder, TextDecoder } = require('text-encoding'); // React Native, IE11, and Edge Browsers only
```

## Basic Usage
Expand All @@ -77,7 +76,7 @@ const rpc = new JsonRpc('http://127.0.0.1:8888', { fetch });

### API

Include textDecoder and textEncoder when using in Node, React Native, IE11 or Edge Browsers.
Include textDecoder and textEncoder when using in Node. You may exclude these when running in a browser since most modern browsers now natively support these. If your browser does not support these (https://caniuse.com/#feat=textencoder), then you can import them as a dependency through the following deprecated npm package: https://www.npmjs.com/package/text-encoding
```js
const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() });
```
Expand Down
25 changes: 10 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,33 @@
"url": "https://github.com/EOSIO/eosjs.git"
},
"dependencies": {
"@babel/runtime": "7.8.3",
"@types/elliptic": "6.4.10",
"babel-runtime": "6.26.0",
"elliptic": "6.5.0",
"text-encoding": "0.7.0"
"elliptic": "6.5.2"
},
"devDependencies": {
"@babel/core": "7.8.3",
"@babel/plugin-transform-runtime": "7.8.3",
"@babel/preset-env": "7.8.3",
"@babel/preset-stage-1": "7.8.3",
"@blockone/tslint-config-blockone": "3.0.0",
"@types/jest": "24.0.6",
"@types/jest": "24.9.1",
"@types/node": "11.9.4",
"@types/text-encoding": "0.0.35",
"babel-plugin-transform-runtime": "6.23.0",
"babel-preset-env": "1.7.0",
"babel-preset-stage-1": "6.24.1",
"cypress": "3.1.5",
"cypress": "3.8.2",
"eosjs-ecc": "^4.0.7",
"jest": "23.6.0",
"jest": "25.1.0",
"jest-fetch-mock": "2.1.1",
"json-loader": "0.5.7",
"mocha": "5.2.0",
"mochawesome": "4.1.0",
"ts-jest": "24.0.0",
"ts-jest": "25.0.0",
"ts-loader": "5.3.3",
"tslint": "5.12.1",
"tslint-eslint-rules": "5.4.0",
"typescript": "3.3.3",
"webpack": "4.41.5",
"webpack-cli": "3.2.3"
},
"resolutions": {
"braces": "^2.3.1",
"lodash": "^4.17.12"
},
"jest": {
"automock": false,
"setupFiles": [
Expand Down
4 changes: 2 additions & 2 deletions src/tests/eosjs-api.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TextDecoder, TextEncoder } from 'text-encoding';
const { TextEncoder, TextDecoder } = require('util');
import { Api } from '../eosjs-api';
import { JsonRpc } from '../eosjs-jsonrpc';
import { JsSignatureProvider } from '../eosjs-jssig';
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('eosjs-api', () => {
const signatureProvider = new JsSignatureProvider(['5JtUScZK2XEp3g9gh7F8bwtPTRAkASmNrrftmx4AxDKD5K4zDnr']);
const chainId = '038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca';
api = new Api({
rpc, signatureProvider, chainId, textDecoder: new TextDecoder(), textEncoder: new TextEncoder(),
rpc, signatureProvider, chainId, textDecoder: new TextDecoder(), textEncoder: new TextEncoder()
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/tests/eosjs-serialize.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { TextEncoder, TextDecoder } = require('util');
import { ec } from 'elliptic';

import { createInitialTypes, Type, SerialBuffer } from '../eosjs-serialize';
import { TextEncoder, TextDecoder } from 'text-encoding';

describe('Serialize', () => {
let types: Map<string, Type>;
Expand Down
Loading