Last active
March 11, 2016 10:53
-
-
Save timoxley/ca33f7ae6562e3077563 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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