piggy-sanitize-uri
Purpose
Basic lib to sanitize uri with options.
Usage
let uri = '/my/path/?arg=value';let sanitizedUri = ;
With options:
let uri = '/my/path/?arg=value';let options = simpleChars: true lowercase: true endingslash: true doubleshash: true;let sanitizedUri = ;
Options
All options are simple boolean values to enable/disable the feature
- simpleChars: keep only alnum, "-" and "/" chars in the path
- lowercase: lowercase all the chars
- endingslash: force an ending slash
- doubleshash: remove double slash
Developer
Installing dev dependencies, you can edit the package source. Then run:
npm run dev-compile
for babel transpilationnpm run dev-check
for jshint check