mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-18 03:05:48 +00:00
Use Buffer.from()
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "tsc",
|
||||
"test": "tsc && mocha",
|
||||
"test": "tsc && tslint -p ./ && mocha",
|
||||
"lint": "tslint -p ./"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -22,7 +22,7 @@ function isSequence(val) {
|
||||
* a single element or a sequence, which has a `length` property and supports
|
||||
* element retrieval via sequence[ix].
|
||||
*
|
||||
* > concatArgs(1, [2, 3], new Buffer([4,5]), new Uint8Array([6, 7]));
|
||||
* > concatArgs(1, [2, 3], Buffer.from([4,5]), new Uint8Array([6, 7]));
|
||||
* [1,2,3,4,5,6,7]
|
||||
*
|
||||
* @return {Array} - concatenated arguments
|
||||
|
||||
@@ -2,11 +2,11 @@ const assert = require('assert')
|
||||
const api = require('../dist')
|
||||
|
||||
function toHex(bytes) {
|
||||
return new Buffer(bytes).toString('hex').toUpperCase()
|
||||
return Buffer.from(bytes).toString('hex').toUpperCase()
|
||||
}
|
||||
|
||||
function toBytes(hex) {
|
||||
return new Buffer(hex, 'hex').toJSON().data
|
||||
return Buffer.from(hex, 'hex').toJSON().data
|
||||
}
|
||||
|
||||
describe('ripple-address-codec', function() {
|
||||
|
||||
@@ -2,11 +2,11 @@ const assert = require('assert')
|
||||
const api = require('../dist/xrp-codec')
|
||||
|
||||
function toHex(bytes) {
|
||||
return new Buffer(bytes).toString('hex').toUpperCase()
|
||||
return Buffer.from(bytes).toString('hex').toUpperCase()
|
||||
}
|
||||
|
||||
function toBytes(hex) {
|
||||
return new Buffer(hex, 'hex').toJSON().data
|
||||
return Buffer.from(hex, 'hex').toJSON().data
|
||||
}
|
||||
|
||||
describe('ripple-address-codec', function() {
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"suppressImplicitAnyIndexErrors": false,
|
||||
"sourceMap": true,
|
||||
"skipLibCheck": true,
|
||||
"allowJs": true
|
||||
"declaration": true
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts"
|
||||
|
||||
Reference in New Issue
Block a user