aboutsummaryrefslogtreecommitdiff
path: root/node_modules/node-libs-browser
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/node-libs-browser')
-rw-r--r--node_modules/node-libs-browser/LICENSE22
-rw-r--r--node_modules/node-libs-browser/README.md61
-rw-r--r--node_modules/node-libs-browser/index.js38
-rw-r--r--node_modules/node-libs-browser/mock/buffer.js10
-rw-r--r--node_modules/node-libs-browser/mock/console.js12
-rw-r--r--node_modules/node-libs-browser/mock/dns.js15
-rw-r--r--node_modules/node-libs-browser/mock/empty.js0
-rw-r--r--node_modules/node-libs-browser/mock/net.js10
-rw-r--r--node_modules/node-libs-browser/mock/process.js30
-rw-r--r--node_modules/node-libs-browser/mock/punycode.js6
-rw-r--r--node_modules/node-libs-browser/mock/tls.js1
-rw-r--r--node_modules/node-libs-browser/mock/tty.js2
-rw-r--r--node_modules/node-libs-browser/node_modules/string_decoder/LICENSE48
-rw-r--r--node_modules/node-libs-browser/node_modules/string_decoder/README.md47
-rw-r--r--node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js296
-rw-r--r--node_modules/node-libs-browser/node_modules/string_decoder/package.json31
-rw-r--r--node_modules/node-libs-browser/package.json48
17 files changed, 0 insertions, 677 deletions
diff --git a/node_modules/node-libs-browser/LICENSE b/node_modules/node-libs-browser/LICENSE
deleted file mode 100644
index b6f8f4003..000000000
--- a/node_modules/node-libs-browser/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-(The MIT License)
-
-Copyright (c) 2012 Tobias Koppers
-
-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.
diff --git a/node_modules/node-libs-browser/README.md b/node_modules/node-libs-browser/README.md
deleted file mode 100644
index a937ec4f9..000000000
--- a/node_modules/node-libs-browser/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-# node-libs-browser
-
-The node core libs for in-browser usage.
-
-[![dependencies status](http://david-dm.org/webpack/node-libs-browser.png)](http://david-dm.org/webpack/node-libs-browser)
-
-Exports a hash [object] of absolute paths to each lib, keyed by lib names. Modules without browser replacements are `null`.
-
-Some modules have mocks in the `mock` directory. These are replacements with minimal functionality.
-
-| lib name | browser implementation | mock implementation |
-|:--------:|:----------------------:|:-------------------:|
-| assert | [defunctzombie/commonjs-assert](https://github.com/defunctzombie/commonjs-assert) | --- |
-| buffer | [feross/buffer](https://github.com/feross/buffer) | [buffer.js](https://github.com/webpack/node-libs-browser/blob/master/mock/buffer.js) |
-| child_process | --- | --- |
-| cluster | --- | --- |
-| console | [Raynos/console-browserify](https://github.com/Raynos/console-browserify) | [console.js](https://github.com/webpack/node-libs-browser/blob/master/mock/console.js) |
-| constants | [juliangruber/constants-browserify](https://github.com/juliangruber/constants-browserify) | --- |
-| crypto | [crypto-browserify/crypto-browserify](https://github.com/crypto-browserify/crypto-browserify) | --- |
-| dgram | --- | --- |
-| dns | --- | [dns.js](https://github.com/webpack/node-libs-browser/blob/master/mock/dns.js) |
-| domain | [bevry/domain-browser](https://github.com/bevry/domain-browser) | --- |
-| events | [Gozala/events](https://github.com/Gozala/events) | --- |
-| fs | --- | --- |
-| http | [jhiesey/stream-http](https://github.com/jhiesey/stream-http) | --- |
-| https | [substack/https-browserify](https://github.com/substack/https-browserify) | --- |
-| module | --- | --- |
-| net | --- | [net.js](https://github.com/webpack/node-libs-browser/blob/master/mock/net.js) |
-| os | [CoderPuppy/os-browserify](https://github.com/CoderPuppy/os-browserify) | --- |
-| path | [substack/path-browserify](https://github.com/substack/path-browserify) | --- |
-| process | [shtylman/node-process](https://github.com/shtylman/node-process) | [process.js](https://github.com/webpack/node-libs-browser/blob/master/mock/process.js) |
-| punycode | [bestiejs/punycode.js](https://github.com/bestiejs/punycode.js) | --- |
-| querystring | [mike-spainhower/querystring](https://github.com/mike-spainhower/querystring) | --- |
-| readline | --- | --- |
-| repl | --- | --- |
-| stream | [substack/stream-browserify](https://github.com/substack/stream-browserify) | --- |
-| string_decoder | [rvagg/string_decoder](https://github.com/rvagg/string_decoder) | --- |
-| sys | [defunctzombie/node-util](https://github.com/defunctzombie/node-util) | --- |
-| timers | [jryans/timers-browserify](https://github.com/jryans/timers-browserify) | --- |
-| tls | --- | [tls.js](https://github.com/webpack/node-libs-browser/blob/master/mock/tls.js) |
-| tty | [substack/tty-browserify](https://github.com/substack/tty-browserify) | [tty.js](https://github.com/webpack/node-libs-browser/blob/master/mock/tty.js) |
-| url | [defunctzombie/node-url](https://github.com/defunctzombie/node-url) | --- |
-| util | [defunctzombie/node-util](https://github.com/defunctzombie/node-util) | --- |
-| vm | [substack/vm-browserify](https://github.com/substack/vm-browserify) | --- |
-| zlib | [devongovett/browserify-zlib](https://github.com/devongovett/browserify-zlib) | --- |
-
-## Outdated versions
-
-### `buffer`
-
-The current `buffer` implementation uses feross/buffer@4.x because feross/buffer@5.x relies on [typed arrays](https://github.com/feross/buffer/commit/5daca86b7cd5d2b8ccb167534d47421029f639e9#commitcomment-19698936).
-This will be dropped as soon as IE9 is not a typical browser target anymore.
-
-### `punycode`
-
-The current `punycode` implementation uses bestiejs/punycode.js@1.x because bestiejs/punycode.js@2.x requires modern JS engines that understand `const` and `let`.
-It will be removed someday since it has already been [deprecated from the node API](https://nodejs.org/api/punycode.html).
-
-## License
-
-MIT
diff --git a/node_modules/node-libs-browser/index.js b/node_modules/node-libs-browser/index.js
deleted file mode 100644
index 23c3185d0..000000000
--- a/node_modules/node-libs-browser/index.js
+++ /dev/null
@@ -1,38 +0,0 @@
-exports.assert = require.resolve('assert/');
-exports.buffer = require.resolve('buffer/');
-exports.child_process = null;
-exports.cluster = null;
-exports.console = require.resolve('console-browserify');
-exports.constants = require.resolve('constants-browserify');
-exports.crypto = require.resolve('crypto-browserify');
-exports.dgram = null;
-exports.dns = null;
-exports.domain = require.resolve('domain-browser');
-exports.events = require.resolve('events/');
-exports.fs = null;
-exports.http = require.resolve('stream-http');
-exports.https = require.resolve('https-browserify');
-exports.module = null;
-exports.net = null;
-exports.os = require.resolve('os-browserify/browser.js');
-exports.path = require.resolve('path-browserify');
-exports.punycode = require.resolve('punycode/');
-exports.process = require.resolve('process/browser.js');
-exports.querystring = require.resolve('querystring-es3/');
-exports.readline = null;
-exports.repl = null;
-exports.stream = require.resolve('stream-browserify');
-exports._stream_duplex = require.resolve('readable-stream/duplex.js');
-exports._stream_passthrough = require.resolve('readable-stream/passthrough.js');
-exports._stream_readable = require.resolve('readable-stream/readable.js');
-exports._stream_transform = require.resolve('readable-stream/transform.js');
-exports._stream_writable = require.resolve('readable-stream/writable.js');
-exports.string_decoder = require.resolve('string_decoder/');
-exports.sys = require.resolve('util/util.js');
-exports.timers = require.resolve('timers-browserify');
-exports.tls = null;
-exports.tty = require.resolve('tty-browserify');
-exports.url = require.resolve('url/');
-exports.util = require.resolve('util/util.js');
-exports.vm = require.resolve('vm-browserify');
-exports.zlib = require.resolve('browserify-zlib');
diff --git a/node_modules/node-libs-browser/mock/buffer.js b/node_modules/node-libs-browser/mock/buffer.js
deleted file mode 100644
index 76a2d1818..000000000
--- a/node_modules/node-libs-browser/mock/buffer.js
+++ /dev/null
@@ -1,10 +0,0 @@
-function Buffer() {
- throw new Error("Buffer is not included.");
-}
-Buffer.isBuffer = function() {
- return false;
-};
-
-exports.INSPECT_MAX_BYTES = 50;
-exports.SlowBuffer = Buffer;
-exports.Buffer = Buffer;
diff --git a/node_modules/node-libs-browser/mock/console.js b/node_modules/node-libs-browser/mock/console.js
deleted file mode 100644
index 2bc7d5f96..000000000
--- a/node_modules/node-libs-browser/mock/console.js
+++ /dev/null
@@ -1,12 +0,0 @@
-var console;
-if (typeof global !== "undefined" && global.console) {
- console = global.console
-} else if (typeof window !== "undefined" && window.console) {
- console = window.console
-} else {
- console = window.console = {}
-}
-module.exports = console;
-for(var name in {log:1, info:1, error:1, warn:1, dir:1, trace:1, assert:1, time:1, timeEnd: 1})
- if(!console[name])
- console[name] = function() {};
diff --git a/node_modules/node-libs-browser/mock/dns.js b/node_modules/node-libs-browser/mock/dns.js
deleted file mode 100644
index f15a0040e..000000000
--- a/node_modules/node-libs-browser/mock/dns.js
+++ /dev/null
@@ -1,15 +0,0 @@
-exports.lookup = exports.resolve4 =
-exports.resolve6 = exports.resolveCname =
-exports.resolveMx = exports.resolveNs =
-exports.resolveTxt = exports.resolveSrv =
-exports.resolveNaptr = exports.reverse =
-exports.resolve =
-function () {
- if (!arguments.length) return;
-
- var callback = arguments[arguments.length - 1];
- if (callback && typeof callback === 'function') {
- callback(null, '0.0.0.0')
- }
-}
-
diff --git a/node_modules/node-libs-browser/mock/empty.js b/node_modules/node-libs-browser/mock/empty.js
deleted file mode 100644
index e69de29bb..000000000
--- a/node_modules/node-libs-browser/mock/empty.js
+++ /dev/null
diff --git a/node_modules/node-libs-browser/mock/net.js b/node_modules/node-libs-browser/mock/net.js
deleted file mode 100644
index e42afc709..000000000
--- a/node_modules/node-libs-browser/mock/net.js
+++ /dev/null
@@ -1,10 +0,0 @@
-exports.createServer =
-exports.createConnection =
-exports.connect =
-function () {};
-
-exports.isIP =
-exports.isIPv4 =
-exports.isIPv6 =
-function () { return true };
-
diff --git a/node_modules/node-libs-browser/mock/process.js b/node_modules/node-libs-browser/mock/process.js
deleted file mode 100644
index 04f795974..000000000
--- a/node_modules/node-libs-browser/mock/process.js
+++ /dev/null
@@ -1,30 +0,0 @@
-exports.nextTick = function nextTick(fn) {
- setTimeout(fn, 0);
-};
-
-exports.platform = exports.arch =
-exports.execPath = exports.title = 'browser';
-exports.pid = 1;
-exports.browser = true;
-exports.env = {};
-exports.argv = [];
-
-exports.binding = function (name) {
- throw new Error('No such module. (Possibly not yet loaded)')
-};
-
-(function () {
- var cwd = '/';
- var path;
- exports.cwd = function () { return cwd };
- exports.chdir = function (dir) {
- if (!path) path = require('path');
- cwd = path.resolve(dir, cwd);
- };
-})();
-
-exports.exit = exports.kill =
-exports.umask = exports.dlopen =
-exports.uptime = exports.memoryUsage =
-exports.uvCounters = function() {};
-exports.features = {};
diff --git a/node_modules/node-libs-browser/mock/punycode.js b/node_modules/node-libs-browser/mock/punycode.js
deleted file mode 100644
index 9f964a173..000000000
--- a/node_modules/node-libs-browser/mock/punycode.js
+++ /dev/null
@@ -1,6 +0,0 @@
-exports.ucs2 = {};
-exports.encode = exports.decode =
-exports.ucs2.encode = exports.ucs2.decode =
-exports.toUnicode = exports.toASCII =
-function (s) { return s };
-exports.version = "0.0.0"; \ No newline at end of file
diff --git a/node_modules/node-libs-browser/mock/tls.js b/node_modules/node-libs-browser/mock/tls.js
deleted file mode 100644
index 65b3dba38..000000000
--- a/node_modules/node-libs-browser/mock/tls.js
+++ /dev/null
@@ -1 +0,0 @@
-// todo
diff --git a/node_modules/node-libs-browser/mock/tty.js b/node_modules/node-libs-browser/mock/tty.js
deleted file mode 100644
index a674e0f7a..000000000
--- a/node_modules/node-libs-browser/mock/tty.js
+++ /dev/null
@@ -1,2 +0,0 @@
-exports.isatty = function () {};
-exports.setRawMode = function () {};
diff --git a/node_modules/node-libs-browser/node_modules/string_decoder/LICENSE b/node_modules/node-libs-browser/node_modules/string_decoder/LICENSE
deleted file mode 100644
index 778edb207..000000000
--- a/node_modules/node-libs-browser/node_modules/string_decoder/LICENSE
+++ /dev/null
@@ -1,48 +0,0 @@
-Node.js is licensed for use as follows:
-
-"""
-Copyright Node.js contributors. All rights reserved.
-
-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.
-"""
-
-This license applies to parts of Node.js originating from the
-https://github.com/joyent/node repository:
-
-"""
-Copyright Joyent, Inc. and other Node contributors. All rights reserved.
-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.
-"""
-
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
deleted file mode 100644
index 5fd58315e..000000000
--- a/node_modules/node-libs-browser/node_modules/string_decoder/README.md
+++ /dev/null
@@ -1,47 +0,0 @@
-# string_decoder
-
-***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/)
-[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/)
-
-
-```bash
-npm install --save string_decoder
-```
-
-***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/v8.9.4/docs/api/).
-
-As of version 1.0.0 **string_decoder** uses semantic versioning.
-
-## Previous versions
-
-Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
-
-## 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
deleted file mode 100644
index 2e89e63f7..000000000
--- a/node_modules/node-libs-browser/node_modules/string_decoder/lib/string_decoder.js
+++ /dev/null
@@ -1,296 +0,0 @@
-// 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;
- switch (encoding && encoding.toLowerCase()) {
- case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
- return true;
- default:
- return false;
- }
-};
-
-function _normalizeEncoding(enc) {
- if (!enc) return 'utf8';
- var retried;
- while (true) {
- switch (enc) {
- case 'utf8':
- case 'utf-8':
- return 'utf8';
- case 'ucs2':
- case 'ucs-2':
- case 'utf16le':
- case 'utf-16le':
- return 'utf16le';
- case 'latin1':
- case 'binary':
- return 'latin1';
- case 'base64':
- case 'ascii':
- case 'hex':
- return enc;
- default:
- if (retried) return; // undefined
- enc = ('' + enc).toLowerCase();
- retried = true;
- }
- }
-};
-
-// Do not cache `Buffer.isEncoding` when checking encoding names as some
-// modules monkey-patch it to support additional encodings
-function normalizeEncoding(enc) {
- var nenc = _normalizeEncoding(enc);
- if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
- return nenc || enc;
-}
-
-// StringDecoder provides an interface for efficiently splitting a series of
-// buffers into a series of JS strings without breaking apart multi-byte
-// characters.
-exports.StringDecoder = StringDecoder;
-function StringDecoder(encoding) {
- this.encoding = normalizeEncoding(encoding);
- var nb;
- switch (this.encoding) {
- case 'utf16le':
- this.text = utf16Text;
- this.end = utf16End;
- nb = 4;
- break;
- case 'utf8':
- this.fillLast = utf8FillLast;
- nb = 4;
- break;
- case 'base64':
- this.text = base64Text;
- this.end = base64End;
- nb = 3;
- break;
- default:
- this.write = simpleWrite;
- this.end = simpleEnd;
- return;
- }
- this.lastNeed = 0;
- this.lastTotal = 0;
- this.lastChar = Buffer.allocUnsafe(nb);
-}
-
-StringDecoder.prototype.write = function (buf) {
- if (buf.length === 0) return '';
- var r;
- var i;
- if (this.lastNeed) {
- r = this.fillLast(buf);
- if (r === undefined) return '';
- i = this.lastNeed;
- this.lastNeed = 0;
- } else {
- i = 0;
- }
- if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
- return r || '';
-};
-
-StringDecoder.prototype.end = utf8End;
-
-// Returns only complete characters in a Buffer
-StringDecoder.prototype.text = utf8Text;
-
-// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
-StringDecoder.prototype.fillLast = function (buf) {
- if (this.lastNeed <= buf.length) {
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
- }
- buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
- this.lastNeed -= buf.length;
-};
-
-// 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.
-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;
-}
-
-// Checks at most 3 bytes at the end of a Buffer in order to detect an
-// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
-// needed to complete the UTF-8 character (if applicable) are returned.
-function utf8CheckIncomplete(self, buf, i) {
- var j = buf.length - 1;
- if (j < i) return 0;
- var nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) self.lastNeed = nb - 1;
- return nb;
- }
- 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 || nb === -2) return 0;
- nb = utf8CheckByte(buf[j]);
- if (nb >= 0) {
- if (nb > 0) {
- if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
- }
- return nb;
- }
- return 0;
-}
-
-// 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
-// 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
-// loop.
-function utf8CheckExtraBytes(self, buf, p) {
- if ((buf[0] & 0xC0) !== 0x80) {
- self.lastNeed = 0;
- return '\ufffd';
- }
- if (self.lastNeed > 1 && buf.length > 1) {
- if ((buf[1] & 0xC0) !== 0x80) {
- self.lastNeed = 1;
- return '\ufffd';
- }
- if (self.lastNeed > 2 && buf.length > 2) {
- if ((buf[2] & 0xC0) !== 0x80) {
- self.lastNeed = 2;
- return '\ufffd';
- }
- }
- }
-}
-
-// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
-function utf8FillLast(buf) {
- var p = this.lastTotal - this.lastNeed;
- var r = utf8CheckExtraBytes(this, buf, p);
- if (r !== undefined) return r;
- if (this.lastNeed <= buf.length) {
- buf.copy(this.lastChar, p, 0, this.lastNeed);
- return this.lastChar.toString(this.encoding, 0, this.lastTotal);
- }
- buf.copy(this.lastChar, p, 0, buf.length);
- this.lastNeed -= buf.length;
-}
-
-// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
-// partial character, the character's bytes are buffered until the required
-// number of bytes are available.
-function utf8Text(buf, i) {
- var total = utf8CheckIncomplete(this, buf, i);
- if (!this.lastNeed) return buf.toString('utf8', i);
- this.lastTotal = total;
- var end = buf.length - (total - this.lastNeed);
- buf.copy(this.lastChar, 0, end);
- return buf.toString('utf8', i, end);
-}
-
-// 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';
- return r;
-}
-
-// UTF-16LE typically needs two bytes per character, but even if we have an even
-// number of bytes available, we need to check if we end on a leading/high
-// surrogate. In that case, we need to wait for the next two bytes in order to
-// decode the last character properly.
-function utf16Text(buf, i) {
- if ((buf.length - i) % 2 === 0) {
- var r = buf.toString('utf16le', i);
- if (r) {
- var c = r.charCodeAt(r.length - 1);
- if (c >= 0xD800 && c <= 0xDBFF) {
- this.lastNeed = 2;
- this.lastTotal = 4;
- this.lastChar[0] = buf[buf.length - 2];
- this.lastChar[1] = buf[buf.length - 1];
- return r.slice(0, -1);
- }
- }
- return r;
- }
- this.lastNeed = 1;
- this.lastTotal = 2;
- this.lastChar[0] = buf[buf.length - 1];
- return buf.toString('utf16le', i, buf.length - 1);
-}
-
-// For UTF-16LE we do not explicitly append special replacement characters if we
-// end on a partial character, we simply let v8 handle that.
-function utf16End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) {
- var end = this.lastTotal - this.lastNeed;
- return r + this.lastChar.toString('utf16le', 0, end);
- }
- return r;
-}
-
-function base64Text(buf, i) {
- var n = (buf.length - i) % 3;
- if (n === 0) return buf.toString('base64', i);
- this.lastNeed = 3 - n;
- this.lastTotal = 3;
- if (n === 1) {
- this.lastChar[0] = buf[buf.length - 1];
- } else {
- this.lastChar[0] = buf[buf.length - 2];
- this.lastChar[1] = buf[buf.length - 1];
- }
- return buf.toString('base64', i, buf.length - n);
-}
-
-function base64End(buf) {
- var r = buf && buf.length ? this.write(buf) : '';
- if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
- return r;
-}
-
-// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
-function simpleWrite(buf) {
- return buf.toString(this.encoding);
-}
-
-function simpleEnd(buf) {
- return buf && buf.length ? this.write(buf) : '';
-} \ No newline at end of file
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
deleted file mode 100644
index 518c3eb9f..000000000
--- a/node_modules/node-libs-browser/node_modules/string_decoder/package.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "name": "string_decoder",
- "version": "1.1.1",
- "description": "The string_decoder module from Node core",
- "main": "lib/string_decoder.js",
- "dependencies": {
- "safe-buffer": "~5.1.0"
- },
- "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",
- "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/nodejs/string_decoder.git"
- },
- "homepage": "https://github.com/nodejs/string_decoder",
- "keywords": [
- "string",
- "decoder",
- "browser",
- "browserify"
- ],
- "license": "MIT"
-}
diff --git a/node_modules/node-libs-browser/package.json b/node_modules/node-libs-browser/package.json
deleted file mode 100644
index de74745a6..000000000
--- a/node_modules/node-libs-browser/package.json
+++ /dev/null
@@ -1,48 +0,0 @@
-{
- "name": "node-libs-browser",
- "version": "2.1.0",
- "author": "Tobias Koppers @sokra",
- "description": "The node core libs for in browser usage.",
- "repository": {
- "type": "git",
- "url": "git+https://github.com/webpack/node-libs-browser.git"
- },
- "dependencies": {
- "assert": "^1.1.1",
- "browserify-zlib": "^0.2.0",
- "buffer": "^4.3.0",
- "console-browserify": "^1.1.0",
- "constants-browserify": "^1.0.0",
- "crypto-browserify": "^3.11.0",
- "domain-browser": "^1.1.1",
- "events": "^1.0.0",
- "https-browserify": "^1.0.0",
- "os-browserify": "^0.3.0",
- "path-browserify": "0.0.0",
- "process": "^0.11.10",
- "punycode": "^1.2.4",
- "querystring-es3": "^0.2.0",
- "readable-stream": "^2.3.3",
- "stream-browserify": "^2.0.1",
- "stream-http": "^2.7.2",
- "string_decoder": "^1.0.0",
- "timers-browserify": "^2.0.4",
- "tty-browserify": "0.0.0",
- "url": "^0.11.0",
- "util": "^0.10.3",
- "vm-browserify": "0.0.4"
- },
- "homepage": "http://github.com/webpack/node-libs-browser",
- "main": "index.js",
- "files": [
- "index.js",
- "mock/"
- ],
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "license": "MIT",
- "bugs": {
- "url": "https://github.com/webpack/node-libs-browser/issues"
- }
-}