We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function.prototype
Behavior is different depending on whether the function to mimic is an arrow function or not:
const from = function() {} const to = function() {} console.log(from.prototype === to.prototype) // false mimicFn(from, to) console.log(from.prototype === to.prototype) // true
const from = function() {} const to = () => {} console.log(from.prototype === to.prototype) // false mimicFn(from, to) console.log(from.prototype === to.prototype) // false
This is because Function.prototype is not defined for arrow functions. mimic-fn only iterates over properties that are defined.
mimic-fn
This leaves two questions:
from.prototype
to.prototype
to
from
The text was updated successfully, but these errors were encountered:
when from.prototype is not defined, should to.prototype be deleted?
Yes
when any property is defined in to but not from, should it be deleted from to?
Yes, but it should be clearly documented.
Sorry, something went wrong.
I will submit a PR for this after #18 is merged (to avoid conflicts).
PR at #28
Successfully merging a pull request may close this issue.
Behavior is different depending on whether the function to mimic is an arrow function or not:
This is because
Function.prototype
is not defined for arrow functions.mimic-fn
only iterates over properties that are defined.This leaves two questions:
from.prototype
is not defined, shouldto.prototype
be deleted?to
but notfrom
, should it be deleted fromto
?The text was updated successfully, but these errors were encountered: