geography-apis-sdk
Version:
SDK for making requests to Geography APIs
26 lines (23 loc) • 561 B
JavaScript
/**
* Represents the postal code information of a country.
*/
class PostalCode {
/**
* Creates an instance of the PostalCode class.
* @param {object} data - The postal code data.
*/
constructor(data) {
if(typeof data == 'undefined') return;
/**
* The format of the postal code.
* @type {string}
*/
this.format = data.format;
/**
* The regular expression pattern for matching postal codes.
* @type {string}
*/
this.regex = data.regex;
}
}
module.exports = PostalCode;