ducktype.js
function createFunction (test, options) {
    return new DuckType({
      name: options && options.name || null,
      test: test
    });
  }
function createFunction (test, options) {
    return new DuckType({
      name: options && options.name || null,
      test: test
    });
  }
function createFunction ( test , options ) { return new DuckType ( { name : options && options . name || null , test : test } ) ; }
Create a ducktype from a test function
@param {Function} test   A test function, returning true when a provided
object matches, or else returns false.
@param {{name: String}} [options]
@returns {*}
Create a ducktype from a test function