first commit

This commit is contained in:
s2
2024-12-13 08:53:01 +01:00
commit 2746dc9c4e
5477 changed files with 682458 additions and 0 deletions

1
node_modules/ensure-array/.npmignore generated vendored Normal file
View File

@@ -0,0 +1 @@
node_modules

7
node_modules/ensure-array/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,7 @@
language: node_js
node_js:
- 4
- 6
- 8
script:
- npm test

21
node_modules/ensure-array/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2011 Jeff Barczewski
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.

93
node_modules/ensure-array/README.md generated vendored Normal file
View File

@@ -0,0 +1,93 @@
# ensure-array
Simple convenience function which ensures that you are dealing with an array and you can
eliminate noise from your code.
[![Build Status](https://secure.travis-ci.org/jeffbski/ensure-array.png?branch=master)](http://travis-ci.org/jeffbski/ensure-array)
For Example:
```javascript
var array = require('ensure-array');
function foo(bar) {
array(bar).forEach(function (x) {
//do something with each item
});
}
```
Instead of doing something like this:
```javascript
function foo(bar) {
if (bar === undefined) return;
if (bar === null) return;
if (!Array.isArray(bar)) bar = [bar];
bar.forEach(function (x) {
//do something with each item
});
}
```
## Description
It gets rid of the noise and coerces what is provided into an array, so you do not have to
litter your code with a bunch of extraneous checks.
Here is the logic behind the function:
1. if nothing passed to the function return empty array []
2. if single argument passed is undefined or null return empty array []
3. if single argument passed is already an array, return it unchanged
4. otherwise return array containing all of the arguments
Here is the actual code which makes it happen
```javascript
module.exports = function array(a, b, n) {
if (arguments.length === 0) return []; //no args, ret []
if (arguments.length === 1) { //single argument
if (a === undefined || a === null) return []; // undefined or null, ret []
if (Array.isArray(a)) return a; // isArray, return it
}
return Array.prototype.slice.call(arguments); //return array with copy of all arguments
};
```
## Installation
```bash
npm install ensure-array
```
## Usage
```javascript
var array = require('ensure-array'); // get handle to the function
var foo = array(whatever); // foo will now safely be an array
```
## Status
- 2017-11-02 - 1.0.0 - Modernized by @Zertz
- 2011-12-08 - 0.0.4 - Update tapr / tap versions
- 2011-12-01 - 0.0.3 - Updated to support any version of Node.js
## License
- [MIT license](http://github.com/jeffbski/ensure-array/raw/master/LICENSE)
## Contributors
- Author: Jeff Barczewski (@jeffbski)
- Modernized on 2017-11-02 by Pier-Luc Gendreau (@Zertz)
## Contributing
- Source code repository: http://github.com/jeffbski/ensure-array
- Ideas and pull requests are encouraged - http://github.com/jeffbski/ensure-array/issues
- You may contact me at @jeffbski or through github at http://github.com/jeffbski

8
node_modules/ensure-array/ensure-array.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
module.exports = function ensureArray(a, b, n) {
if (arguments.length === 0) return []; // no args, ret []
if (arguments.length === 1) { // single argument
if (a === undefined || a === null) return []; // undefined or null, ret []
if (Array.isArray(a)) return a; // isArray, return it
}
return Array.prototype.slice.call(arguments); // return array with copy of all arguments
}

55
node_modules/ensure-array/package.json generated vendored Normal file
View File

@@ -0,0 +1,55 @@
{
"_args": [
[
"ensure-array@1.0.0",
"D:\\Projects\\siag\\vanillajs-seed"
]
],
"_development": true,
"_from": "ensure-array@1.0.0",
"_id": "ensure-array@1.0.0",
"_inBundle": false,
"_integrity": "sha512-A+3Ntl5WS+GjDnHtC67dKIjw+IoGoeFdNvjn3ZfKEmZgWUz0nxBPE4W52QMCbGZsat0VwWskD5T6AEpe3T2d1g==",
"_location": "/ensure-array",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "ensure-array@1.0.0",
"name": "ensure-array",
"escapedName": "ensure-array",
"rawSpec": "1.0.0",
"saveSpec": null,
"fetchSpec": "1.0.0"
},
"_requiredBy": [
"/i18next-scanner"
],
"_resolved": "https://registry.npmjs.org/ensure-array/-/ensure-array-1.0.0.tgz",
"_spec": "1.0.0",
"_where": "D:\\Projects\\siag\\vanillajs-seed",
"author": {
"name": "Jeff Barczewski",
"email": "jeff.barczewski@gmail.com"
},
"bugs": {
"url": "http://github.com/jeffbski/ensure-array/issues"
},
"description": "Ensure that an object is an array. Moves error checking out of your code.",
"devDependencies": {
"chai": "~4.1.0",
"mocha": "~4.0.0"
},
"homepage": "https://github.com/jeffbski/ensure-array#readme",
"license": "MIT",
"main": "ensure-array.js",
"name": "ensure-array",
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/jeffbski/ensure-array.git"
},
"scripts": {
"test": "./node_modules/mocha/bin/mocha ./test/*.mocha.js --reporter spec --ui qunit"
},
"version": "1.0.0"
}

55
node_modules/ensure-array/test/simple.mocha.js generated vendored Normal file
View File

@@ -0,0 +1,55 @@
'use strict';
var chai = require('chai');
var ensureArray = require('../ensure-array.js');
(function () {
var t = chai.assert;
suite('simple-tests');
test('empty arg list becomes empty array', function (done) {
var result = ensureArray();
t.deepEqual(result, [], 'should be empty array');
done();
});
test('undefined single argument becomes empty array', function (done) {
var result = ensureArray(undefined);
t.deepEqual(result, [], 'should be empty array');
done();
});
test('null single argument becomes empty array', function (done) {
var result = ensureArray(null);
t.deepEqual(result, [], 'should be empty array');
done();
});
test('array single argument returns itself unchanged', function (done) {
var result = ensureArray([1, 2, 3]);
t.deepEqual(result, [1, 2, 3]);
done();
});
test('single argument non-array becomes an array containing itself', function (done) {
var result = ensureArray(10);
t.deepEqual(result, [10]);
done();
});
test('undefined argument as first of many arguments returns array of all args', function (done) {
var result = ensureArray(undefined, 1, 'two');
t.deepEqual(result, [undefined, 1, 'two']);
done();
});
test('null argument as first of many arguments returns array of all args', function (done) {
var result = ensureArray(null, 1, 'two');
t.deepEqual(result, [null, 1, 'two']);
done();
});
}());