Example #1
0
  return function(object, source, options) {
    var isObj = isObject(source),
        noOpts = options == null,
        props = noOpts && isObj && keys(source),
        methodNames = props && functions(source);

    if ((props && props.length && !methodNames.length) || (noOpts && !isObj)) {
      if (noOpts) {
        options = source;
      }
      source = object;
      object = this;
    }
    return func(object, source, options);
  };
Example #2
0
 test('it returns an object with all required methods', () => {
   foo.should.be.an('object')
   functions(broker)
     .filter(fn => !/HotPress[a-zA-Z]*Error/.test(fn))
     .forEach(name => foo.should.respondTo(name))
 })