mimic-fn
Advanced tools
Comparing version 1.2.0 to 2.0.0
'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))) { | ||
const mimicFn = (to, from) => { | ||
for (const prop of Reflect.ownKeys(from)) { | ||
Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop)); | ||
@@ -10,1 +10,4 @@ } | ||
}; | ||
module.exports = mimicFn; | ||
module.exports.default = mimicFn; |
{ | ||
"name": "mimic-fn", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "Make a function mimic another one", | ||
@@ -13,9 +13,10 @@ "license": "MIT", | ||
"engines": { | ||
"node": ">=4" | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
"test": "xo && ava && tsd-check" | ||
}, | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
@@ -38,5 +39,6 @@ "keywords": [ | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
"ava": "^1.3.1", | ||
"tsd-check": "^0.3.0", | ||
"xo": "^0.24.0" | ||
} | ||
} |
@@ -46,3 +46,3 @@ # mimic-fn [![Build Status](https://travis-ci.org/sindresorhus/mimic-fn.svg?branch=master)](https://travis-ci.org/sindresorhus/mimic-fn) | ||
It will modify `to` and return it. | ||
Modifies the `to` function and returns it. | ||
@@ -49,0 +49,0 @@ #### to |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3582
5
24
0
3