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

7
web/node_modules/compose-function/LICENSE.md generated vendored Normal file
View file

@ -0,0 +1,7 @@
Copyright © 2015 Christoph Hermann
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.

83
web/node_modules/compose-function/README.md generated vendored Normal file
View file

@ -0,0 +1,83 @@
[![Travis](https://img.shields.io/travis/stoeffel/compose-function.svg?style=flat-square)](https://travis-ci.org/stoeffel/compose-function)
[![npm](https://img.shields.io/npm/v/compose-function.svg?style=flat-square)](https://www.npmjs.com/package/compose-function)
[![Dependency Status](https://david-dm.org/stoeffel/compose-function.svg?style=flat-square)](https://david-dm.org/stoeffel/compose-function)
[![Coveralls](https://img.shields.io/coveralls/stoeffel/compose-function.svg?style=flat-square)](https://coveralls.io/github/stoeffel/compose-function)
<h1 align="center">Compose-Function</h1>
<p align="center">
<a href="#installation">Installation</a> |
<a href="#usage">Usage</a> |
<a href="#related">Related</a> |
<a href="#license">License</a>
<br><br>
<img align="center" height="300" src="http://33.media.tumblr.com/006dfad04f93ec5b3680ec7cdae3fafa/tumblr_n8kgl18uU41qcung4o1_1280.gif">
<br>
<sub>logo by <a href="http://justinmezzell.tumblr.com/">Justin Mezzell</a></sub>
<blockquote align="center">Compose a new function from smaller functions `f(g(x))`</blockquote>
</p>
Installation
------------
`npm install compose-function`
Usage
-----
## Basic usage
```js
import compose from 'compose-function';
const composition = compose(sqr, add2); // sqr(add2(x))
composition(2) // => 16
compose(sqr, inc)(2); // => 9
compose(inc, sqr)(2); // => 5
```
## with curry
```js
import compose from 'compose-function';
import { curry, _ } from 'curry-this';
const add = (x, y) => x + y;
// add(6, sqr(add(2, x)))
compose(
add::curry(6),
sqr,
add::curry(2),
);
// map(filter(list, even), sqr)
compose(
map::curry(_, sqr),
filter::curry(_, even),
)([1,2,3,4,5,6,7,8]) // => [4, 16, 36, 64]
```
### `::` huh?
If youre wondering what the `::` thing means, youd better read this excellent [overview](https://github.com/jussi-kalliokoski/trine/blob/5b735cbfb6b28ae94bac0446d9ecd5ce51fb149b/README.md#why) by [@jussi-kalliokoski](https://github.com/jussi-kalliokoski) or have a look at the [function bind syntax proposal](https://github.com/zenparsing/es-function-bind).
Or checkout the [curry-this docs][ct].
Related
----
* [curry-this][ct]
License
----
MIT © [Christoph Hermann](http://stoeffel.github.io)
[r]: http://ramdajs.com
[ct]: https://github.com/stoeffel/curry-this

44
web/node_modules/compose-function/index.js generated vendored Normal file
View file

@ -0,0 +1,44 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports['default'] = compose;
// istanbul ignore next
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
var _arityN = require('arity-n');
var _arityN2 = _interopRequireDefault(_arityN);
var compose2 = function compose2(f, g) {
return function () {
return f(g.apply(undefined, arguments));
};
};
function compose() {
for (var _len = arguments.length, functions = Array(_len), _key = 0; _key < _len; _key++) {
functions[_key] = arguments[_key];
}
var funcs = functions.filter(function (fn) {
return typeof fn === 'function';
});
var lastIdx = funcs.length - 1;
var arity = 0;
if (funcs.length <= 0) {
throw new Error('No funcs passed');
}
if (lastIdx >= 0 && funcs[lastIdx]) {
arity = funcs[lastIdx].length;
}
return (0, _arityN2['default'])(funcs.reduce(compose2), arity);
}
module.exports = exports['default'];

23
web/node_modules/compose-function/module/index.js generated vendored Normal file
View file

@ -0,0 +1,23 @@
import arityN from 'arity-n';
let compose2 = (f, g) => (...args) => f(g(...args));
export default function compose(...functions) {
const funcs = functions.filter(fn => typeof fn === 'function');
let lastIdx = funcs.length - 1;
let arity = 0;
if (funcs.length <= 0) {
throw new Error('No funcs passed');
}
if (lastIdx >= 0 && funcs[lastIdx]) {
arity = funcs[lastIdx].length;
}
return arityN(funcs.reduce(compose2), arity);
}

58
web/node_modules/compose-function/package.json generated vendored Normal file
View file

@ -0,0 +1,58 @@
{
"name": "compose-function",
"version": "3.0.3",
"description": "Compose new functions f(g(x))",
"main": "index.js",
"scripts": {
"clean": "git reset && echo '/node_modules/' > .gitignore && git add .gitignore && git stash save --include-untracked --keep-index '`npm run clean` trash can' && git clean --force -d && git reset --hard && echo '\nclean: Uncommitted and ignored files have been moved to gitâ™s stash. To restore them run `git stash pop --quiet; git checkout .gitignore`.'",
"coverage": "rm -rf coverage && npm run test:transpile && cd .es5 && istanbul cover test.js && mv coverage ..",
"coveralls": "npm run coverage && cat ./coverage/lcov.info | coveralls",
"develop": "nodangel --ignore node_modules --ignore coverage --exec 'npm run --silent test:lite'",
"prepublish": "npm run --silent clean && npm run transpile",
"patch-release": "npm version patch && npm publish && git push --follow-tags",
"minor-release": "npm version minor && npm publish && git push --follow-tags",
"major-release": "npm version major && npm publish && git push --follow-tags",
"test": "eslint --ignore-path .gitignore .; npm run test:transpile && node .es5/test.js | tap-spec",
"test:lite": "babel-node --optional es7.functionBind test.js | tap-spec",
"test:transpile": "rm -rf .es5 && babel --optional es7.functionBind test.js test/*.js --out-dir .es5 && babel module/*.js --out-dir .es5",
"transpile": "babel module --out-dir .",
"view-coverage": "echo 'Generating coverage reports…'; npm run coverage >/dev/null && echo '…done.' && opn ./coverage/lcov-report/index.html >/dev/null"
},
"repository": {
"type": "git",
"url": "http://github.com/stoeffel/compose-function"
},
"files": [
"/*.js",
"/module/",
"/README.md",
"/LICENSE.md"
],
"keywords": [
"function",
"compose",
"functional"
],
"author": "stoeffel",
"license": "MIT",
"bugs": {
"url": "http://github.com/stoeffel/compose-function/issues"
},
"homepage": "http://github.com/stoeffel/compose-function",
"devDependencies": {
"babel": "^5.8.21",
"babel-eslint": "^4.0.10",
"coveralls": "^2.11.4",
"curry-this": "^3.0.2",
"es6-symbol": "^2.0.1",
"eslint": "^1.2.0",
"istanbul": "^0.3.18",
"nodangel": "1.3.8",
"opn-cli": "1.0.0",
"tap-spec": "^4.0.2",
"tape-catch": "1.0.4"
},
"dependencies": {
"arity-n": "^1.0.4"
}
}

1
web/node_modules/compose-function/test.js generated vendored Normal file
View file

@ -0,0 +1 @@
import './test/test.js';