Skip to content

Instantly share code, notes, and snippets.

@timoxley
Last active March 11, 2016 10:53
Show Gist options
  • Select an option

  • Save timoxley/ca33f7ae6562e3077563 to your computer and use it in GitHub Desktop.

Select an option

Save timoxley/ca33f7ae6562e3077563 to your computer and use it in GitHub Desktop.
function (toMatch, items) {
const options = arguments[arguments.length - 1] // options always last arg
if (!Array.isArray(items)) items = [] // items is optional
if (!toMatch) throw new Error('No value given to match')
if (!options || Array.isArray(options)) throw new Error('No internal options object')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment