AlexeyGrishin / schemasaurus

JSON schema iterator & validator
ISC License
11 stars 2 forks source link

maxLength/minLength Unicode fix #5

Open brettz9 opened 9 years ago

brettz9 commented 9 years ago

Hi,

I believe all you need for maxLength and minLength support is to install and require grapheme-breaker and use the countBreaks method to get the Unicode grapheme-cluster-friendly length of the supplied string.

(I'd do a PR, but I'm not sure how to get the build feature in package.json to work; running npm build or npm build . did not do anything for me (on Windows).)

brettz9 commented 9 years ago

I tried the npm build by the way after doing npm install . on the schemasaurus directory (incidentally, maybe you want to add a .gitignore for node_modules?)

AlexeyGrishin commented 9 years ago

Hi, Thank you for your help. For my current project I did not need to process unicode strings that's why I skipped support of them in validator.

You need to call npm run build. Not sure why but only test script has a shortcut npm test, other scripts shall be called with npm run <script>.

Yeah, node_modules directory shall be in .gitignore, just forgot to put it there.