first commit

This commit is contained in:
s.golasch
2023-08-01 13:49:46 +02:00
commit 1fc239fd54
20238 changed files with 3112246 additions and 0 deletions

2
build/node_modules/buffer-fill/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,2 @@
/node_modules/
/npm-debug.log

113
build/node_modules/buffer-fill/index.js generated vendored Normal file
View File

@@ -0,0 +1,113 @@
/* Node.js 6.4.0 and up has full support */
var hasFullSupport = (function () {
try {
if (!Buffer.isEncoding('latin1')) {
return false
}
var buf = 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

46
build/node_modules/buffer-fill/package.json generated vendored Normal file
View File

@@ -0,0 +1,46 @@
{
"_from": "buffer-fill@^0.1.0",
"_id": "buffer-fill@0.1.0",
"_inBundle": false,
"_integrity": "sha1-ypRw6NTRuXf9dUP04qtqfclRAag=",
"_location": "/buffer-fill",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "buffer-fill@^0.1.0",
"name": "buffer-fill",
"escapedName": "buffer-fill",
"rawSpec": "^0.1.0",
"saveSpec": null,
"fetchSpec": "^0.1.0"
},
"_requiredBy": [
"/buffer-alloc"
],
"_resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-0.1.0.tgz",
"_shasum": "ca9470e8d4d1b977fd7543f4e2ab6a7dc95101a8",
"_spec": "buffer-fill@^0.1.0",
"_where": "/Users/asciidisco/Desktop/asciidisco.com/build/node_modules/buffer-alloc",
"bugs": {
"url": "https://github.com/LinusU/buffer-fill/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "A ponyfill for `Buffer.fill`.",
"devDependencies": {
"buffer-alloc-unsafe": "^0.1.0",
"standard": "^7.1.2"
},
"homepage": "https://github.com/LinusU/buffer-fill#readme",
"license": "MIT",
"name": "buffer-fill",
"repository": {
"type": "git",
"url": "git+https://github.com/LinusU/buffer-fill.git"
},
"scripts": {
"test": "standard && node test"
},
"version": "0.1.0"
}

54
build/node_modules/buffer-fill/readme.md generated vendored Normal file
View File

@@ -0,0 +1,54 @@
# Buffer Fill
A ponyfill for `Buffer.fill`.
Works as Node.js: `v6.4.0` <br>
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))
//=> <Buffer 08 08 08 08 08>
console.log(buf.fill(9, 2, 4))
//=> <Buffer 08 08 09 09 08>
console.log(buf.fill('linus', 'latin1'))
//=> <Buffer 6c 69 6e 75 73>
console.log(buf.fill('\u0222'))
//=> <Buffer c8 a2 c8 a2 c8>
```
## API
### fill(buf, value[, offset[, end]][, encoding])
- `value` &lt;String&gt; | &lt;Buffer&gt; | &lt;Integer&gt; The value to fill `buf` with
- `offset` &lt;Integer&gt; Where to start filling `buf`. **Default:** `0`
- `end` &lt;Integer&gt; Where to stop filling `buf` (not inclusive). **Default:** `buf.length`
- `encoding` &lt;String&gt; If `value` is a string, this is its encoding. **Default:** `'utf8'`
- Return: &lt;Buffer&gt; 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`

175
build/node_modules/buffer-fill/test.js generated vendored Normal file
View File

@@ -0,0 +1,175 @@
var os = require('os')
var assert = require('assert')
var allocUnsafe = require('buffer-alloc-unsafe')
var fill = require('./')
var SIZE = 28
var EMPTY = '00000000000000000000000000000000000000000000000000000000'
// Check exceptions
var buf1 = allocUnsafe(SIZE)
assert.throws(function () { fill(buf1, 0, -1) })
assert.throws(function () { fill(buf1, 0, 0, buf1.length + 1) })
assert.throws(function () { fill(buf1, '', -1) })
assert.throws(function () { fill(buf1, '', 0, buf1.length + 1) })
assert.throws(function () { fill(buf1, 'a', 0, buf1.length, 'node rocks!') })
assert.throws(function () { fill(buf1, 'a', 0, 0, NaN) })
assert.throws(function () { fill(buf1, 'a', 0, 0, null) })
assert.throws(function () { fill(buf1, 'a', 0, 0, 'foo') })
assert.throws(function () { fill(buf1, '\u0222', 'hex') })
// Edge cases
var buf2 = allocUnsafe(1)
assert.equal(fill(buf2, 0)[0], 0x00)
assert.equal(fill(buf2, '\u0222')[0], 0xc8)
var buf3 = allocUnsafe(1)
assert.equal(fill(buf3, '\u0222', 'ucs2')[0], os.endianness() === 'LE' ? 0x22 : 0x02)
// Precomputed test cases
var testCases = [
// Default encoding
['61626361626361626361626361626361626361626361626361626361', ['abc']],
['c8a26161c8a26161c8a26161c8a26161c8a26161c8a26161c8a26161', ['\u0222aa']],
['61c8b462c8b563c8b661c8b462c8b563c8b661c8b462c8b563c8b661', ['a\u0234b\u0235c\u0236']],
['00000000616263616263616263616263616263616263616263616263', ['abc', 4]],
['00000000006162636162636162636162636162636162636162636162', ['abc', 5]],
['00000000000000000000000000000000000000000000000000000000', ['abc', SIZE]],
['0000c8a26161c8a26161c8a26161c8a26161c8a26161c8a26161c8a2', ['\u0222aa', 2]],
['0000000000000000c8a26161c8a26161c8a26161c8a26161c8a26161', ['\u0222aa', 8]],
['0000000061c8b462c8b563c8b661c8b462c8b563c8b661c8b462c8b5', ['a\u0234b\u0235c\u0236', 4]],
['00000000000000000000000061c8b462c8b563c8b661c8b462c8b563', ['a\u0234b\u0235c\u0236', 12]],
['00000000000000000000000000000000000000000000000000000000', ['abc', 4, -1]],
['00000000000000000000000000000000000000000000000000000000', ['abc', 4, 1]],
['00000000000000000000000000000000000000000000000000000000', ['abc', 5, 1]],
['00000000000000000000000000000000000000000000000000000000', ['\u0222aa', 2, -1]],
['00000000000000000000000000000000000000000000000000000000', ['\u0222aa', 8, 1]],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 4, -1]],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 4, 1]],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 12, 1]],
// UTF8
['61626361626361626361626361626361626361626361626361626361', ['abc', 'utf8']],
['c8a26161c8a26161c8a26161c8a26161c8a26161c8a26161c8a26161', ['\u0222aa', 'utf8']],
['61c8b462c8b563c8b661c8b462c8b563c8b661c8b462c8b563c8b661', ['a\u0234b\u0235c\u0236', 'utf8']],
['00000000616263616263616263616263616263616263616263616263', ['abc', 4, 'utf8']],
['00000000006162636162636162636162636162636162636162636162', ['abc', 5, 'utf8']],
['00000000000000000000000000000000000000000000000000000000', ['abc', SIZE, 'utf8']],
['0000c8a26161c8a26161c8a26161c8a26161c8a26161c8a26161c8a2', ['\u0222aa', 2, 'utf8']],
['0000000000000000c8a26161c8a26161c8a26161c8a26161c8a26161', ['\u0222aa', 8, 'utf8']],
['0000000061c8b462c8b563c8b661c8b462c8b563c8b661c8b462c8b5', ['a\u0234b\u0235c\u0236', 4, 'utf8']],
['00000000000000000000000061c8b462c8b563c8b661c8b462c8b563', ['a\u0234b\u0235c\u0236', 12, 'utf8']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 4, -1, 'utf8']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 4, 1, 'utf8']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 5, 1, 'utf8']],
['00000000000000000000000000000000000000000000000000000000', ['\u0222aa', 2, -1, 'utf8']],
['00000000000000000000000000000000000000000000000000000000', ['\u0222aa', 8, 1, 'utf8']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 4, -1, 'utf8']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 4, 1, 'utf8']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 12, 1, 'utf8']],
// BINARY
['61626361626361626361626361626361626361626361626361626361', ['abc', 'binary']],
['22616122616122616122616122616122616122616122616122616122', ['\u0222aa', 'binary']],
['61346235633661346235633661346235633661346235633661346235', ['a\u0234b\u0235c\u0236', 'binary']],
['00000000616263616263616263616263616263616263616263616263', ['abc', 4, 'binary']],
['00000000006162636162636162636162636162636162636162636162', ['abc', 5, 'binary']],
['00000000000000000000000000000000000000000000000000000000', ['abc', SIZE, 'binary']],
['00002261612261612261612261612261612261612261612261612261', ['\u0222aa', 2, 'binary']],
['00000000000000002261612261612261612261612261612261612261', ['\u0222aa', 8, 'binary']],
['00000000613462356336613462356336613462356336613462356336', ['a\u0234b\u0235c\u0236', 4, 'binary']],
['00000000000000000000000061346235633661346235633661346235', ['a\u0234b\u0235c\u0236', 12, 'binary']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 4, -1, 'binary']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 4, 1, 'binary']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 5, 1, 'binary']],
['00000000000000000000000000000000000000000000000000000000', ['\u0222aa', 2, -1, 'binary']],
['00000000000000000000000000000000000000000000000000000000', ['\u0222aa', 8, 1, 'binary']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 4, -1, 'binary']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 4, 1, 'binary']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 12, 1, 'binary']],
// LATIN1
['61626361626361626361626361626361626361626361626361626361', ['abc', 'latin1']],
['22616122616122616122616122616122616122616122616122616122', ['\u0222aa', 'latin1']],
['61346235633661346235633661346235633661346235633661346235', ['a\u0234b\u0235c\u0236', 'latin1']],
['00000000616263616263616263616263616263616263616263616263', ['abc', 4, 'latin1']],
['00000000006162636162636162636162636162636162636162636162', ['abc', 5, 'latin1']],
['00000000000000000000000000000000000000000000000000000000', ['abc', SIZE, 'latin1']],
['00002261612261612261612261612261612261612261612261612261', ['\u0222aa', 2, 'latin1']],
['00000000000000002261612261612261612261612261612261612261', ['\u0222aa', 8, 'latin1']],
['00000000613462356336613462356336613462356336613462356336', ['a\u0234b\u0235c\u0236', 4, 'latin1']],
['00000000000000000000000061346235633661346235633661346235', ['a\u0234b\u0235c\u0236', 12, 'latin1']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 4, -1, 'latin1']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 4, 1, 'latin1']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 5, 1, 'latin1']],
['00000000000000000000000000000000000000000000000000000000', ['\u0222aa', 2, -1, 'latin1']],
['00000000000000000000000000000000000000000000000000000000', ['\u0222aa', 8, 1, 'latin1']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 4, -1, 'latin1']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 4, 1, 'latin1']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 12, 1, 'latin1']],
// UCS2
['61006200630061006200630061006200630061006200630061006200', ['abc', 'ucs2']],
['22026100610022026100610022026100610022026100610022026100', ['\u0222aa', 'ucs2']],
['61003402620035026300360261003402620035026300360261003402', ['a\u0234b\u0235c\u0236', 'ucs2']],
['00000000610062006300610062006300610062006300610062006300', ['abc', 4, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['abc', SIZE, 'ucs2']],
['00002202610061002202610061002202610061002202610061002202', ['\u0222aa', 2, 'ucs2']],
['00000000000000002202610061002202610061002202610061002202', ['\u0222aa', 8, 'ucs2']],
['00000000610034026200350263003602610034026200350263003602', ['a\u0234b\u0235c\u0236', 4, 'ucs2']],
['00000000000000000000000061003402620035026300360261003402', ['a\u0234b\u0235c\u0236', 12, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 4, -1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 4, 1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['abc', 5, 1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['\u0222aa', 2, -1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['\u0222aa', 8, 1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 4, -1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 4, 1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['a\u0234b\u0235c\u0236', 12, 1, 'ucs2']],
// HEX
['61626361626361626361626361626361626361626361626361626361', ['616263', 'hex']],
['c8a26161c8a26161c8a26161c8a26161c8a26161c8a26161c8a26161', ['c8a26161', 'hex']],
['61c8b462c8b563c8b661c8b462c8b563c8b661c8b462c8b563c8b661', ['61c8b462c8b563c8b6', 'hex']],
['00000000616263616263616263616263616263616263616263616263', ['616263', 4, 'hex']],
['00000000006162636162636162636162636162636162636162636162', ['616263', 5, 'hex']],
['00000000000000000000000000000000000000000000000000000000', ['616263', SIZE, 'hex']],
['0000c8a26161c8a26161c8a26161c8a26161c8a26161c8a26161c8a2', ['c8a26161', 2, 'hex']],
['0000000000000000c8a26161c8a26161c8a26161c8a26161c8a26161', ['c8a26161', 8, 'hex']],
['0000000061c8b462c8b563c8b661c8b462c8b563c8b661c8b462c8b5', ['61c8b462c8b563c8b6', 4, 'hex']],
['00000000000000000000000061c8b462c8b563c8b661c8b462c8b563', ['61c8b462c8b563c8b6', 12, 'hex']],
['00000000000000000000000000000000000000000000000000000000', ['616263', 4, -1, 'hex']],
['00000000000000000000000000000000000000000000000000000000', ['616263', 4, 1, 'hex']],
['00000000000000000000000000000000000000000000000000000000', ['616263', 5, 1, 'hex']],
['00000000000000000000000000000000000000000000000000000000', ['c8a26161', 2, -1, 'hex']],
['00000000000000000000000000000000000000000000000000000000', ['c8a26161', 8, 1, 'hex']],
['00000000000000000000000000000000000000000000000000000000', ['61c8b462c8b563c8b6', 4, -1, 'hex']],
['00000000000000000000000000000000000000000000000000000000', ['61c8b462c8b563c8b6', 4, 1, 'hex']],
['00000000000000000000000000000000000000000000000000000000', ['61c8b462c8b563c8b6', 12, 1, 'hex']],
// BASE64
['590057004a006a00590057004a006a00590057004a006a0059005700', ['YWJj', 'ucs2']],
['79004b004a006800590051003d003d0079004b004a00680059005100', ['yKJhYQ==', 'ucs2']],
['59006300690030005900730069003100590038006900320059006300', ['Yci0Ysi1Y8i2', 'ucs2']],
['00000000590057004a006a00590057004a006a00590057004a006a00', ['YWJj', 4, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['YWJj', SIZE, 'ucs2']],
['000079004b004a006800590051003d003d0079004b004a0068005900', ['yKJhYQ==', 2, 'ucs2']],
['000000000000000079004b004a006800590051003d003d0079004b00', ['yKJhYQ==', 8, 'ucs2']],
['00000000590063006900300059007300690031005900380069003200', ['Yci0Ysi1Y8i2', 4, 'ucs2']],
['00000000000000000000000059006300690030005900730069003100', ['Yci0Ysi1Y8i2', 12, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['YWJj', 4, -1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['YWJj', 4, 1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['YWJj', 5, 1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['yKJhYQ==', 2, -1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['yKJhYQ==', 8, 1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['Yci0Ysi1Y8i2', 4, -1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['Yci0Ysi1Y8i2', 4, 1, 'ucs2']],
['00000000000000000000000000000000000000000000000000000000', ['Yci0Ysi1Y8i2', 12, 1, 'ucs2']]
]
var buf4 = allocUnsafe(SIZE)
for (var i = 0; i < testCases.length; i++) {
assert.equal(fill(buf4, 0).toString('hex'), EMPTY)
assert.equal(fill.apply(null, [buf4].concat(testCases[i][1])).toString('hex'), testCases[i][0])
}