silfverorg / duns.js

Javascript schema validator
5 stars 2 forks source link

Duns.string().oneOf not handling arrays correctly #48

Closed br0r closed 9 years ago

br0r commented 9 years ago

oneOf doesn't work as intended.

Should be able to handle Duns.string().oneOf(['1', '2', '3']).

It has logic for it, but the code uses concat wrong. It simply does val.concat(newVal). It should do val = val.concat(newVal).