function-double
Stands for the real function passing though all the descriptions and properties of the source function.
It is literally impossible to distinguish the real function, and it's double.
; const secretFunction = a+b;secretFunctionpropTypes = "this is not React";const wrapperFunction = + 4; secretFunctionlength === 2wrapperFunctionlength === 0wrapperFunctionpropTypes === undefined const result = ; wrapperFunctionpropTypes === "this is not React";wrapperFunctionlength === 2; result === wrapperFunction;/ / But not in IE11 :)
API
functionDouble(targetFunction, sourceFunction, [options])
- moves all the stuff from sourceFunction to target.
- options.toString = (sourceFunction) => string. Override method for
toString
. - options.name = (sourceFunction) => string. Override method for
name
.
License
MIT