From bbff7403fbf46f9ad92240ac213df8d30ef31b64 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 20 Sep 2018 02:56:13 +0200 Subject: update packages --- .../node_modules/string_decoder/.npmignore | 2 - .../node_modules/string_decoder/README.md | 25 ++++++++++-- .../string_decoder/lib/string_decoder.js | 46 ++++++++++++++++------ .../node_modules/string_decoder/package.json | 11 ++++-- 4 files changed, 64 insertions(+), 20 deletions(-) delete mode 100644 node_modules/node-libs-browser/node_modules/string_decoder/.npmignore (limited to 'node_modules/node-libs-browser') diff --git a/node_modules/node-libs-browser/node_modules/string_decoder/.npmignore b/node_modules/node-libs-browser/node_modules/string_decoder/.npmignore deleted file mode 100644 index 206320cc1..000000000 --- a/node_modules/node-libs-browser/node_modules/string_decoder/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -build -test diff --git a/node_modules/node-libs-browser/node_modules/string_decoder/README.md b/node_modules/node-libs-browser/node_modules/string_decoder/README.md index dc3a2d216..5fd58315e 100644 --- a/node_modules/node-libs-browser/node_modules/string_decoder/README.md +++ b/node_modules/node-libs-browser/node_modules/string_decoder/README.md @@ -1,6 +1,6 @@ # string_decoder -***Node-core v7.0.0 string_decoder for userland*** +***Node-core v8.9.4 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_decoderstring_decoder for userland*** +***Node-core string_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/v7.8.0/docs/api/). +Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/). As of version 1.0.0 **string_decoder** uses semantic versioning. @@ -26,3 +26,22 @@ 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. diff --git a/node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js b/node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js index 26fb94c34..2e89e63f7 100644 --- a/node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js +++ b/node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js @@ -1,6 +1,30 @@ +// 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'; +/**/ + var Buffer = require('safe-buffer').Buffer; +/**/ var isEncoding = Buffer.isEncoding || function (encoding) { encoding = '' + encoding; @@ -112,10 +136,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. +// continuation byte. If an invalid byte is detected, -2 is returned. 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 -1; + return byte >> 6 === 0x02 ? -1 : -2; } // Checks at most 3 bytes at the end of a Buffer in order to detect an @@ -129,13 +153,13 @@ function utf8CheckIncomplete(self, buf, i) { if (nb > 0) self.lastNeed = nb - 1; return nb; } - if (--j < i) return 0; + if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 2; return nb; } - if (--j < i) return 0; + if (--j < i || nb === -2) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) { @@ -149,7 +173,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 -// UTF-8 replacement characters ('\ufffd'), to match v8's UTF-8 decoding +// a single UTF-8 replacement character ('\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 @@ -157,17 +181,17 @@ function utf8CheckIncomplete(self, buf, i) { function utf8CheckExtraBytes(self, buf, p) { if ((buf[0] & 0xC0) !== 0x80) { self.lastNeed = 0; - return '\ufffd'.repeat(p); + return '\ufffd'; } if (self.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 0xC0) !== 0x80) { self.lastNeed = 1; - return '\ufffd'.repeat(p + 1); + return '\ufffd'; } if (self.lastNeed > 2 && buf.length > 2) { if ((buf[2] & 0xC0) !== 0x80) { self.lastNeed = 2; - return '\ufffd'.repeat(p + 2); + return '\ufffd'; } } } @@ -198,11 +222,11 @@ function utf8Text(buf, i) { return buf.toString('utf8', i, end); } -// For UTF-8, a replacement character for each buffered byte of a (partial) -// character needs to be added to the output. +// For UTF-8, a replacement character is added when ending on a partial +// character. function utf8End(buf) { var r = buf && buf.length ? this.write(buf) : ''; - if (this.lastNeed) return r + '\ufffd'.repeat(this.lastTotal - this.lastNeed); + if (this.lastNeed) return r + '\ufffd'; return r; } diff --git a/node_modules/node-libs-browser/node_modules/string_decoder/package.json b/node_modules/node-libs-browser/node_modules/string_decoder/package.json index 49408e877..518c3eb9f 100644 --- a/node_modules/node-libs-browser/node_modules/string_decoder/package.json +++ b/node_modules/node-libs-browser/node_modules/string_decoder/package.json @@ -1,6 +1,6 @@ { "name": "string_decoder", - "version": "1.0.3", + "version": "1.1.1", "description": "The string_decoder module from Node core", "main": "lib/string_decoder.js", "dependencies": { @@ -8,16 +8,19 @@ }, "devDependencies": { "babel-polyfill": "^6.23.0", + "core-util-is": "^1.0.2", + "inherits": "^2.0.3", "tap": "~0.4.8" }, "scripts": { - "test": "tap test/parallel/*.js && node test/verify-dependencies" + "test": "tap test/parallel/*.js && node test/verify-dependencies", + "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js" }, "repository": { "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" + "url": "git://github.com/nodejs/string_decoder.git" }, - "homepage": "https://github.com/rvagg/string_decoder", + "homepage": "https://github.com/nodejs/string_decoder", "keywords": [ "string", "decoder", -- cgit v1.2.3