courier-validation
v0.0.3-beta.7
Published
A lightweight library for validating and formatting courier tracking numbers
Downloads
638
Readme
courier-validation
Installation
npm install courier-validation
Usage
import { courier } from 'courier-validation'
console.log(courier.get('SF1000000000000')) // { alias: 'SF', name: '顺丰', reg: /^SF[a-z0-9]\d{12}$/i, }
console.log(courier.validate('SF', 'SF1000000000000')) // true
API
courier.get(orderNumber: string): Courier
获取快递公司信息
courier.validate(courierCode: string, orderNumber: string): boolean
验证快递单号是否合法
获取快递公司信息