aboutsummaryrefslogtreecommitdiff
path: root/node_modules/buffer-shims
diff options
context:
space:
mode:
authorAlee14 <Alee14498@gmail.com>2017-07-28 16:20:27 -0400
committerAlee14 <Alee14498@gmail.com>2017-07-28 16:20:27 -0400
commitd35e0862e6b60fe3c4f823371627359f3ce3e68b (patch)
treed98b788eb1abf0a8814207b993b4e22efe711deb /node_modules/buffer-shims
parent20993df62e7e38ed43428aafa5981afc3543bdea (diff)
downloadAleeBot-d35e0862e6b60fe3c4f823371627359f3ce3e68b.tar.gz
AleeBot-d35e0862e6b60fe3c4f823371627359f3ce3e68b.tar.bz2
AleeBot-d35e0862e6b60fe3c4f823371627359f3ce3e68b.zip
Removing node modules (go get them yourself :P)
Diffstat (limited to 'node_modules/buffer-shims')
-rw-r--r--node_modules/buffer-shims/index.js108
-rw-r--r--node_modules/buffer-shims/license.md19
-rw-r--r--node_modules/buffer-shims/package.json85
-rw-r--r--node_modules/buffer-shims/readme.md21
4 files changed, 0 insertions, 233 deletions
diff --git a/node_modules/buffer-shims/index.js b/node_modules/buffer-shims/index.js
deleted file mode 100644
index 1cab4c0..0000000
--- a/node_modules/buffer-shims/index.js
+++ /dev/null
@@ -1,108 +0,0 @@
-'use strict';
-
-var buffer = require('buffer');
-var Buffer = buffer.Buffer;
-var SlowBuffer = buffer.SlowBuffer;
-var MAX_LEN = buffer.kMaxLength || 2147483647;
-exports.alloc = function alloc(size, fill, encoding) {
- if (typeof Buffer.alloc === 'function') {
- return Buffer.alloc(size, fill, encoding);
- }
- if (typeof encoding === 'number') {
- throw new TypeError('encoding must not be number');
- }
- if (typeof size !== 'number') {
- throw new TypeError('size must be a number');
- }
- if (size > MAX_LEN) {
- throw new RangeError('size is too large');
- }
- var enc = encoding;
- var _fill = fill;
- if (_fill === undefined) {
- enc = undefined;
- _fill = 0;
- }
- var buf = new Buffer(size);
- if (typeof _fill === 'string') {
- var fillBuf = new Buffer(_fill, enc);
- var flen = fillBuf.length;
- var i = -1;
- while (++i < size) {
- buf[i] = fillBuf[i % flen];
- }
- } else {
- buf.fill(_fill);
- }
- return buf;
-}
-exports.allocUnsafe = function allocUnsafe(size) {
- if (typeof Buffer.allocUnsafe === 'function') {
- return Buffer.allocUnsafe(size);
- }
- if (typeof size !== 'number') {
- throw new TypeError('size must be a number');
- }
- if (size > MAX_LEN) {
- throw new RangeError('size is too large');
- }
- return new Buffer(size);
-}
-exports.from = function from(value, encodingOrOffset, length) {
- if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
- return Buffer.from(value, encodingOrOffset, length);
- }
- if (typeof value === 'number') {
- throw new TypeError('"value" argument must not be a number');
- }
- if (typeof value === 'string') {
- return new Buffer(value, encodingOrOffset);
- }
- if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
- var offset = encodingOrOffset;
- if (arguments.length === 1) {
- return new Buffer(value);
- }
- if (typeof offset === 'undefined') {
- offset = 0;
- }
- var len = length;
- if (typeof len === 'undefined') {
- len = value.byteLength - offset;
- }
- if (offset >= value.byteLength) {
- throw new RangeError('\'offset\' is out of bounds');
- }
- if (len > value.byteLength - offset) {
- throw new RangeError('\'length\' is out of bounds');
- }
- return new Buffer(value.slice(offset, offset + len));
- }
- if (Buffer.isBuffer(value)) {
- var out = new Buffer(value.length);
- value.copy(out, 0, 0, value.length);
- return out;
- }
- if (value) {
- if (Array.isArray(value) || (typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer) || 'length' in value) {
- return new Buffer(value);
- }
- if (value.type === 'Buffer' && Array.isArray(value.data)) {
- return new Buffer(value.data);
- }
- }
-
- throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
-}
-exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
- if (typeof Buffer.allocUnsafeSlow === 'function') {
- return Buffer.allocUnsafeSlow(size);
- }
- if (typeof size !== 'number') {
- throw new TypeError('size must be a number');
- }
- if (size >= MAX_LEN) {
- throw new RangeError('size is too large');
- }
- return new SlowBuffer(size);
-}
diff --git a/node_modules/buffer-shims/license.md b/node_modules/buffer-shims/license.md
deleted file mode 100644
index 01cfaef..0000000
--- a/node_modules/buffer-shims/license.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2016 Calvin Metcalf
-
-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/buffer-shims/package.json b/node_modules/buffer-shims/package.json
deleted file mode 100644
index 5da50e5..0000000
--- a/node_modules/buffer-shims/package.json
+++ /dev/null
@@ -1,85 +0,0 @@
-{
- "_args": [
- [
- {
- "raw": "buffer-shims@^1.0.0",
- "scope": null,
- "escapedName": "buffer-shims",
- "name": "buffer-shims",
- "rawSpec": "^1.0.0",
- "spec": ">=1.0.0 <2.0.0",
- "type": "range"
- },
- "F:\\Coding\\JavaScript\\AleeBot\\node_modules\\readable-stream"
- ]
- ],
- "_from": "buffer-shims@>=1.0.0 <2.0.0",
- "_id": "buffer-shims@1.0.0",
- "_inCache": true,
- "_location": "/buffer-shims",
- "_nodeVersion": "5.11.0",
- "_npmOperationalInternal": {
- "host": "packages-16-east.internal.npmjs.com",
- "tmp": "tmp/buffer-shims-1.0.0.tgz_1462560889323_0.8640750856138766"
- },
- "_npmUser": {
- "name": "cwmma",
- "email": "calvin.metcalf@gmail.com"
- },
- "_npmVersion": "3.8.6",
- "_phantomChildren": {},
- "_requested": {
- "raw": "buffer-shims@^1.0.0",
- "scope": null,
- "escapedName": "buffer-shims",
- "name": "buffer-shims",
- "rawSpec": "^1.0.0",
- "spec": ">=1.0.0 <2.0.0",
- "type": "range"
- },
- "_requiredBy": [
- "/readable-stream"
- ],
- "_resolved": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz",
- "_shasum": "9978ce317388c649ad8793028c3477ef044a8b51",
- "_shrinkwrap": null,
- "_spec": "buffer-shims@^1.0.0",
- "_where": "F:\\Coding\\JavaScript\\AleeBot\\node_modules\\readable-stream",
- "bugs": {
- "url": "https://github.com/calvinmetcalf/buffer-shims/issues"
- },
- "dependencies": {},
- "description": "some shims for node buffers",
- "devDependencies": {
- "tape": "^4.5.1"
- },
- "directories": {},
- "dist": {
- "shasum": "9978ce317388c649ad8793028c3477ef044a8b51",
- "tarball": "https://registry.npmjs.org/buffer-shims/-/buffer-shims-1.0.0.tgz"
- },
- "files": [
- "index.js"
- ],
- "gitHead": "ea89b3857ab5b8203957922a84e9a48cf4c47e0a",
- "homepage": "https://github.com/calvinmetcalf/buffer-shims#readme",
- "license": "MIT",
- "main": "index.js",
- "maintainers": [
- {
- "name": "cwmma",
- "email": "calvin.metcalf@gmail.com"
- }
- ],
- "name": "buffer-shims",
- "optionalDependencies": {},
- "readme": "ERROR: No README data found!",
- "repository": {
- "type": "git",
- "url": "git+ssh://git@github.com/calvinmetcalf/buffer-shims.git"
- },
- "scripts": {
- "test": "tape test/*.js"
- },
- "version": "1.0.0"
-}
diff --git a/node_modules/buffer-shims/readme.md b/node_modules/buffer-shims/readme.md
deleted file mode 100644
index 7ea6475..0000000
--- a/node_modules/buffer-shims/readme.md
+++ /dev/null
@@ -1,21 +0,0 @@
-buffer-shims
-===
-
-functions to make sure the new buffer methods work in older browsers.
-
-```js
-var bufferShim = require('buffer-shims');
-bufferShim.from('foo');
-bufferShim.alloc(9, 'cafeface', 'hex');
-bufferShim.allocUnsafe(15);
-bufferShim.allocUnsafeSlow(21);
-```
-
-should just use the original in newer nodes and on older nodes uses fallbacks.
-
-Known Issues
-===
-- this does not patch the buffer object, only the constructor stuff
-- it's actually a polyfill
-
-![](https://i.imgur.com/zxII3jJ.gif)