lib/behalter.js
function Behalter(parent, options) {

  // normalize arguments for the case of `new Behalter(options)`
  if (arguments.length === 1 && !(parent instanceof Behalter) && _.isPlainObject(parent)) {
    options = parent;
    parent = void 0;
  }

  // for hierarchical search, validate type of parent
  if (parent && !(parent instanceof Behalter)) {
    throw new TypeError('parent must be an instance of Behalter');
  }

  // construct this with super constructor
  EventEmitter2.call(this, options);

  // configure default properties
  this.__parent = parent;
  this.__values = {};
  this.__factories = {};

  // configure options: to INHERIT options, configure only for root
  if (!parent) {
    this.__options = {
      useGetter: true,
      useSetter: false
    };
  } else {
    this.__options = {};
  }
}
function Behalter(parent, options) {

  // normalize arguments for the case of `new Behalter(options)`
  if (arguments.length === 1 && !(parent instanceof Behalter) && _.isPlainObject(parent)) {
    options = parent;
    parent = void 0;
  }

  // for hierarchical search, validate type of parent
  if (parent && !(parent instanceof Behalter)) {
    throw new TypeError('parent must be an instance of Behalter');
  }

  // construct this with super constructor
  EventEmitter2.call(this, options);

  // configure default properties
  this.__parent = parent;
  this.__values = {};
  this.__factories = {};

  // configure options: to INHERIT options, configure only for root
  if (!parent) {
    this.__options = {
      useGetter: true,
      useSetter: false
    };
  } else {
    this.__options = {};
  }
}
function Behalter ( parent , options ) { // normalize arguments for the case of `new Behalter(options)` if ( arguments . length === 1 && ! ( parent instanceof Behalter ) && _ . isPlainObject ( parent ) ) { options = parent ; parent = void 0 ; } // for hierarchical search, validate type of parent if ( parent && ! ( parent instanceof Behalter ) ) { throw new TypeError ( 'parent must be an instance of Behalter' ) ; } // construct this with super constructor EventEmitter2 . call ( this , options ) ; // configure default properties this . __parent = parent ; this . __values = { } ; this . __factories = { } ; // configure options: to INHERIT options, configure only for root if ( ! parent ) { this . __options = { useGetter : true , useSetter : false } ; } else { this . __options = { } ; } }
Create a new behalter.

@param {(Behalter|Object)} [parent]
@param {Object} [options={}]
@constructor
Create a new behalter .