Initialize a new prototype instance by copying properties from an initialization object using the prototype as a guide
npm install @eewalk11/initializeInitialize a new prototype instance by copying properties from an initialization object using the prototype as a guide.
This simple module can be used to the same effect in 3 different ways:
1. __``Initialize()` (constructor) as a function__ `
Initialize(instance, init)`
2. __`initialize()` as a static function__ `
Initialize.initialize(instance, init)`
3. __`initialize()` as a method__ `
new Initialize().initialize(instance, init)`
`instance` is the prototype instance to initialize. `
Property values will be copied from init`.
Initialization will fail if the arguments are invalid:
* `instance` must be a non-null object. `
__Note:__ undefined` is valid in the constructor.`
* init` can be a falsy value to indicate that the instance should not be modified. If this argument is not falsy,
it must be a non-null object.
By default, when initialization fails, `initialize()` will alter nothing and return `false`. The`
global Initialize.strict` flag can be set to `true` for an `InitializationError` to be thrown if any`
static initialization attempt fails. A strict` property on an instance of `Initialize` can be set to `true``
for an InitializationError` to be thrown if an initialization attempt fails from calling the `intitialize()``
method on that instance.