Flat-copy an object except all methods are bound to a given context. Do not modify the origin object.
This module exports one function that holds some methods:
Alias for bindAllMethods.onto({}, context, origin)
.
Alias for bindAllMethods.onto(dest, dest, origin)
.
May be used to install additional APIs onto an existing object without affecting unrelated methods.
If origin
is false-y, context
is used instead.
Copy all properties of origin
onto dest
, except methods.
For methods, instead, assign a version that is bound to context
.
Return dest
.
see test/usage.mjs.
- Needs more/better tests and docs.
ISC