From 726b81b19251674e149ccfbb1abacbd837fc6db0 Mon Sep 17 00:00:00 2001 From: LinuxWizard42 Date: Wed, 12 Oct 2022 23:08:57 +0300 Subject: Removed files that should not have been included in git --- node_modules/buffer-fill/index.js | 113 ---------------------------------- node_modules/buffer-fill/package.json | 16 ----- node_modules/buffer-fill/readme.md | 54 ---------------- 3 files changed, 183 deletions(-) delete mode 100644 node_modules/buffer-fill/index.js delete mode 100644 node_modules/buffer-fill/package.json delete mode 100644 node_modules/buffer-fill/readme.md (limited to 'node_modules/buffer-fill') diff --git a/node_modules/buffer-fill/index.js b/node_modules/buffer-fill/index.js deleted file mode 100644 index 428a9e1..0000000 --- a/node_modules/buffer-fill/index.js +++ /dev/null @@ -1,113 +0,0 @@ -/* Node.js 6.4.0 and up has full support */ -var hasFullSupport = (function () { - try { - if (!Buffer.isEncoding('latin1')) { - return false - } - - var buf = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4) - - buf.fill('ab', 'ucs2') - - return (buf.toString('hex') === '61006200') - } catch (_) { - return false - } -}()) - -function isSingleByte (val) { - return (val.length === 1 && val.charCodeAt(0) < 256) -} - -function fillWithNumber (buffer, val, start, end) { - if (start < 0 || end > buffer.length) { - throw new RangeError('Out of range index') - } - - start = start >>> 0 - end = end === undefined ? buffer.length : end >>> 0 - - if (end > start) { - buffer.fill(val, start, end) - } - - return buffer -} - -function fillWithBuffer (buffer, val, start, end) { - if (start < 0 || end > buffer.length) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return buffer - } - - start = start >>> 0 - end = end === undefined ? buffer.length : end >>> 0 - - var pos = start - var len = val.length - while (pos <= (end - len)) { - val.copy(buffer, pos) - pos += len - } - - if (pos !== end) { - val.copy(buffer, pos, 0, end - pos) - } - - return buffer -} - -function fill (buffer, val, start, end, encoding) { - if (hasFullSupport) { - return buffer.fill(val, start, end, encoding) - } - - if (typeof val === 'number') { - return fillWithNumber(buffer, val, start, end) - } - - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start - start = 0 - end = buffer.length - } else if (typeof end === 'string') { - encoding = end - end = buffer.length - } - - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - - if (encoding === 'latin1') { - encoding = 'binary' - } - - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - - if (val === '') { - return fillWithNumber(buffer, 0, start, end) - } - - if (isSingleByte(val)) { - return fillWithNumber(buffer, val.charCodeAt(0), start, end) - } - - val = new Buffer(val, encoding) - } - - if (Buffer.isBuffer(val)) { - return fillWithBuffer(buffer, val, start, end) - } - - // Other values (e.g. undefined, boolean, object) results in zero-fill - return fillWithNumber(buffer, 0, start, end) -} - -module.exports = fill diff --git a/node_modules/buffer-fill/package.json b/node_modules/buffer-fill/package.json deleted file mode 100644 index b8f67c5..0000000 --- a/node_modules/buffer-fill/package.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "buffer-fill", - "version": "1.0.0", - "license": "MIT", - "repository": "LinusU/buffer-fill", - "files": [ - "index.js" - ], - "scripts": { - "test": "standard && node test" - }, - "devDependencies": { - "buffer-alloc-unsafe": "^1.1.0", - "standard": "^7.1.2" - } -} diff --git a/node_modules/buffer-fill/readme.md b/node_modules/buffer-fill/readme.md deleted file mode 100644 index ac30738..0000000 --- a/node_modules/buffer-fill/readme.md +++ /dev/null @@ -1,54 +0,0 @@ -# Buffer Fill - -A [ponyfill](https://ponyfill.com) for `Buffer.fill`. - -Works as Node.js: `v6.4.0`
-Works on Node.js: `v0.10.0` - -## Installation - -```sh -npm install --save buffer-fill -``` - -## Usage - -```js -const fill = require('buffer-fill') -const buf = Buffer.allocUnsafe(5) - -console.log(buf.fill(8)) -//=> - -console.log(buf.fill(9, 2, 4)) -//=> - -console.log(buf.fill('linus', 'latin1')) -//=> - -console.log(buf.fill('\u0222')) -//=> -``` - -## API - -### fill(buf, value[, offset[, end]][, encoding]) - -- `value` <String> | <Buffer> | <Integer> The value to fill `buf` with -- `offset` <Integer> Where to start filling `buf`. **Default:** `0` -- `end` <Integer> Where to stop filling `buf` (not inclusive). **Default:** `buf.length` -- `encoding` <String> If `value` is a string, this is its encoding. **Default:** `'utf8'` -- Return: <Buffer> A reference to `buf` - -Fills `buf` with the specified `value`. If the `offset` and `end` are not given, -the entire `buf` will be filled. This is meant to be a small simplification to -allow the creation and filling of a `Buffer` to be done on a single line. - -If the final write of a `fill()` operation falls on a multi-byte character, then -only the first bytes of that character that fit into `buf` are written. - -## See also - -- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe` -- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc` -- [buffer-from](https://github.com/LinusU/buffer-from) A ponyfill for `Buffer.from` -- cgit v1.2.3-86-g962b