calc vehicle restriction rule
$ npm install vehicle-restriction
- noremalize plate string
- test if the vehicle' plate is restricted
- show which plate number is restricted
- support more city
const vr = require('vehicle-restriction');
console.log(vr.hz.isRestricted('浙A·F8965', 5));
// ==> true
Currently, it's only support hangzhou
All methods is associated with city by a namespace, and the namespace is the city's name in Pinyin, or shorted letters.
eg: if the module was required as vr
, Hangzhou will be vr.hz
or vr.hangzhou
.
Params:
plate
: String of the vehicle's plate, supported format:浙A·F8965
,浙A-F8965
,浙A F8965
or浙AF8965
.day
<Number | String>: Day number in a week, 0 for Sunday, 1 for Monday, etc.
Return:
: true
: is restricted; false
: is not restricted.
MIT © Leigh Zhu