0.2.0 - Mid migration

This commit is contained in:
Daniel Mason 2022-04-25 14:47:15 +12:00
parent 139e6a915e
commit 7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions

21
web/node_modules/array-flatten/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com)
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.

50
web/node_modules/array-flatten/README.md generated vendored Normal file
View file

@ -0,0 +1,50 @@
# Array Flatten
[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
> Flatten nested arrays.
## Installation
```
npm install array-flatten --save
```
## Usage
```javascript
var flatten = require('array-flatten')
flatten([1, [2, [3, [4, [5], 6], 7], 8], 9])
//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
flatten.depth([1, [2, [3, [4, [5], 6], 7], 8], 9], 2)
//=> [1, 2, 3, [4, [5], 6], 7, 8, 9]
(function () {
flatten.from(arguments) //=> [1, 2, 3]
})(1, [2, 3])
```
### Methods
* **flatten(array)** Flatten a nested array structure
* **flatten.from(arrayish)** Flatten an array-like structure (E.g. arguments)
* **flatten.depth(array, depth)** Flatten a nested array structure with a specific depth
* **flatten.fromDepth(arrayish, depth)** Flatten an array-like structure with a specific depth
## License
MIT
[npm-image]: https://img.shields.io/npm/v/array-flatten.svg?style=flat
[npm-url]: https://npmjs.org/package/array-flatten
[downloads-image]: https://img.shields.io/npm/dm/array-flatten.svg?style=flat
[downloads-url]: https://npmjs.org/package/array-flatten
[travis-image]: https://img.shields.io/travis/blakeembrey/array-flatten.svg?style=flat
[travis-url]: https://travis-ci.org/blakeembrey/array-flatten
[coveralls-image]: https://img.shields.io/coveralls/blakeembrey/array-flatten.svg?style=flat
[coveralls-url]: https://coveralls.io/r/blakeembrey/array-flatten?branch=master

16
web/node_modules/array-flatten/array-flatten.d.ts generated vendored Normal file
View file

@ -0,0 +1,16 @@
declare function flatten <T> (array: flatten.NestedArray<T>): T[];
declare namespace flatten {
export interface NestedArray <T> extends ReadonlyArray<T | NestedArray<T>> {}
export interface NestedList <T> {
[index: number]: T | NestedList<T>;
length: number;
}
export function from <T> (array: NestedList<T>): T[];
export function depth <T> (array: NestedArray<T>, depth: number): NestedArray<T>;
export function depthFrom <T> (array: NestedList<T>, depth: number): NestedArray<T>;
}
export = flatten;

108
web/node_modules/array-flatten/array-flatten.js generated vendored Normal file
View file

@ -0,0 +1,108 @@
'use strict'
/**
* Expose `arrayFlatten`.
*/
module.exports = flatten
module.exports.from = flattenFrom
module.exports.depth = flattenDepth
module.exports.fromDepth = flattenFromDepth
/**
* Flatten an array.
*
* @param {Array} array
* @return {Array}
*/
function flatten (array) {
if (!Array.isArray(array)) {
throw new TypeError('Expected value to be an array')
}
return flattenFrom(array)
}
/**
* Flatten an array-like structure.
*
* @param {Array} array
* @return {Array}
*/
function flattenFrom (array) {
return flattenDown(array, [])
}
/**
* Flatten an array-like structure with depth.
*
* @param {Array} array
* @param {number} depth
* @return {Array}
*/
function flattenDepth (array, depth) {
if (!Array.isArray(array)) {
throw new TypeError('Expected value to be an array')
}
return flattenFromDepth(array, depth)
}
/**
* Flatten an array-like structure with depth.
*
* @param {Array} array
* @param {number} depth
* @return {Array}
*/
function flattenFromDepth (array, depth) {
if (typeof depth !== 'number') {
throw new TypeError('Expected the depth to be a number')
}
return flattenDownDepth(array, [], depth)
}
/**
* Flatten an array indefinitely.
*
* @param {Array} array
* @param {Array} result
* @return {Array}
*/
function flattenDown (array, result) {
for (var i = 0; i < array.length; i++) {
var value = array[i]
if (Array.isArray(value)) {
flattenDown(value, result)
} else {
result.push(value)
}
}
return result
}
/**
* Flatten an array with depth.
*
* @param {Array} array
* @param {Array} result
* @param {number} depth
* @return {Array}
*/
function flattenDownDepth (array, result, depth) {
depth--
for (var i = 0; i < array.length; i++) {
var value = array[i]
if (depth > -1 && Array.isArray(value)) {
flattenDownDepth(value, result, depth)
} else {
result.push(value)
}
}
return result
}

47
web/node_modules/array-flatten/package.json generated vendored Normal file
View file

@ -0,0 +1,47 @@
{
"name": "array-flatten",
"version": "2.1.2",
"description": "Flatten nested arrays",
"main": "array-flatten.js",
"typings": "array-flatten.d.ts",
"files": [
"array-flatten.js",
"array-flatten.d.ts",
"LICENSE"
],
"scripts": {
"lint": "standard",
"test-spec": "mocha -R spec --bail",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec --bail",
"test": "npm run lint && npm run test-cov",
"benchmark": "node benchmark"
},
"repository": {
"type": "git",
"url": "git://github.com/blakeembrey/array-flatten.git"
},
"keywords": [
"array",
"flatten",
"arguments",
"depth",
"fast",
"for"
],
"author": {
"name": "Blake Embrey",
"email": "hello@blakeembrey.com",
"url": "http://blakeembrey.me"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/blakeembrey/array-flatten/issues"
},
"homepage": "https://github.com/blakeembrey/array-flatten",
"devDependencies": {
"benchmarked": "^2.0.0",
"istanbul": "^0.4.0",
"mocha": "^3.1.2",
"standard": "^10.0.0"
}
}