Skip to content

Commit

Permalink
allow function values
Browse files Browse the repository at this point in the history
  • Loading branch information
jonschlinkert committed Jun 9, 2016
1 parent 5f9b411 commit 572c314
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions index.js
Expand Up @@ -48,16 +48,15 @@
*/

module.exports = function copyDescriptor(receiver, provider, from, to) {
if (!isObject(provider)) {
if (!isObject(provider) && typeof provider !== 'function') {
to = from;
from = provider;
provider = receiver;
}

if (!isObject(receiver)) {
if (!isObject(receiver) && typeof receiver !== 'function') {
throw new TypeError('expected the first argument to be an object');
}
if (!isObject(provider)) {
if (!isObject(provider) && typeof provider !== 'function') {
throw new TypeError('expected provider to be an object');
}

Expand Down

0 comments on commit 572c314

Please sign in to comment.