aboutsummaryrefslogtreecommitdiff
path: root/node_modules/safe-buffer
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
commitbbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch)
treec58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/safe-buffer
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
update packages
Diffstat (limited to 'node_modules/safe-buffer')
-rw-r--r--node_modules/safe-buffer/.travis.yml7
-rw-r--r--node_modules/safe-buffer/package.json8
-rw-r--r--node_modules/safe-buffer/test.js101
3 files changed, 4 insertions, 112 deletions
diff --git a/node_modules/safe-buffer/.travis.yml b/node_modules/safe-buffer/.travis.yml
deleted file mode 100644
index 7b20f28cb..000000000
--- a/node_modules/safe-buffer/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-language: node_js
-node_js:
- - 'node'
- - '5'
- - '4'
- - '0.12'
- - '0.10'
diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json
index 356d8bf20..623fbc3f6 100644
--- a/node_modules/safe-buffer/package.json
+++ b/node_modules/safe-buffer/package.json
@@ -1,7 +1,7 @@
{
"name": "safe-buffer",
"description": "Safer Node.js Buffer API",
- "version": "5.1.1",
+ "version": "5.1.2",
"author": {
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
@@ -12,8 +12,7 @@
},
"devDependencies": {
"standard": "*",
- "tape": "^4.0.0",
- "zuul": "^3.0.0"
+ "tape": "^4.0.0"
},
"homepage": "https://github.com/feross/safe-buffer",
"keywords": [
@@ -27,11 +26,12 @@
],
"license": "MIT",
"main": "index.js",
+ "types": "index.d.ts",
"repository": {
"type": "git",
"url": "git://github.com/feross/safe-buffer.git"
},
"scripts": {
- "test": "standard && tape test.js"
+ "test": "standard && tape test/*.js"
}
}
diff --git a/node_modules/safe-buffer/test.js b/node_modules/safe-buffer/test.js
deleted file mode 100644
index 4925059c5..000000000
--- a/node_modules/safe-buffer/test.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/* eslint-disable node/no-deprecated-api */
-
-var test = require('tape')
-var SafeBuffer = require('./').Buffer
-
-test('new SafeBuffer(value) works just like Buffer', function (t) {
- t.deepEqual(new SafeBuffer('hey'), new Buffer('hey'))
- t.deepEqual(new SafeBuffer('hey', 'utf8'), new Buffer('hey', 'utf8'))
- t.deepEqual(new SafeBuffer('686579', 'hex'), new Buffer('686579', 'hex'))
- t.deepEqual(new SafeBuffer([1, 2, 3]), new Buffer([1, 2, 3]))
- t.deepEqual(new SafeBuffer(new Uint8Array([1, 2, 3])), new Buffer(new Uint8Array([1, 2, 3])))
-
- t.equal(typeof SafeBuffer.isBuffer, 'function')
- t.equal(SafeBuffer.isBuffer(new SafeBuffer('hey')), true)
- t.equal(Buffer.isBuffer(new SafeBuffer('hey')), true)
- t.notOk(SafeBuffer.isBuffer({}))
-
- t.end()
-})
-
-test('SafeBuffer.from(value) converts to a Buffer', function (t) {
- t.deepEqual(SafeBuffer.from('hey'), new Buffer('hey'))
- t.deepEqual(SafeBuffer.from('hey', 'utf8'), new Buffer('hey', 'utf8'))
- t.deepEqual(SafeBuffer.from('686579', 'hex'), new Buffer('686579', 'hex'))
- t.deepEqual(SafeBuffer.from([1, 2, 3]), new Buffer([1, 2, 3]))
- t.deepEqual(SafeBuffer.from(new Uint8Array([1, 2, 3])), new Buffer(new Uint8Array([1, 2, 3])))
-
- t.end()
-})
-
-test('SafeBuffer.alloc(number) returns zeroed-out memory', function (t) {
- for (var i = 0; i < 10; i++) {
- var expected1 = new Buffer(1000)
- expected1.fill(0)
- t.deepEqual(SafeBuffer.alloc(1000), expected1)
-
- var expected2 = new Buffer(1000 * 1000)
- expected2.fill(0)
- t.deepEqual(SafeBuffer.alloc(1000 * 1000), expected2)
- }
- t.end()
-})
-
-test('SafeBuffer.allocUnsafe(number)', function (t) {
- var buf = SafeBuffer.allocUnsafe(100) // unitialized memory
- t.equal(buf.length, 100)
- t.equal(SafeBuffer.isBuffer(buf), true)
- t.equal(Buffer.isBuffer(buf), true)
- t.end()
-})
-
-test('SafeBuffer.from() throws with number types', function (t) {
- t.plan(5)
- t.throws(function () {
- SafeBuffer.from(0)
- })
- t.throws(function () {
- SafeBuffer.from(-1)
- })
- t.throws(function () {
- SafeBuffer.from(NaN)
- })
- t.throws(function () {
- SafeBuffer.from(Infinity)
- })
- t.throws(function () {
- SafeBuffer.from(99)
- })
-})
-
-test('SafeBuffer.allocUnsafe() throws with non-number types', function (t) {
- t.plan(4)
- t.throws(function () {
- SafeBuffer.allocUnsafe('hey')
- })
- t.throws(function () {
- SafeBuffer.allocUnsafe('hey', 'utf8')
- })
- t.throws(function () {
- SafeBuffer.allocUnsafe([1, 2, 3])
- })
- t.throws(function () {
- SafeBuffer.allocUnsafe({})
- })
-})
-
-test('SafeBuffer.alloc() throws with non-number types', function (t) {
- t.plan(4)
- t.throws(function () {
- SafeBuffer.alloc('hey')
- })
- t.throws(function () {
- SafeBuffer.alloc('hey', 'utf8')
- })
- t.throws(function () {
- SafeBuffer.alloc([1, 2, 3])
- })
- t.throws(function () {
- SafeBuffer.alloc({})
- })
-})