Cool! Sucks that it has to be so stringly typed, but I can't see another alternative.<p>One concern:<p>"Each pattern will be tried in order until a match is found."<p>As far as I know, ECMAScript doesn't specify any enumerations on objects that obey an order... browsers do syntactic order, but it's by no means a guarantee. (e.g. <a href="http://stackoverflow.com/a/280861" rel="nofollow">http://stackoverflow.com/a/280861</a>)