UNPKG

@signatu/common-lib

Version:

Common Javascript/Typescript library for Signatu

57 lines 2.25 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var country_1 = require("./country"); // Locations in addition to the ISO country codes. // NOTE: the alpha-2 codes are NOT official, but do not overlap with ISO 3166 var locations = [ { "name": "EU and EFTA", "region": "Europe", "alpha-2": "EA" }, { "name": "EU", "region": "Europe", "alpha-2": "EU" }, { "name": "EFTA", "region": "Europe", "alpha-2": "EF" }, { "name": "International Organization", "region": "Worldwide", "alpha-2": "IZ" }, ]; // Decorate locations with isoCountry locations.forEach(function (location) { return location.isoCountry = location['alpha-2']; }); var Location = /** @class */ (function (_super) { __extends(Location, _super); function Location(countryCode) { if (countryCode === void 0) { countryCode = 'EU and EFTA'; } var _this = _super.call(this) || this; _this.countries = locations.concat(_this.countries); _this.setCountry(countryCode); return _this; } Object.defineProperty(Location, "supportedCountries", { get: function () { return locations.concat(country_1.Country.supportedCountries); }, enumerable: true, configurable: true }); Object.defineProperty(Location.prototype, "locations", { get: function () { return this.countries; }, enumerable: true, configurable: true }); Location.fromJSON = function (json) { return new Location(json); }; return Location; }(country_1.Country)); exports.Location = Location; ; //# sourceMappingURL=location.js.map