Updated npm nonsense for ubuntu 20.04

This commit is contained in:
Pedro Pinto committed 2020-05-23 10:14:15 -04:00
1 parent 8dfc6caa7e
commit e443009f8c
28162 files changed
+978683 -2336900

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
build
test
-50
View File
@@ -1,50 +0,0 @@
sudo: false
language: node_js
before_install:
- npm install -g npm@2
- test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g
notifications:
email: false
matrix:
fast_finish: true
include:
- node_js: '0.8'
env:
- TASK=test
- NPM_LEGACY=true
- node_js: '0.10'
env:
- TASK=test
- NPM_LEGACY=true
- node_js: '0.11'
env:
- TASK=test
- NPM_LEGACY=true
- node_js: '0.12'
env:
- TASK=test
- NPM_LEGACY=true
- node_js: 1
env:
- TASK=test
- NPM_LEGACY=true
- node_js: 2
env:
- TASK=test
- NPM_LEGACY=true
- node_js: 3
env:
- TASK=test
- NPM_LEGACY=true
- node_js: 4
env: TASK=test
- node_js: 5
env: TASK=test
- node_js: 6
env: TASK=test
- node_js: 7
env: TASK=test
- node_js: 8
env: TASK=test
- node_js: 9
env: TASK=test
+3 -22
View File
@@ -1,6 +1,6 @@
# string_decoder
***Node-core v8.9.4 string_decoder for userland***
***Node-core v7.0.0 string_decoder for userland***
[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/)
@@ -11,11 +11,11 @@
npm install --save string_decoder
```
***Node-core string_decoder for userland***
***Node-core string_decoderstring_decoder for userland***
This package is a mirror of the string_decoder implementation in Node-core.
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v7.8.0/docs/api/).
As of version 1.0.0 **string_decoder** uses semantic versioning.
@@ -26,22 +26,3 @@ Previous version numbers match the versions found in Node core, e.g. 0.10.24 mat
## Update
The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
## Streams Working Group
`string_decoder` is maintained by the Streams Working Group, which
oversees the development and maintenance of the Streams API within
Node.js. The responsibilities of the Streams Working Group include:
* Addressing stream issues on the Node.js issue tracker.
* Authoring and editing stream documentation within the Node.js project.
* Reviewing changes to stream subclasses within the Node.js project.
* Redirecting changes to streams from the Node.js project to this
project.
* Assisting in the implementation of stream providers within Node.js.
* Recommending versions of `readable-stream` to be included in Node.js.
* Messaging about the future of streams to give the community advance
notice of changes.
See [readable-stream](https://github.com/nodejs/readable-stream) for
more details.
+11 -35
View File
@@ -1,30 +1,6 @@
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
'use strict';
/*<replacement>*/
var Buffer = require('safe-buffer').Buffer;
/*</replacement>*/
var isEncoding = Buffer.isEncoding || function (encoding) {
encoding = '' + encoding;
@@ -136,10 +112,10 @@ StringDecoder.prototype.fillLast = function (buf) {
};
// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
// continuation byte. If an invalid byte is detected, -2 is returned.
// continuation byte.
function utf8CheckByte(byte) {
if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
return byte >> 6 === 0x02 ? -1 : -2;
return -1;
}
// Checks at most 3 bytes at the end of a Buffer in order to detect an
@@ -153,13 +129,13 @@ function utf8CheckIncomplete(self, buf, i) {
if (nb > 0) self.lastNeed = nb - 1;
return nb;
}
if (--j < i || nb === -2) return 0;
if (--j < i) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) self.lastNeed = nb - 2;
return nb;
}
if (--j < i || nb === -2) return 0;
if (--j < i) return 0;
nb = utf8CheckByte(buf[j]);
if (nb >= 0) {
if (nb > 0) {
@@ -173,7 +149,7 @@ function utf8CheckIncomplete(self, buf, i) {
// Validates as many continuation bytes for a multi-byte UTF-8 character as
// needed or are available. If we see a non-continuation byte where we expect
// one, we "replace" the validated continuation bytes we've seen so far with
// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding
// behavior. The continuation byte check is included three times in the case
// where all of the continuation bytes for a character exist in the same buffer.
// It is also done this way as a slight performance increase instead of using a
@@ -181,17 +157,17 @@ function utf8CheckIncomplete(self, buf, i) {
function utf8CheckExtraBytes(self, buf, p) {
if ((buf[0] & 0xC0) !== 0x80) {
self.lastNeed = 0;
return '\ufffd';
return '\ufffd'.repeat(p);
}
if (self.lastNeed > 1 && buf.length > 1) {
if ((buf[1] & 0xC0) !== 0x80) {
self.lastNeed = 1;
return '\ufffd';
return '\ufffd'.repeat(p + 1);
}
if (self.lastNeed > 2 && buf.length > 2) {
if ((buf[2] & 0xC0) !== 0x80) {
self.lastNeed = 2;
return '\ufffd';
return '\ufffd'.repeat(p + 2);
}
}
}
@@ -222,11 +198,11 @@ function utf8Text(buf, i) {
return buf.toString('utf8', i, end);
}
// For UTF-8, a replacement character is added when ending on a partial
// character.
// For UTF-8, a replacement character for each buffered byte of a (partial)
// character needs to be added to the output.
function utf8End(buf) {
var r = buf && buf.length ? this.write(buf) : '';
if (this.lastNeed) return r + '\ufffd';
if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed);
return r;
}
+7
View File
@@ -0,0 +1,7 @@
language: node_js
node_js:
- 'node'
- '5'
- '4'
- '0.12'
- '0.10'
-187
View File
@@ -1,187 +0,0 @@
declare module "safe-buffer" {
export class Buffer {
length: number
write(string: string, offset?: number, length?: number, encoding?: string): number;
toString(encoding?: string, start?: number, end?: number): string;
toJSON(): { type: 'Buffer', data: any[] };
equals(otherBuffer: Buffer): boolean;
compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
slice(start?: number, end?: number): Buffer;
writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
readUInt8(offset: number, noAssert?: boolean): number;
readUInt16LE(offset: number, noAssert?: boolean): number;
readUInt16BE(offset: number, noAssert?: boolean): number;
readUInt32LE(offset: number, noAssert?: boolean): number;
readUInt32BE(offset: number, noAssert?: boolean): number;
readInt8(offset: number, noAssert?: boolean): number;
readInt16LE(offset: number, noAssert?: boolean): number;
readInt16BE(offset: number, noAssert?: boolean): number;
readInt32LE(offset: number, noAssert?: boolean): number;
readInt32BE(offset: number, noAssert?: boolean): number;
readFloatLE(offset: number, noAssert?: boolean): number;
readFloatBE(offset: number, noAssert?: boolean): number;
readDoubleLE(offset: number, noAssert?: boolean): number;
readDoubleBE(offset: number, noAssert?: boolean): number;
swap16(): Buffer;
swap32(): Buffer;
swap64(): Buffer;
writeUInt8(value: number, offset: number, noAssert?: boolean): number;
writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
writeInt8(value: number, offset: number, noAssert?: boolean): number;
writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
fill(value: any, offset?: number, end?: number): this;
indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
/**
* Allocates a new buffer containing the given {str}.
*
* @param str String to store in buffer.
* @param encoding encoding to use, optional. Default is 'utf8'
*/
constructor (str: string, encoding?: string);
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
*/
constructor (size: number);
/**
* Allocates a new buffer containing the given {array} of octets.
*
* @param array The octets to store.
*/
constructor (array: Uint8Array);
/**
* Produces a Buffer backed by the same allocated memory as
* the given {ArrayBuffer}.
*
*
* @param arrayBuffer The ArrayBuffer with which to share memory.
*/
constructor (arrayBuffer: ArrayBuffer);
/**
* Allocates a new buffer containing the given {array} of octets.
*
* @param array The octets to store.
*/
constructor (array: any[]);
/**
* Copies the passed {buffer} data onto a new {Buffer} instance.
*
* @param buffer The buffer to copy.
*/
constructor (buffer: Buffer);
prototype: Buffer;
/**
* Allocates a new Buffer using an {array} of octets.
*
* @param array
*/
static from(array: any[]): Buffer;
/**
* When passed a reference to the .buffer property of a TypedArray instance,
* the newly created Buffer will share the same allocated memory as the TypedArray.
* The optional {byteOffset} and {length} arguments specify a memory range
* within the {arrayBuffer} that will be shared by the Buffer.
*
* @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
* @param byteOffset
* @param length
*/
static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
/**
* Copies the passed {buffer} data onto a new Buffer instance.
*
* @param buffer
*/
static from(buffer: Buffer): Buffer;
/**
* Creates a new Buffer containing the given JavaScript string {str}.
* If provided, the {encoding} parameter identifies the character encoding.
* If not provided, {encoding} defaults to 'utf8'.
*
* @param str
*/
static from(str: string, encoding?: string): Buffer;
/**
* Returns true if {obj} is a Buffer
*
* @param obj object to test.
*/
static isBuffer(obj: any): obj is Buffer;
/**
* Returns true if {encoding} is a valid encoding argument.
* Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
*
* @param encoding string to test.
*/
static isEncoding(encoding: string): boolean;
/**
* Gives the actual byte length of a string. encoding defaults to 'utf8'.
* This is not the same as String.prototype.length since that returns the number of characters in a string.
*
* @param string string to test.
* @param encoding encoding used to evaluate (defaults to 'utf8')
*/
static byteLength(string: string, encoding?: string): number;
/**
* Returns a buffer which is the result of concatenating all the buffers in the list together.
*
* If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
* If the list has exactly one item, then the first item of the list is returned.
* If the list has more than one item, then a new Buffer is created.
*
* @param list An array of Buffer objects to concatenate
* @param totalLength Total length of the buffers when concatenated.
* If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
*/
static concat(list: Buffer[], totalLength?: number): Buffer;
/**
* The same as buf1.compare(buf2).
*/
static compare(buf1: Buffer, buf2: Buffer): number;
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
* @param fill if specified, buffer will be initialized by calling buf.fill(fill).
* If parameter is omitted, buffer will be filled with zeros.
* @param encoding encoding used for call to buf.fill while initalizing
*/
static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
/**
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
* of the newly created Buffer are unknown and may contain sensitive data.
*
* @param size count of octets to allocate
*/
static allocUnsafe(size: number): Buffer;
/**
* Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
* of the newly created Buffer are unknown and may contain sensitive data.
*
* @param size count of octets to allocate
*/
static allocUnsafeSlow(size: number): Buffer;
}
}
+22 -55
View File
@@ -1,67 +1,47 @@
{
"_args": [
[
"safe-buffer@~5.1.0",
"/home/ppinto/temp/spark/src/web/api/node_modules/string_decoder"
"safe-buffer@5.1.1",
"/home/ppinto/Dropbox/bts/spark/src/web/ui"
]
],
"_from": "safe-buffer@>=5.1.0 <5.2.0",
"_hasShrinkwrap": false,
"_id": "safe-buffer@5.1.2",
"_inCache": true,
"_installable": true,
"_development": true,
"_from": "safe-buffer@5.1.1",
"_id": "safe-buffer@5.1.1",
"_inBundle": false,
"_integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==",
"_location": "/string_decoder/safe-buffer",
"_nodeVersion": "8.11.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/safe-buffer_5.1.2_1524687024555_0.6520279716197115"
},
"_npmUser": {
"email": "feross@feross.org",
"name": "feross"
},
"_npmVersion": "6.0.0",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "safe-buffer@5.1.1",
"name": "safe-buffer",
"raw": "safe-buffer@~5.1.0",
"rawSpec": "~5.1.0",
"scope": null,
"spec": ">=5.1.0 <5.2.0",
"type": "range"
"escapedName": "safe-buffer",
"rawSpec": "5.1.1",
"saveSpec": null,
"fetchSpec": "5.1.1"
},
"_requiredBy": [
"/string_decoder"
],
"_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"_shasum": "991ec69d296e0313747d59bdfd2b745c35f8828d",
"_shrinkwrap": null,
"_spec": "safe-buffer@~5.1.0",
"_where": "/home/ppinto/temp/spark/src/web/api/node_modules/string_decoder",
"_resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"_spec": "5.1.1",
"_where": "/home/ppinto/Dropbox/bts/spark/src/web/ui",
"author": {
"email": "feross@feross.org",
"name": "Feross Aboukhadijeh",
"email": "feross@feross.org",
"url": "http://feross.org"
},
"bugs": {
"url": "https://github.com/feross/safe-buffer/issues"
},
"dependencies": {},
"description": "Safer Node.js Buffer API",
"devDependencies": {
"standard": "*",
"tape": "^4.0.0"
"tape": "^4.0.0",
"zuul": "^3.0.0"
},
"directories": {},
"dist": {
"fileCount": 5,
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa4OCyCRA9TVsSAnZWagAAwf8QAIlCcf+WlqWgpiGufGgi\n+P81J+YsGVk8haOYIgZX8FTI10RjPKiGN6R11R2B8YMJhxk3kX6O2SO/pl6A\n3tuw9/n+HBQClzobhWovJ6aymO+ozlaxxWADx0DrqKhoDOfpPLoIjaWNS2q2\nh1VxErOXagn/JP11Le89LHqcZs3s1jYyH/cAvA7ygaHvHaDhAiMMimAdz8Ze\n07VKtAM6PSnBYODducjXNTWdqotsRnzmqWEQrV2OQsk8OudJ3+YBZG8szsQ2\nVGrOLeQyj7g+q/WrjFi6I4S+Eg0dYYUg73X3PaAFzGXf7VIjDDNkFjwmtx5u\nUxQ/HczXVzHkcVOfBzbNk4rPTx9o6gr+oDIvWeAgOPYIv1YT5bnMHZ2w7M+8\n4b+SPqVeWHcNfnUhLcHmxim2TWkl0DD+oeYSucsOZ65dJdihMlNiOlVe5XXl\nIPJbfOqNcWCzkibq7pQmTSeM52l8JSekpNZGi3RQQkbrVR+cR3F53VrDzvZe\n3Jqwg7hGlGXyXl5i3TPL0oqD15n/1+wLxZEBVrqM5SeQzvD8l1iDv+3sPViP\ng3msNBtX8NH+Sf4kfCJzHRGestQb0zpVa8wvKeQBBlmpv1kqAgnuPR3k39hI\ncjpqjm2vkmAetW4XnOnCuuMk4SEqejwXh0w1TAHlFLqhywxgSZhH6SJhTbgQ\nKQZ7\r\n=EOr+\r\n-----END PGP SIGNATURE-----\r\n",
"shasum": "991ec69d296e0313747d59bdfd2b745c35f8828d",
"tarball": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"unpackedSize": 31686
},
"gitHead": "649435cc8e2d1f3ecdc7caf323f1cb1187307a16",
"homepage": "https://github.com/feross/safe-buffer",
"keywords": [
"buffer",
@@ -74,26 +54,13 @@
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "feross",
"email": "feross@feross.org"
},
{
"name": "mafintosh",
"email": "mathiasbuus@gmail.com"
}
],
"name": "safe-buffer",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/feross/safe-buffer.git"
},
"scripts": {
"test": "standard && tape test/*.js"
"test": "standard && tape test.js"
},
"types": "index.d.ts",
"version": "5.1.2"
"version": "5.1.1"
}
+101
View File
@@ -0,0 +1,101 @@
/* 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({})
})
})
+24 -70
View File
@@ -1,45 +1,35 @@
{
"_args": [
[
"string_decoder@~1.1.1",
"/home/ppinto/temp/spark/src/web/api/node_modules/readable-stream"
"string_decoder@1.0.3",
"/home/ppinto/Dropbox/bts/spark/src/web/ui"
]
],
"_from": "string_decoder@>=1.1.1 <1.2.0",
"_hasShrinkwrap": false,
"_id": "string_decoder@1.1.1",
"_inCache": true,
"_installable": true,
"_development": true,
"_from": "string_decoder@1.0.3",
"_id": "string_decoder@1.0.3",
"_inBundle": false,
"_integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==",
"_location": "/string_decoder",
"_nodeVersion": "8.10.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/string_decoder_1.1.1_1522397654739_0.2722524344416213"
},
"_npmUser": {
"email": "hello@matteocollina.com",
"name": "matteo.collina"
},
"_npmVersion": "5.8.0",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "string_decoder@1.0.3",
"name": "string_decoder",
"raw": "string_decoder@~1.1.1",
"rawSpec": "~1.1.1",
"scope": null,
"spec": ">=1.1.1 <1.2.0",
"type": "range"
"escapedName": "string_decoder",
"rawSpec": "1.0.3",
"saveSpec": null,
"fetchSpec": "1.0.3"
},
"_requiredBy": [
"/readable-stream"
],
"_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"_shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8",
"_shrinkwrap": null,
"_spec": "string_decoder@~1.1.1",
"_where": "/home/ppinto/temp/spark/src/web/api/node_modules/readable-stream",
"_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
"_spec": "1.0.3",
"_where": "/home/ppinto/Dropbox/bts/spark/src/web/ui",
"bugs": {
"url": "https://github.com/nodejs/string_decoder/issues"
"url": "https://github.com/rvagg/string_decoder/issues"
},
"dependencies": {
"safe-buffer": "~5.1.0"
@@ -47,60 +37,24 @@
"description": "The string_decoder module from Node core",
"devDependencies": {
"babel-polyfill": "^6.23.0",
"core-util-is": "^1.0.2",
"inherits": "^2.0.3",
"tap": "~0.4.8"
},
"directories": {},
"dist": {
"fileCount": 5,
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"shasum": "9cf1611ba62685d7030ae9e4ba34149c3af03fc8",
"tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"unpackedSize": 15298
},
"gitHead": "18c7f89c894ced5f610505bb006dfde9a3d1ac5e",
"homepage": "https://github.com/nodejs/string_decoder",
"homepage": "https://github.com/rvagg/string_decoder",
"keywords": [
"browser",
"browserify",
"string",
"decoder",
"string"
"browser",
"browserify"
],
"license": "MIT",
"main": "lib/string_decoder.js",
"maintainers": [
{
"name": "cwmma",
"email": "calvin.metcalf@gmail.com"
},
{
"name": "matteo.collina",
"email": "hello@matteocollina.com"
},
{
"name": "nodejs-foundation",
"email": "build@iojs.org"
},
{
"name": "rvagg",
"email": "rod@vagg.org"
},
{
"name": "substack",
"email": "substack@gmail.com"
}
],
"name": "string_decoder",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/nodejs/string_decoder.git"
"url": "git://github.com/rvagg/string_decoder.git"
},
"scripts": {
"ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
"test": "tap test/parallel/*.js && node test/verify-dependencies"
},
"version": "1.1.1"
"version": "1.0.3"
}