aboutsummaryrefslogtreecommitdiff
path: root/node_modules/mimic-fn
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2019-10-06 21:37:45 +0200
committerDimitri Staessens <dimitri@ouroboros.rocks>2019-10-06 21:37:45 +0200
commit3c51c3be85bb0d1bdb87ea0d6632f1c256912f27 (patch)
treec7ccc8279b12c4f7bdbbb4270d617e48f51722e4 /node_modules/mimic-fn
parent412c104bebc507bea9c94fd53b5bdc4b64cbfe31 (diff)
downloadwebsite-3c51c3be85bb0d1bdb87ea0d6632f1c256912f27.tar.gz
website-3c51c3be85bb0d1bdb87ea0d6632f1c256912f27.zip
build: Add some required modules for node
Diffstat (limited to 'node_modules/mimic-fn')
-rw-r--r--node_modules/mimic-fn/index.js9
-rw-r--r--node_modules/mimic-fn/license9
-rw-r--r--node_modules/mimic-fn/package.json76
-rw-r--r--node_modules/mimic-fn/readme.md68
4 files changed, 162 insertions, 0 deletions
diff --git a/node_modules/mimic-fn/index.js b/node_modules/mimic-fn/index.js
new file mode 100644
index 0000000..08e69d3
--- /dev/null
+++ b/node_modules/mimic-fn/index.js
@@ -0,0 +1,9 @@
+'use strict';
+module.exports = (to, from) => {
+ // TODO: use `Reflect.ownKeys()` when targeting Node.js 6
+ for (const prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from))) {
+ Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
+ }
+
+ return to;
+};
diff --git a/node_modules/mimic-fn/license b/node_modules/mimic-fn/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/mimic-fn/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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.
diff --git a/node_modules/mimic-fn/package.json b/node_modules/mimic-fn/package.json
new file mode 100644
index 0000000..f0ac087
--- /dev/null
+++ b/node_modules/mimic-fn/package.json
@@ -0,0 +1,76 @@
+{
+ "_args": [
+ [
+ "mimic-fn@1.2.0",
+ "/home/dstaesse/git/website"
+ ]
+ ],
+ "_development": true,
+ "_from": "mimic-fn@1.2.0",
+ "_id": "mimic-fn@1.2.0",
+ "_inBundle": false,
+ "_integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
+ "_location": "/mimic-fn",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "version",
+ "registry": true,
+ "raw": "mimic-fn@1.2.0",
+ "name": "mimic-fn",
+ "escapedName": "mimic-fn",
+ "rawSpec": "1.2.0",
+ "saveSpec": null,
+ "fetchSpec": "1.2.0"
+ },
+ "_requiredBy": [
+ "/mem"
+ ],
+ "_resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
+ "_spec": "1.2.0",
+ "_where": "/home/dstaesse/git/website",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "bugs": {
+ "url": "https://github.com/sindresorhus/mimic-fn/issues"
+ },
+ "description": "Make a function mimic another one",
+ "devDependencies": {
+ "ava": "*",
+ "xo": "*"
+ },
+ "engines": {
+ "node": ">=4"
+ },
+ "files": [
+ "index.js"
+ ],
+ "homepage": "https://github.com/sindresorhus/mimic-fn#readme",
+ "keywords": [
+ "function",
+ "mimic",
+ "imitate",
+ "rename",
+ "copy",
+ "inherit",
+ "properties",
+ "name",
+ "func",
+ "fn",
+ "set",
+ "infer",
+ "change"
+ ],
+ "license": "MIT",
+ "name": "mimic-fn",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sindresorhus/mimic-fn.git"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "version": "1.2.0"
+}
diff --git a/node_modules/mimic-fn/readme.md b/node_modules/mimic-fn/readme.md
new file mode 100644
index 0000000..e575734
--- /dev/null
+++ b/node_modules/mimic-fn/readme.md
@@ -0,0 +1,68 @@
+# mimic-fn [![Build Status](https://travis-ci.org/sindresorhus/mimic-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-fn)
+
+> Make a function mimic another one
+
+Useful when you wrap a function in another function and like to preserve the original name and other properties.
+
+
+## Install
+
+```
+$ npm install mimic-fn
+```
+
+
+## Usage
+
+```js
+const mimicFn = require('mimic-fn');
+
+function foo() {}
+foo.unicorn = '🦄';
+
+function wrapper() {
+ return foo() {};
+}
+
+console.log(wrapper.name);
+//=> 'wrapper'
+
+mimicFn(wrapper, foo);
+
+console.log(wrapper.name);
+//=> 'foo'
+
+console.log(wrapper.unicorn);
+//=> '🦄'
+```
+
+
+## API
+
+It will copy over the properties `name`, `length`, `displayName`, and any custom properties you may have set.
+
+### mimicFn(to, from)
+
+It will modify `to` and return it.
+
+#### to
+
+Type: `Function`
+
+Mimicking function.
+
+#### from
+
+Type: `Function`
+
+Function to mimic.
+
+
+## Related
+
+- [rename-fn](https://github.com/sindresorhus/rename-fn) - Rename a function
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)