structure, layout and automation

This commit is contained in:
Tancre
2020-09-16 14:23:28 +02:00
commit 0efda7fffe
15549 changed files with 1280031 additions and 0 deletions

21
node_modules/each-props/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2016 Takayuki Sato
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.

125
node_modules/each-props/README.md generated vendored Normal file
View File

@ -0,0 +1,125 @@
# [each-props][repo-url] [![NPM][npm-img]][npm-url] [![MIT License][mit-img]][mit-url] [![Build Status][travis-img]][travis-url] [![Build Status][appveyor-img]][appveyor-url] [![Coverage Status][coverage-img]][coverage-url]
Processes each properties of an object deeply.
## Install
To install from npm:
```sh
$ npm i each-props --save
```
## Load this module
For Node.js:
```js
const eachProps = require('each-props');
```
For Web browser:
```html
<script src="each-props.min.js"></script>
```
## Usage
Apply a function to all (non plain object) properties.
```js
var obj = { a: 1, b: { c: 'CCC', d: { e: 'EEE' } } };
eachProps(obj, function(value, keyChain, nodeInfo) {
if (keyChain === 'a') {
nodeInfo.parent['a'] = value * 2;
} else if (keyChain === 'b.c') {
nodeInfo.parent['c'] = value.toLowerCase();
} else if (keyChain === 'b.d') {
return true; // stop to dig
} else if (keyChain === 'b.d.e') {
nodeInfo.parent['e'] = value.toLowerCase();
}
});
console.log(obj);
// => { a: 2, b: { c: 'ccc', d: { e: 'EEE' } } };
```
## API
### <u>eachProps(obj, fn [, opts]) : void</u>
Executes the *fn* function for all properties.
#### Parameters:
| Parameter | Type | Description |
|:------------|:------:|:-----------------------------------------------|
| *obj* | object | A plain object to be treated. |
| *fn* |function| A function to operate each properties. |
| *opts* | object | An object to pass any data to each properties. |
* **API of *fn* function**
#### <u>fn(value, keyChain, nodeInfo) : boolean</u>
This function is applied to all properties in an object.
##### Parameters:
| Parameter | Type | Description |
|:------------|:------:|:-----------------------------------------------|
| *value* | any | A property value. |
| *keyChain* | string | A string concatenating the hierarchical keys with dots. |
| *nodeInfo* | object | An object which contains node informations (See [below](#nodeinfo)). |
##### Returns:
True, if stops digging child properties.
**Type:** boolean
<a name="nodeinfo"></a>
* **Properties of <i>nodeInfo</i>**
| Properties | Type | Description |
|:-------------|:------:|:-----------------------------------------|
| *name* | string | The property name of this node. |
| *index* | number | The index of the property among the sibling properties. |
| *count* | number | The count of the sibling properties. |
| *depth* | number | The depth of the property. |
| *parent* | object | The parent node of the property. |
| *sort* |function| A sort function which orders the child properties. This function is inherited from *opts*, if be specified. |
... and any properties inherited from *opts*.
* **Properties of <i>opts</i>**
| Properties | Type | Description |
|:-------------|:------:|:-----------------------------------------|
| *sort* |function| A sort function which orders the same level properties. (Optional) |
... and any properties you want to pass to each node.
## License
Copyright (C) 2016-2018 Takayuki Sato
This program is free software under [MIT][mit-url] License.
See the file LICENSE in this distribution for more details.
[repo-url]: https://github.com/sttk/each-props/
[npm-img]: https://img.shields.io/badge/npm-v1.3.2-blue.svg
[npm-url]: https://www.npmjs.org/package/each-props/
[mit-img]: https://img.shields.io/badge/license-MIT-green.svg
[mit-url]: https://opensource.org/licenses.MIT
[travis-img]: https://travis-ci.org/sttk/each-props.svg?branch=master
[travis-url]: https://travis-ci.org/sttk/each-props
[appveyor-img]: https://ci.appveyor.com/api/projects/status/github/sttk/each-props?branch=master&svg=true
[appveyor-url]: https://ci.appveyor.com/project/sttk/each-props
[coverage-img]: https://coveralls.io/repos/github/sttk/each-props/badge.svg?branch=master
[coverage-url]: https://coveralls.io/github/sttk/each-props?branch=master

57
node_modules/each-props/index.js generated vendored Normal file
View File

@ -0,0 +1,57 @@
'use strict';
var isPlainObject = require('is-plain-object');
var defaults = require('object.defaults/immutable');
module.exports = function(obj, fn, opts) {
if (!isObject(obj)) {
return;
}
if (typeof fn !== 'function') {
return;
}
if (!isPlainObject(opts)) {
opts = {};
}
forEachChild(obj, '', fn, 0, opts);
};
function forEachChild(node, baseKey, fn, depth, opts) {
var keys = Object.keys(node);
if (typeof opts.sort === 'function') {
var sortedKeys = opts.sort(keys);
if (Array.isArray(sortedKeys)) {
keys = sortedKeys;
}
}
depth += 1;
for (var i = 0, n = keys.length; i < n; i++) {
var key = keys[i];
var keyChain = baseKey + '.' + key;
var value = node[key];
var nodeInfo = defaults(opts);
nodeInfo.name = key;
nodeInfo.index = i;
nodeInfo.count = n;
nodeInfo.depth = depth;
nodeInfo.parent = node;
var notDigg = fn(value, keyChain.slice(1), nodeInfo);
if (notDigg || !isPlainObject(value)) {
continue;
}
forEachChild(value, keyChain, fn, depth, opts);
}
}
function isObject(v) {
return Object.prototype.toString.call(v) === '[object Object]';
}

77
node_modules/each-props/package.json generated vendored Normal file
View File

@ -0,0 +1,77 @@
{
"_from": "each-props@^1.3.0",
"_id": "each-props@1.3.2",
"_inBundle": false,
"_integrity": "sha512-vV0Hem3zAGkJAyU7JSjixeU66rwdynTAa1vofCrSA5fEln+m67Az9CcnkVD776/fsN/UjIWmBDoNRS6t6G9RfA==",
"_location": "/each-props",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "each-props@^1.3.0",
"name": "each-props",
"escapedName": "each-props",
"rawSpec": "^1.3.0",
"saveSpec": null,
"fetchSpec": "^1.3.0"
},
"_requiredBy": [
"/copy-props"
],
"_resolved": "https://registry.npmjs.org/each-props/-/each-props-1.3.2.tgz",
"_shasum": "ea45a414d16dd5cfa419b1a81720d5ca06892333",
"_spec": "each-props@^1.3.0",
"_where": "/home/outis/Documents/Sites/BBB/node_modules/copy-props",
"author": {
"name": "Takayuki Sato"
},
"bugs": {
"url": "https://github.com/sttk/each-props/issues"
},
"bundleDependencies": false,
"dependencies": {
"is-plain-object": "^2.0.1",
"object.defaults": "^1.1.0"
},
"deprecated": false,
"description": "Processes each properties of an object deeply.",
"devDependencies": {
"browserify": "^16.2.2",
"chai": "^3.5.0",
"coveralls": "^3.0.1",
"eslint": "^4.19.1",
"mocha": "^3.2.0",
"nyc": "^11.7.2",
"uglify-js": "^3.3.24"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sttk/each-props#readme",
"keywords": [
"deep",
"each",
"object",
"property",
"properties",
"props"
],
"license": "MIT",
"main": "index.js",
"name": "each-props",
"repository": {
"type": "git",
"url": "git+https://github.com/sttk/each-props.git"
},
"scripts": {
"build": "npm run lint && npm run coverage && npm run web:build && node test/web/make.js",
"chrome:install": "npm i --no-save mocha-chrome",
"chrome:test": "mocha-chrome test/web/browser-test.html",
"coverage": "nyc --reporter=lcov --reporter=text-summary npm test",
"coveralls": "nyc --reporter=text-lcov npm test | coveralls",
"lint": "eslint .",
"test": "mocha",
"web:build": "browserify index.js --standalone eachProps -o web/each-props.js && cd web && uglifyjs each-props.js --compress --mangle -o each-props.min.js --source-map url=each-props.min.js.map"
},
"version": "1.3.2"
}