diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/safe-buffer | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) | |
download | wallet-core-363723fc84f7b8477592e0105aeb331ec9a017af.tar.xz |
node_modules
Diffstat (limited to 'node_modules/safe-buffer')
-rw-r--r-- | node_modules/safe-buffer/README.md | 21 | ||||
-rw-r--r-- | node_modules/safe-buffer/browser.js | 1 | ||||
-rw-r--r-- | node_modules/safe-buffer/index.js | 16 | ||||
-rw-r--r-- | node_modules/safe-buffer/package.json | 5 | ||||
-rw-r--r-- | node_modules/safe-buffer/test.js | 2 |
5 files changed, 26 insertions, 19 deletions
diff --git a/node_modules/safe-buffer/README.md b/node_modules/safe-buffer/README.md index 96eb387aa..e9a81afd0 100644 --- a/node_modules/safe-buffer/README.md +++ b/node_modules/safe-buffer/README.md @@ -1,17 +1,20 @@ -# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][npm-url] +# safe-buffer [![travis][travis-image]][travis-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url] -#### Safer Node.js Buffer API - -**Use the new Node.js v6 Buffer APIs (`Buffer.from`, `Buffer.alloc`, -`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in Node.js v0.10, v0.12, v4.x, and v5.x.** - -**Uses the built-in implementations when available.** - -[travis-image]: https://img.shields.io/travis/feross/safe-buffer.svg +[travis-image]: https://img.shields.io/travis/feross/safe-buffer/master.svg [travis-url]: https://travis-ci.org/feross/safe-buffer [npm-image]: https://img.shields.io/npm/v/safe-buffer.svg [npm-url]: https://npmjs.org/package/safe-buffer [downloads-image]: https://img.shields.io/npm/dm/safe-buffer.svg +[downloads-url]: https://npmjs.org/package/safe-buffer +[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg +[standard-url]: https://standardjs.com + +#### Safer Node.js Buffer API + +**Use the new Node.js Buffer APIs (`Buffer.from`, `Buffer.alloc`, +`Buffer.allocUnsafe`, `Buffer.allocUnsafeSlow`) in all versions of Node.js.** + +**Uses the built-in implementation when available.** ## install diff --git a/node_modules/safe-buffer/browser.js b/node_modules/safe-buffer/browser.js deleted file mode 100644 index 0bd12027d..000000000 --- a/node_modules/safe-buffer/browser.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('buffer') diff --git a/node_modules/safe-buffer/index.js b/node_modules/safe-buffer/index.js index 74a7358ee..22438dabb 100644 --- a/node_modules/safe-buffer/index.js +++ b/node_modules/safe-buffer/index.js @@ -1,12 +1,18 @@ +/* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') +var Buffer = buffer.Buffer +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { module.exports = buffer } else { // Copy properties from require('buffer') - Object.keys(buffer).forEach(function (prop) { - exports[prop] = buffer[prop] - }) + copyProps(buffer, exports) exports.Buffer = SafeBuffer } @@ -15,9 +21,7 @@ function SafeBuffer (arg, encodingOrOffset, length) { } // Copy static methods from Buffer -Object.keys(Buffer).forEach(function (prop) { - SafeBuffer[prop] = Buffer[prop] -}) +copyProps(Buffer, SafeBuffer) SafeBuffer.from = function (arg, encodingOrOffset, length) { if (typeof arg === 'number') { diff --git a/node_modules/safe-buffer/package.json b/node_modules/safe-buffer/package.json index ffad32fee..356d8bf20 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.0.1", + "version": "5.1.1", "author": { "name": "Feross Aboukhadijeh", "email": "feross@feross.org", @@ -10,9 +10,8 @@ "bugs": { "url": "https://github.com/feross/safe-buffer/issues" }, - "browser": "./browser.js", "devDependencies": { - "standard": "^7.0.0", + "standard": "*", "tape": "^4.0.0", "zuul": "^3.0.0" }, diff --git a/node_modules/safe-buffer/test.js b/node_modules/safe-buffer/test.js index 7da8ad761..4925059c5 100644 --- a/node_modules/safe-buffer/test.js +++ b/node_modules/safe-buffer/test.js @@ -1,3 +1,5 @@ +/* eslint-disable node/no-deprecated-api */ + var test = require('tape') var SafeBuffer = require('./').Buffer |