augment-object
Augment selectively an object.
Object
const src = a1 : 1 a2 : 2 b : 3 c : 4;const dst = a1 : 7 a2 : 8;console; // { a1 : 7, a2 : 8, b : 3, c : 4 }
Classes
Augment selectively the prototype of a class.
Sometimes you have a class definition from other library and you need some methods of this class but there is no mixins neither multiple inheritance in JS:
// do action // log messages // scan files and show logs // log messages // scan files
In this case, we need scan
(and its dependences) from ExternalClass but log
(and other methods) from our base class.
Any of other libs for merging/assigning properties in npm will overwrite log
from base class. So augmentObject
and augmentClass
was created for
merging properties selectively.
// Other methods;
If you need call overwritten method, super.log()
in example, then you
need a mixin and augmentClass
will not be useful.