lib/create_new.js
function createNew(options)
{
  var copy     = cloneFunction(configly)
    , instance = copy.bind(copy)
    ;

  // enrich copy with helper methods
  // mind baked-in context of the copies
  applyProps.call(this, copy, options);

  // get fresh list of filenames
  // if needed
  copy.files = copy.files || getFilenames.call(copy);

  // expose public methods on the outside
  // mind baked in context of the copies
  copyProps.call(copy, instance);

  return instance;
}
function createNew(options)
{
  var copy     = cloneFunction(configly)
    , instance = copy.bind(copy)
    ;

  // enrich copy with helper methods
  // mind baked-in context of the copies
  applyProps.call(this, copy, options);

  // get fresh list of filenames
  // if needed
  copy.files = copy.files || getFilenames.call(copy);

  // expose public methods on the outside
  // mind baked in context of the copies
  copyProps.call(copy, instance);

  return instance;
}
function createNew ( options ) { var copy = cloneFunction ( configly ) , instance = copy . bind ( copy ) ; // enrich copy with helper methods // mind baked-in context of the copies applyProps . call ( this , copy , options ) ; // get fresh list of filenames // if needed copy . files = copy . files || getFilenames . call ( copy ) ; // expose public methods on the outside // mind baked in context of the copies copyProps . call ( copy , instance ) ; return instance ; }
Creates new copy of configly
immutable to singleton modifications
which will help to keep it stable
when used with in the libraries

@param   {object} [options] - custom options to set as new defaults on the new instance
@returns {function} - immutable copy of configly
Creates new copy of configly immutable to singleton modifications which will help to keep it stable when used with in the libraries