Flight Designator
npm
Install via$ npm install --save flight-designator
Usage
For API Documentation, see doc/api-reference.md
var FlightDesignator =
Parse
FlightDesignator // OR> FlightDesignator airlineCode: 'U2' flightNumber: 4511 operationalSuffix: 'A'
Validate
FlightDesignator> true
FlightDesignator> true
FlightDesignator> true
Construct & validate instance
// Construct a flight designatorvar flight = 'KLM' '645' > FlightDesignator airlineCode: 'KLM' flightNumber: 645 operationalSuffix: ''// Check whether it's validflight> true
Format flight designators
FlightDesignator// Compact> 'U2350A'// With spacesFlightDesignator> 'U2 350 A'// With zero-padded flight numberFlightDesignator> 'U2 0350 A'
var flight = 'LH' 254 'X' // Compactflight> 'LH254X'// With spacesflight> 'LH 254 X'// With zero-padded flight numberflight> 'LH 0254 X'