fspvr - Cross-Platform filesystem path validator and reformer
fspvr is a cross-platform filesystem validator and reformer which gets rid of illegal trailing or in-between characters and preserved words.
Table of contents
Reformat
var fspvr = ;var reformatedPath = fspvr;console; // C:\Windows\System32\ntdll.dll
The second parameter is optional and defaults to true.
Its responisible for strict
reformation, meaning it will remove illegal trailing characters or preserved words.
Optinally, you can reformat only a segment in a path
var fspvr = ;var reformatedSegment = fspvr;console; // Windows
The second parameter is for strict
reformation as described above.
Validate
var fspvr = ;var isValidPath = fspvr;console; // false
The second parameter is optional and defaults to true.
Its responisible for strict
validation, meaning it will validates againts illegal characters as-well as to illegal trailing characters or preserved words.
Optinally, you can validate only a segment in a path
var fspvr = ;var isValidSegment = fspvr;console; // true
The second parameter is for strict
validation as described above.
Tests
Run tests with
$ npm run test
License
fspvr is licensed under the GPL V3 License.