From 252ea1f4d88d9c4f10440a38042f8c0686b353ed Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Mon, 21 Sep 2020 10:20:16 +0200 Subject: [PATCH 01/24] Restore ireland --- mappings/alpha2-to-formats.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mappings/alpha2-to-formats.json b/mappings/alpha2-to-formats.json index f50d4bc..f76abc0 100644 --- a/mappings/alpha2-to-formats.json +++ b/mappings/alpha2-to-formats.json @@ -200,6 +200,9 @@ "HN.json": [ "HN" ], + "IE.json": [ + "IE" + ], "IM.json": [ "IM" ], @@ -316,4 +319,4 @@ "WS.json": [ "WS" ] -} \ No newline at end of file +} From 1cc09efc626af8e89c0876c7c02404ec54e3a2cd Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Mon, 21 Sep 2020 10:24:16 +0200 Subject: [PATCH 02/24] Restore panama --- mappings/alpha2-to-formats.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mappings/alpha2-to-formats.json b/mappings/alpha2-to-formats.json index f76abc0..e28b7da 100644 --- a/mappings/alpha2-to-formats.json +++ b/mappings/alpha2-to-formats.json @@ -46,6 +46,7 @@ "NO", "NO", "NZ", + "PA", "PH", "PY", "SI", @@ -123,7 +124,6 @@ "KG", "KZ", "NG", - "PA", "RO", "SG", "TJ", From 87c9df17c4cf106c90ccd3b46c4d41cc96b71549 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Mon, 21 Sep 2020 10:29:44 +0200 Subject: [PATCH 03/24] Fix build script --- build/generate-mappings.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/generate-mappings.js b/build/generate-mappings.js index 5dbd081..554901e 100644 --- a/build/generate-mappings.js +++ b/build/generate-mappings.js @@ -45,8 +45,8 @@ function generateMappings() { byAlpha3[alpha3] = countrySpecificData; }); - fs.writeFile(path.join(basePath,'../generated/postal-codes-alpha2.json'), JSON.stringify(byAlpha2, null, " ")); - fs.writeFile(path.join(basePath,'../generated/postal-codes-alpha3.json'), JSON.stringify(byAlpha3, null, " ")); + fs.writeFileSync(path.join(basePath,'../generated/postal-codes-alpha2.json'), JSON.stringify(byAlpha2, null, " ")); + fs.writeFileSync(path.join(basePath,'../generated/postal-codes-alpha3.json'), JSON.stringify(byAlpha3, null, " ")); } -generateMappings(); \ No newline at end of file +generateMappings(); From 738c020a0920302e78809aab15a97c48d765de91 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Mon, 21 Sep 2020 10:30:14 +0200 Subject: [PATCH 04/24] Generate mappings --- generated/postal-codes-alpha2.json | 2 +- generated/postal-codes-alpha3.json | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/generated/postal-codes-alpha2.json b/generated/postal-codes-alpha2.json index 3cdc04b..3d3f98c 100644 --- a/generated/postal-codes-alpha2.json +++ b/generated/postal-codes-alpha2.json @@ -1630,7 +1630,7 @@ }, "VN": { "countryName": "Viet Nam", - "postalCodeFormat": "5Digits.json", + "postalCodeFormat": "6Digits.json", "alpha2": "VN", "alpha3": "VNM", "numeric3": "704" diff --git a/generated/postal-codes-alpha3.json b/generated/postal-codes-alpha3.json index 60349bf..6d96b25 100644 --- a/generated/postal-codes-alpha3.json +++ b/generated/postal-codes-alpha3.json @@ -408,7 +408,7 @@ }, "DNK": { "countryName": "Denmark", - "postalCodeFormat": "4Digits.json", + "postalCodeFormat": "DK.json", "alpha2": "DK", "alpha3": "DNK", "numeric3": "208" @@ -871,7 +871,7 @@ }, "LUX": { "countryName": "Luxembourg", - "postalCodeFormat": "4Digits.json", + "postalCodeFormat": "LU.json", "alpha2": "LU", "alpha3": "LUX", "numeric3": "442" @@ -1623,7 +1623,7 @@ }, "VNM": { "countryName": "Viet Nam", - "postalCodeFormat": "5Digits.json", + "postalCodeFormat": "6Digits.json", "alpha2": "VN", "alpha3": "VNM", "numeric3": "704" @@ -1667,4 +1667,4 @@ "alpha3": "ZWE", "numeric3": "716" } -} +} \ No newline at end of file From cd7824c200635642228b8ed282bb65778dfd7ea4 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Thu, 24 Sep 2020 11:34:10 +0200 Subject: [PATCH 05/24] Bump version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6a22bd1..31028d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "postal-codes-js", - "version": "2.5.1", + "version": "2.5.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0af69b8..bbda8a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postal-codes-js", - "version": "2.5.1", + "version": "2.5.2", "description": "Postal Codes", "main": "postal-codes.js", "scripts": { From 4cc2fa56a1e16255759ac76e4b7cafdef52b0b1a Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Thu, 24 Sep 2020 16:27:06 +0200 Subject: [PATCH 06/24] Start of v3 - Combine country data - Split regexes & test data - Add universal & extendable lookup - Add lookup generator script - Return boolean instead of strings - Web and node are now equal --- build/generate-mappings.js | 52 - build/make-lookup.js | 15 + data/countries.json | 1490 +++ data/formats.json | 258 + data/lookup.json | 746 ++ data/tests.json | 752 ++ formats-node.js | 8 - formats-web.js | 73 - formats/10Digits.json | 16 - formats/2Digits.json | 17 - formats/3Digits.json | 16 - formats/4Digits.json | 16 - formats/5Digits.json | 16 - formats/6Digits.json | 16 - formats/7Digits.json | 16 - formats/8Digits.json | 16 - formats/AD.json | 16 - formats/AI.json | 16 - formats/AQ.json | 15 - formats/AX.json | 17 - formats/AZ.json | 16 - formats/BB.json | 15 - formats/BH.json | 15 - formats/BL.json | 14 - formats/BN.json | 17 - formats/CA.json | 15 - formats/DK.json | 23 - formats/FK.json | 15 - formats/GB.json | 32 - formats/GF.json | 17 - formats/GG.json | 19 - formats/GI.json | 15 - formats/GP.json | 17 - formats/GS.json | 16 - formats/HN.json | 16 - formats/IE.json | 18 - formats/IM.json | 18 - formats/IO.json | 15 - formats/JE.json | 18 - formats/KY.json | 16 - formats/LB.json | 17 - formats/LC.json | 16 - formats/LT.json | 17 - formats/LU.json | 23 - formats/LV.json | 17 - formats/MC.json | 15 - formats/MD.json | 17 - formats/MF.json | 14 - formats/MS.json | 17 - formats/MT.json | 16 - formats/NC.json | 17 - formats/NL.json | 18 - formats/PF.json | 17 - formats/PL.json | 20 - formats/PM.json | 14 - formats/PN.json | 15 - formats/PT.json | 19 - formats/RE.json | 17 - formats/RU.json | 16 - formats/SH.json | 15 - formats/SM.json | 16 - formats/SO.json | 16 - formats/SZ.json | 15 - formats/TC.json | 15 - formats/TW.json | 17 - formats/US.json | 16 - formats/VA.json | 14 - formats/VC.json | 17 - formats/VE.json | 15 - formats/VG.json | 17 - formats/WF.json | 17 - formats/WS.json | 17 - generated/postal-codes-alpha2.json | 1677 --- generated/postal-codes-alpha3.json | 1670 --- index.d.ts | 2 +- mappings/alpha2-to-formats.json | 322 - mappings/iso-3-country-code-mapping.json | 1237 --- package.json | 4 - postal-codes.js | 75 - src/index.js | 33 + test-web/README.md | 4 - test-web/bundle-tests.js | 11577 --------------------- test-web/tests.html | 17 - test-web/webpack.config.js | 12 - test/formats-web-tests.js | 23 - test/validationTests.js | 101 - 86 files changed, 3295 insertions(+), 17922 deletions(-) delete mode 100644 build/generate-mappings.js create mode 100644 build/make-lookup.js create mode 100644 data/countries.json create mode 100644 data/formats.json create mode 100644 data/lookup.json create mode 100644 data/tests.json delete mode 100644 formats-node.js delete mode 100644 formats-web.js delete mode 100644 formats/10Digits.json delete mode 100644 formats/2Digits.json delete mode 100644 formats/3Digits.json delete mode 100644 formats/4Digits.json delete mode 100644 formats/5Digits.json delete mode 100644 formats/6Digits.json delete mode 100644 formats/7Digits.json delete mode 100644 formats/8Digits.json delete mode 100644 formats/AD.json delete mode 100644 formats/AI.json delete mode 100644 formats/AQ.json delete mode 100644 formats/AX.json delete mode 100644 formats/AZ.json delete mode 100644 formats/BB.json delete mode 100644 formats/BH.json delete mode 100644 formats/BL.json delete mode 100644 formats/BN.json delete mode 100644 formats/CA.json delete mode 100644 formats/DK.json delete mode 100644 formats/FK.json delete mode 100644 formats/GB.json delete mode 100644 formats/GF.json delete mode 100644 formats/GG.json delete mode 100644 formats/GI.json delete mode 100644 formats/GP.json delete mode 100644 formats/GS.json delete mode 100644 formats/HN.json delete mode 100644 formats/IE.json delete mode 100644 formats/IM.json delete mode 100644 formats/IO.json delete mode 100644 formats/JE.json delete mode 100644 formats/KY.json delete mode 100644 formats/LB.json delete mode 100644 formats/LC.json delete mode 100644 formats/LT.json delete mode 100644 formats/LU.json delete mode 100644 formats/LV.json delete mode 100644 formats/MC.json delete mode 100644 formats/MD.json delete mode 100644 formats/MF.json delete mode 100644 formats/MS.json delete mode 100644 formats/MT.json delete mode 100644 formats/NC.json delete mode 100644 formats/NL.json delete mode 100644 formats/PF.json delete mode 100644 formats/PL.json delete mode 100644 formats/PM.json delete mode 100644 formats/PN.json delete mode 100644 formats/PT.json delete mode 100644 formats/RE.json delete mode 100644 formats/RU.json delete mode 100644 formats/SH.json delete mode 100644 formats/SM.json delete mode 100644 formats/SO.json delete mode 100644 formats/SZ.json delete mode 100644 formats/TC.json delete mode 100644 formats/TW.json delete mode 100644 formats/US.json delete mode 100644 formats/VA.json delete mode 100644 formats/VC.json delete mode 100644 formats/VE.json delete mode 100644 formats/VG.json delete mode 100644 formats/WF.json delete mode 100644 formats/WS.json delete mode 100644 generated/postal-codes-alpha2.json delete mode 100644 generated/postal-codes-alpha3.json delete mode 100644 mappings/alpha2-to-formats.json delete mode 100644 mappings/iso-3-country-code-mapping.json delete mode 100644 postal-codes.js create mode 100644 src/index.js delete mode 100644 test-web/README.md delete mode 100644 test-web/bundle-tests.js delete mode 100644 test-web/tests.html delete mode 100644 test-web/webpack.config.js delete mode 100644 test/formats-web-tests.js delete mode 100644 test/validationTests.js diff --git a/build/generate-mappings.js b/build/generate-mappings.js deleted file mode 100644 index 554901e..0000000 --- a/build/generate-mappings.js +++ /dev/null @@ -1,52 +0,0 @@ -var fs = require('fs'); -var path = require('path'); - -function generateMappings() { - - var basePath = __dirname; - - var data = require(path.join(basePath,'../mappings/alpha2-to-formats.json')); - - var countryFormats = {} - Object.keys(data).map(function (formatName) { - var countries = data[formatName]; - countries.map(function (countryName) { - countryFormats[countryName] = formatName; - }) - }); - - var byAlpha3 = {} - var byAlpha2 = {} - var countryDataByAlpha3 = require(path.join(basePath,'../mappings/iso-3-country-code-mapping.json')) - Object.keys(countryDataByAlpha3).map(function (alpha3) { - var countrySpecificData = countryDataByAlpha3[alpha3] - var alpha2 = countrySpecificData.iso2CountryCode; - - countrySpecificData['postalCodeFormat'] = countryFormats[alpha2]; - countrySpecificData['alpha2'] = alpha2; - countrySpecificData['alpha3'] = alpha3; - countrySpecificData['numeric3'] = countrySpecificData['isoNumericCountryCode']; - - delete countrySpecificData['iso2CountryCode']; - delete countrySpecificData['isoNumericCountryCode']; - - if (!countrySpecificData.postalCodeFormat) { - fs.exists(path.join(basePath,'../formats/', alpha2 + ".json"), function(isThere){ - if(isThere) { - countrySpecificData.postalCodeFormat = alpha2 + '.json'; - return; - } - - console.log( 'Missing postal code format: ' + alpha2 + '/' + alpha3); - }); - } - - byAlpha2[alpha2] = countrySpecificData; - byAlpha3[alpha3] = countrySpecificData; - }); - - fs.writeFileSync(path.join(basePath,'../generated/postal-codes-alpha2.json'), JSON.stringify(byAlpha2, null, " ")); - fs.writeFileSync(path.join(basePath,'../generated/postal-codes-alpha3.json'), JSON.stringify(byAlpha3, null, " ")); -} - -generateMappings(); diff --git a/build/make-lookup.js b/build/make-lookup.js new file mode 100644 index 0000000..442d901 --- /dev/null +++ b/build/make-lookup.js @@ -0,0 +1,15 @@ +const fs = require('fs'); +const countries = require('../data/countries.json'); + +const lookup = {}; + +Object + .values(countries) + .forEach(({alpha2, alpha3, numeric3}, index) => { + lookup[alpha2] = index; + lookup[alpha3] = index; + lookup[numeric3] = index; + }); + + +fs.writeFileSync('../data/lookup.json', JSON.stringify(lookup, null, 2)); diff --git a/data/countries.json b/data/countries.json new file mode 100644 index 0000000..d8c4a91 --- /dev/null +++ b/data/countries.json @@ -0,0 +1,1490 @@ +[ + { + "alpha2": "AD", + "alpha3": "AND", + "numeric3": "020", + "postalCodeFormat": "AD" + }, + { + "alpha2": "AE", + "alpha3": "ARE", + "numeric3": "784", + "postalCodeFormat": false + }, + { + "alpha2": "AF", + "alpha3": "AFG", + "numeric3": "004", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "AG", + "alpha3": "ATG", + "numeric3": "028", + "postalCodeFormat": false + }, + { + "alpha2": "AI", + "alpha3": "AIA", + "numeric3": "660", + "postalCodeFormat": "AI" + }, + { + "alpha2": "AL", + "alpha3": "ALB", + "numeric3": "008", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "AM", + "alpha3": "ARM", + "numeric3": "051", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "AN", + "alpha3": "ANT", + "numeric3": "530", + "postalCodeFormat": false + }, + { + "alpha2": "AO", + "alpha3": "AGO", + "numeric3": "024", + "postalCodeFormat": false + }, + { + "alpha2": "AQ", + "alpha3": "ATA", + "numeric3": "010", + "postalCodeFormat": "AQ" + }, + { + "alpha2": "AR", + "alpha3": "ARG", + "numeric3": "032", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "AS", + "alpha3": "ASM", + "numeric3": "016", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "AT", + "alpha3": "AUT", + "numeric3": "040", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "AU", + "alpha3": "AUS", + "numeric3": "036", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "AW", + "alpha3": "ABW", + "numeric3": "533", + "postalCodeFormat": false + }, + { + "alpha2": "AX", + "alpha3": "ALA", + "numeric3": "248", + "postalCodeFormat": "AX" + }, + { + "alpha2": "AZ", + "alpha3": "AZE", + "numeric3": "031", + "postalCodeFormat": "AZ" + }, + { + "alpha2": "BA", + "alpha3": "BIH", + "numeric3": "070", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "BB", + "alpha3": "BRB", + "numeric3": "052", + "postalCodeFormat": "BB" + }, + { + "alpha2": "BD", + "alpha3": "BGD", + "numeric3": "050", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "BE", + "alpha3": "BEL", + "numeric3": "056", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "BF", + "alpha3": "BFA", + "numeric3": "854", + "postalCodeFormat": false + }, + { + "alpha2": "BG", + "alpha3": "BGR", + "numeric3": "100", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "BH", + "alpha3": "BHR", + "numeric3": "048", + "postalCodeFormat": "BH" + }, + { + "alpha2": "BI", + "alpha3": "BDI", + "numeric3": "108", + "postalCodeFormat": false + }, + { + "alpha2": "BJ", + "alpha3": "BEN", + "numeric3": "204", + "postalCodeFormat": false + }, + { + "alpha2": "BL", + "alpha3": "BLM", + "numeric3": "652", + "postalCodeFormat": "BL" + }, + { + "alpha2": "BM", + "alpha3": "BMU", + "numeric3": "060", + "postalCodeFormat": false + }, + { + "alpha2": "BN", + "alpha3": "BRN", + "numeric3": "096", + "postalCodeFormat": "BN" + }, + { + "alpha2": "BO", + "alpha3": "BOL", + "numeric3": "068", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "BR", + "alpha3": "BRA", + "numeric3": "076", + "postalCodeFormat": "8Digits" + }, + { + "alpha2": "BS", + "alpha3": "BHS", + "numeric3": "044", + "postalCodeFormat": false + }, + { + "alpha2": "BT", + "alpha3": "BTN", + "numeric3": "064", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "BV", + "alpha3": "BVT", + "numeric3": "074", + "postalCodeFormat": false + }, + { + "alpha2": "BW", + "alpha3": "BWA", + "numeric3": "072", + "postalCodeFormat": false + }, + { + "alpha2": "BY", + "alpha3": "BLR", + "numeric3": "112", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "BZ", + "alpha3": "BLZ", + "numeric3": "084", + "postalCodeFormat": false + }, + { + "alpha2": "CA", + "alpha3": "CAN", + "numeric3": "124", + "postalCodeFormat": "CA" + }, + { + "alpha2": "CC", + "alpha3": "CCK", + "numeric3": "166", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "CD", + "alpha3": "COD", + "numeric3": "180", + "postalCodeFormat": false + }, + { + "alpha2": "CF", + "alpha3": "CAF", + "numeric3": "140", + "postalCodeFormat": false + }, + { + "alpha2": "CG", + "alpha3": "COG", + "numeric3": "178", + "postalCodeFormat": false + }, + { + "alpha2": "CH", + "alpha3": "CHE", + "numeric3": "756", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "CI", + "alpha3": "CIV", + "numeric3": "384", + "postalCodeFormat": false + }, + { + "alpha2": "CK", + "alpha3": "COK", + "numeric3": "184", + "postalCodeFormat": false + }, + { + "alpha2": "CL", + "alpha3": "CHL", + "numeric3": "152", + "postalCodeFormat": "7Digits" + }, + { + "alpha2": "CM", + "alpha3": "CMR", + "numeric3": "120", + "postalCodeFormat": false + }, + { + "alpha2": "CN", + "alpha3": "CHN", + "numeric3": "156", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "CO", + "alpha3": "COL", + "numeric3": "170", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "CR", + "alpha3": "CRI", + "numeric3": "188", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "CU", + "alpha3": "CUB", + "numeric3": "192", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "CV", + "alpha3": "CPV", + "numeric3": "132", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "CX", + "alpha3": "CXR", + "numeric3": "162", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "CY", + "alpha3": "CYP", + "numeric3": "196", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "CZ", + "alpha3": "CZE", + "numeric3": "203", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "DE", + "alpha3": "DEU", + "numeric3": "276", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "DJ", + "alpha3": "DJI", + "numeric3": "262", + "postalCodeFormat": false + }, + { + "alpha2": "DK", + "alpha3": "DNK", + "numeric3": "208", + "postalCodeFormat": "DK" + }, + { + "alpha2": "DM", + "alpha3": "DMA", + "numeric3": "212", + "postalCodeFormat": false + }, + { + "alpha2": "DO", + "alpha3": "DOM", + "numeric3": "214", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "DZ", + "alpha3": "DZA", + "numeric3": "012", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "EC", + "alpha3": "ECU", + "numeric3": "218", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "EE", + "alpha3": "EST", + "numeric3": "233", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "EG", + "alpha3": "EGY", + "numeric3": "818", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "EH", + "alpha3": "ESH", + "numeric3": "732", + "postalCodeFormat": false + }, + { + "alpha2": "ER", + "alpha3": "ERI", + "numeric3": "232", + "postalCodeFormat": false + }, + { + "alpha2": "ES", + "alpha3": "ESP", + "numeric3": "724", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "ET", + "alpha3": "ETH", + "numeric3": "231", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "FI", + "alpha3": "FIN", + "numeric3": "246", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "FJ", + "alpha3": "FJI", + "numeric3": "242", + "postalCodeFormat": false + }, + { + "alpha2": "FK", + "alpha3": "FLK", + "numeric3": "238", + "postalCodeFormat": "FK" + }, + { + "alpha2": "FM", + "alpha3": "FSM", + "numeric3": "583", + "postalCodeFormat": "US" + }, + { + "alpha2": "FO", + "alpha3": "FRO", + "numeric3": "234", + "postalCodeFormat": "3Digits" + }, + { + "alpha2": "FR", + "alpha3": "FRA", + "numeric3": "250", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "GA", + "alpha3": "GAB", + "numeric3": "266", + "postalCodeFormat": false + }, + { + "alpha2": "GB", + "alpha3": "GBR", + "numeric3": "826", + "postalCodeFormat": "GB" + }, + { + "alpha2": "GD", + "alpha3": "GRD", + "numeric3": "308", + "postalCodeFormat": false + }, + { + "alpha2": "GE", + "alpha3": "GEO", + "numeric3": "268", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "GF", + "alpha3": "GUF", + "numeric3": "254", + "postalCodeFormat": "GF" + }, + { + "alpha2": "GG", + "alpha3": "GGY", + "numeric3": "831", + "postalCodeFormat": "GG" + }, + { + "alpha2": "GH", + "alpha3": "GHA", + "numeric3": "288", + "postalCodeFormat": false + }, + { + "alpha2": "GI", + "alpha3": "GIB", + "numeric3": "292", + "postalCodeFormat": "GI" + }, + { + "alpha2": "GL", + "alpha3": "GRL", + "numeric3": "304", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "GM", + "alpha3": "GMB", + "numeric3": "270", + "postalCodeFormat": false + }, + { + "alpha2": "GN", + "alpha3": "GIN", + "numeric3": "324", + "postalCodeFormat": "3Digits" + }, + { + "alpha2": "GP", + "alpha3": "GLP", + "numeric3": "312", + "postalCodeFormat": "GP" + }, + { + "alpha2": "GQ", + "alpha3": "GNQ", + "numeric3": "226", + "postalCodeFormat": false + }, + { + "alpha2": "GR", + "alpha3": "GRC", + "numeric3": "300", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "GS", + "alpha3": "SGS", + "numeric3": "239", + "postalCodeFormat": "GS" + }, + { + "alpha2": "GT", + "alpha3": "GTM", + "numeric3": "320", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "GU", + "alpha3": "GUM", + "numeric3": "316", + "postalCodeFormat": "US" + }, + { + "alpha2": "GW", + "alpha3": "GNB", + "numeric3": "624", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "GY", + "alpha3": "GUY", + "numeric3": "328", + "postalCodeFormat": false + }, + { + "alpha2": "HK", + "alpha3": "HKG", + "numeric3": "344", + "postalCodeFormat": false + }, + { + "alpha2": "HM", + "alpha3": "HMD", + "numeric3": "334", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "HN", + "alpha3": "HND", + "numeric3": "340", + "postalCodeFormat": "HN" + }, + { + "alpha2": "HR", + "alpha3": "HRV", + "numeric3": "191", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "HT", + "alpha3": "HTI", + "numeric3": "332", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "HU", + "alpha3": "HUN", + "numeric3": "348", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "IC", + "alpha3": "", + "numeric3": "000", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "ID", + "alpha3": "IDN", + "numeric3": "360", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "IE", + "alpha3": "IRL", + "numeric3": "372", + "postalCodeFormat": "IE" + }, + { + "alpha2": "IL", + "alpha3": "ISR", + "numeric3": "376", + "postalCodeFormat": "7Digits" + }, + { + "alpha2": "IM", + "alpha3": "IMN", + "numeric3": "833", + "postalCodeFormat": "IM" + }, + { + "alpha2": "IN", + "alpha3": "IND", + "numeric3": "356", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "IO", + "alpha3": "IOT", + "numeric3": "086", + "postalCodeFormat": "IO" + }, + { + "alpha2": "IQ", + "alpha3": "IRQ", + "numeric3": "368", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "IR", + "alpha3": "IRN", + "numeric3": "364", + "postalCodeFormat": "10Digits" + }, + { + "alpha2": "IS", + "alpha3": "ISL", + "numeric3": "352", + "postalCodeFormat": "3Digits" + }, + { + "alpha2": "IT", + "alpha3": "ITA", + "numeric3": "380", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "JE", + "alpha3": "JEY", + "numeric3": "832", + "postalCodeFormat": "JE" + }, + { + "alpha2": "JM", + "alpha3": "JAM", + "numeric3": "388", + "postalCodeFormat": "2Digits" + }, + { + "alpha2": "JO", + "alpha3": "JOR", + "numeric3": "400", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "JP", + "alpha3": "JPN", + "numeric3": "392", + "postalCodeFormat": "7Digits" + }, + { + "alpha2": "KE", + "alpha3": "KEN", + "numeric3": "404", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "KG", + "alpha3": "KGZ", + "numeric3": "417", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "KH", + "alpha3": "KHM", + "numeric3": "116", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "KI", + "alpha3": "KIR", + "numeric3": "296", + "postalCodeFormat": false + }, + { + "alpha2": "KM", + "alpha3": "COM", + "numeric3": "174", + "postalCodeFormat": false + }, + { + "alpha2": "KN", + "alpha3": "KNA", + "numeric3": "659", + "postalCodeFormat": false + }, + { + "alpha2": "KP", + "alpha3": "PRK", + "numeric3": "408", + "postalCodeFormat": false + }, + { + "alpha2": "KR", + "alpha3": "KOR", + "numeric3": "410", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "KW", + "alpha3": "KWT", + "numeric3": "414", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "KY", + "alpha3": "CYM", + "numeric3": "136", + "postalCodeFormat": "KY" + }, + { + "alpha2": "KZ", + "alpha3": "KAZ", + "numeric3": "398", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "LA", + "alpha3": "LAO", + "numeric3": "418", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "LB", + "alpha3": "LBN", + "numeric3": "422", + "postalCodeFormat": "LB" + }, + { + "alpha2": "LC", + "alpha3": "LCA", + "numeric3": "662", + "postalCodeFormat": "LC" + }, + { + "alpha2": "LI", + "alpha3": "LIE", + "numeric3": "438", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "LK", + "alpha3": "LKA", + "numeric3": "144", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "LR", + "alpha3": "LBR", + "numeric3": "430", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "LS", + "alpha3": "LSO", + "numeric3": "426", + "postalCodeFormat": "3Digits" + }, + { + "alpha2": "LT", + "alpha3": "LTU", + "numeric3": "440", + "postalCodeFormat": "LT" + }, + { + "alpha2": "LU", + "alpha3": "LUX", + "numeric3": "442", + "postalCodeFormat": "LU" + }, + { + "alpha2": "LV", + "alpha3": "LVA", + "numeric3": "428", + "postalCodeFormat": "LV" + }, + { + "alpha2": "LY", + "alpha3": "LBY", + "numeric3": "434", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "MA", + "alpha3": "MAR", + "numeric3": "504", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "MC", + "alpha3": "MCO", + "numeric3": "492", + "postalCodeFormat": "MC" + }, + { + "alpha2": "MD", + "alpha3": "MDA", + "numeric3": "498", + "postalCodeFormat": "MD" + }, + { + "alpha2": "ME", + "alpha3": "MNE", + "numeric3": "499", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "MF", + "alpha3": "MAF", + "numeric3": "663", + "postalCodeFormat": "MF" + }, + { + "alpha2": "MG", + "alpha3": "MDG", + "numeric3": "450", + "postalCodeFormat": "3Digits" + }, + { + "alpha2": "MH", + "alpha3": "MHL", + "numeric3": "584", + "postalCodeFormat": "US" + }, + { + "alpha2": "MK", + "alpha3": "MKD", + "numeric3": "807", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "ML", + "alpha3": "MLI", + "numeric3": "466", + "postalCodeFormat": false + }, + { + "alpha2": "MM", + "alpha3": "MMR", + "numeric3": "104", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "MN", + "alpha3": "MNG", + "numeric3": "496", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "MO", + "alpha3": "MAC", + "numeric3": "446", + "postalCodeFormat": false + }, + { + "alpha2": "MP", + "alpha3": "MNP", + "numeric3": "580", + "postalCodeFormat": "US" + }, + { + "alpha2": "MQ", + "alpha3": "MTQ", + "numeric3": "474", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "MR", + "alpha3": "MRT", + "numeric3": "478", + "postalCodeFormat": false + }, + { + "alpha2": "MS", + "alpha3": "MSR", + "numeric3": "500", + "postalCodeFormat": "MS" + }, + { + "alpha2": "MT", + "alpha3": "MLT", + "numeric3": "470", + "postalCodeFormat": "MT" + }, + { + "alpha2": "MU", + "alpha3": "MUS", + "numeric3": "480", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "MV", + "alpha3": "MDV", + "numeric3": "462", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "MW", + "alpha3": "MWI", + "numeric3": "454", + "postalCodeFormat": false + }, + { + "alpha2": "MX", + "alpha3": "MEX", + "numeric3": "484", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "MY", + "alpha3": "MYS", + "numeric3": "458", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "MZ", + "alpha3": "MOZ", + "numeric3": "508", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "NA", + "alpha3": "NAM", + "numeric3": "516", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "NC", + "alpha3": "NCL", + "numeric3": "540", + "postalCodeFormat": "NC" + }, + { + "alpha2": "NE", + "alpha3": "NER", + "numeric3": "562", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "NF", + "alpha3": "NFK", + "numeric3": "574", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "NG", + "alpha3": "NGA", + "numeric3": "566", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "NI", + "alpha3": "NIC", + "numeric3": "558", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "NL", + "alpha3": "NLD", + "numeric3": "528", + "postalCodeFormat": "NL" + }, + { + "alpha2": "NO", + "alpha3": "NOR", + "numeric3": "578", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "NP", + "alpha3": "NPL", + "numeric3": "524", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "NR", + "alpha3": "NRU", + "numeric3": "520", + "postalCodeFormat": false + }, + { + "alpha2": "NU", + "alpha3": "NIU", + "numeric3": "570", + "postalCodeFormat": false + }, + { + "alpha2": "NZ", + "alpha3": "NZL", + "numeric3": "554", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "OM", + "alpha3": "OMN", + "numeric3": "512", + "postalCodeFormat": "3Digits" + }, + { + "alpha2": "PA", + "alpha3": "PAN", + "numeric3": "591", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "PE", + "alpha3": "PER", + "numeric3": "604", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "PF", + "alpha3": "PYF", + "numeric3": "258", + "postalCodeFormat": "PF" + }, + { + "alpha2": "PG", + "alpha3": "PNG", + "numeric3": "598", + "postalCodeFormat": "3Digits" + }, + { + "alpha2": "PH", + "alpha3": "PHL", + "numeric3": "608", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "PK", + "alpha3": "PAK", + "numeric3": "586", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "PL", + "alpha3": "POL", + "numeric3": "616", + "postalCodeFormat": "PL" + }, + { + "alpha2": "PM", + "alpha3": "SPM", + "numeric3": "666", + "postalCodeFormat": "PM" + }, + { + "alpha2": "PN", + "alpha3": "PCN", + "numeric3": "612", + "postalCodeFormat": "PN" + }, + { + "alpha2": "PR", + "alpha3": "PRI", + "numeric3": "630", + "postalCodeFormat": "US" + }, + { + "alpha2": "PS", + "alpha3": "PSE", + "numeric3": "275", + "postalCodeFormat": "3Digits" + }, + { + "alpha2": "PT", + "alpha3": "PRT", + "numeric3": "620", + "postalCodeFormat": "PT" + }, + { + "alpha2": "PW", + "alpha3": "PLW", + "numeric3": "585", + "postalCodeFormat": "US" + }, + { + "alpha2": "PY", + "alpha3": "PRY", + "numeric3": "600", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "QA", + "alpha3": "QAT", + "numeric3": "634", + "postalCodeFormat": false + }, + { + "alpha2": "RE", + "alpha3": "REU", + "numeric3": "638", + "postalCodeFormat": "RE" + }, + { + "alpha2": "RO", + "alpha3": "ROU", + "numeric3": "642", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "RS", + "alpha3": "SRB", + "numeric3": "688", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "RU", + "alpha3": "RUS", + "numeric3": "643", + "postalCodeFormat": "RU" + }, + { + "alpha2": "RW", + "alpha3": "RWA", + "numeric3": "646", + "postalCodeFormat": false + }, + { + "alpha2": "SA", + "alpha3": "SAU", + "numeric3": "682", + "postalCodeFormat": "US" + }, + { + "alpha2": "SB", + "alpha3": "SLB", + "numeric3": "090", + "postalCodeFormat": false + }, + { + "alpha2": "SC", + "alpha3": "SYC", + "numeric3": "690", + "postalCodeFormat": false + }, + { + "alpha2": "SD", + "alpha3": "SDN", + "numeric3": "736", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "SE", + "alpha3": "SWE", + "numeric3": "752", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "SG", + "alpha3": "SGP", + "numeric3": "702", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "SH", + "alpha3": "SHN", + "numeric3": "654", + "postalCodeFormat": "SH" + }, + { + "alpha2": "SI", + "alpha3": "SVN", + "numeric3": "705", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "SJ", + "alpha3": "SJM", + "numeric3": "744", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "SK", + "alpha3": "SVK", + "numeric3": "703", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "SL", + "alpha3": "SLE", + "numeric3": "694", + "postalCodeFormat": false + }, + { + "alpha2": "SM", + "alpha3": "SMR", + "numeric3": "674", + "postalCodeFormat": "SM" + }, + { + "alpha2": "SN", + "alpha3": "SEN", + "numeric3": "686", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "SO", + "alpha3": "SOM", + "numeric3": "706", + "postalCodeFormat": "SO" + }, + { + "alpha2": "SR", + "alpha3": "SUR", + "numeric3": "740", + "postalCodeFormat": false + }, + { + "alpha2": "SS", + "alpha3": "SSD", + "numeric3": "728", + "postalCodeFormat": false + }, + { + "alpha2": "ST", + "alpha3": "STP", + "numeric3": "678", + "postalCodeFormat": false + }, + { + "alpha2": "SV", + "alpha3": "SLV", + "numeric3": "222", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "SY", + "alpha3": "SYR", + "numeric3": "760", + "postalCodeFormat": false + }, + { + "alpha2": "SZ", + "alpha3": "SWZ", + "numeric3": "748", + "postalCodeFormat": "SZ" + }, + { + "alpha2": "TC", + "alpha3": "TCA", + "numeric3": "796", + "postalCodeFormat": "TC" + }, + { + "alpha2": "TD", + "alpha3": "TCD", + "numeric3": "148", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "TF", + "alpha3": "ATF", + "numeric3": "260", + "postalCodeFormat": false + }, + { + "alpha2": "TG", + "alpha3": "TGO", + "numeric3": "768", + "postalCodeFormat": false + }, + { + "alpha2": "TH", + "alpha3": "THA", + "numeric3": "764", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "TJ", + "alpha3": "TJK", + "numeric3": "762", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "TK", + "alpha3": "TKL", + "numeric3": "772", + "postalCodeFormat": false + }, + { + "alpha2": "TL", + "alpha3": "TLS", + "numeric3": "626", + "postalCodeFormat": false + }, + { + "alpha2": "TM", + "alpha3": "TKM", + "numeric3": "795", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "TN", + "alpha3": "TUN", + "numeric3": "788", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "TO", + "alpha3": "TON", + "numeric3": "776", + "postalCodeFormat": false + }, + { + "alpha2": "TR", + "alpha3": "TUR", + "numeric3": "792", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "TT", + "alpha3": "TTO", + "numeric3": "780", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "TV", + "alpha3": "TUV", + "numeric3": "798", + "postalCodeFormat": false + }, + { + "alpha2": "TW", + "alpha3": "TWN", + "numeric3": "158", + "postalCodeFormat": "TW" + }, + { + "alpha2": "TZ", + "alpha3": "TZA", + "numeric3": "834", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "UA", + "alpha3": "UKR", + "numeric3": "804", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "UG", + "alpha3": "UGA", + "numeric3": "800", + "postalCodeFormat": false + }, + { + "alpha2": "UM", + "alpha3": "UMI", + "numeric3": "581", + "postalCodeFormat": false + }, + { + "alpha2": "US", + "alpha3": "USA", + "numeric3": "840", + "postalCodeFormat": "US" + }, + { + "alpha2": "UY", + "alpha3": "URY", + "numeric3": "858", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "UZ", + "alpha3": "UZB", + "numeric3": "860", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "VA", + "alpha3": "VAT", + "numeric3": "336", + "postalCodeFormat": "VA" + }, + { + "alpha2": "VC", + "alpha3": "VCT", + "numeric3": "670", + "postalCodeFormat": "VC" + }, + { + "alpha2": "VE", + "alpha3": "VEN", + "numeric3": "862", + "postalCodeFormat": "VE" + }, + { + "alpha2": "VG", + "alpha3": "VGB", + "numeric3": "092", + "postalCodeFormat": "VG" + }, + { + "alpha2": "VI", + "alpha3": "VIR", + "numeric3": "850", + "postalCodeFormat": "US" + }, + { + "alpha2": "VN", + "alpha3": "VNM", + "numeric3": "704", + "postalCodeFormat": "6Digits" + }, + { + "alpha2": "VU", + "alpha3": "VUT", + "numeric3": "548", + "postalCodeFormat": false + }, + { + "alpha2": "WF", + "alpha3": "WLF", + "numeric3": "876", + "postalCodeFormat": "WF" + }, + { + "alpha2": "WS", + "alpha3": "WSM", + "numeric3": "882", + "postalCodeFormat": "WS" + }, + { + "alpha2": "YE", + "alpha3": "YEM", + "numeric3": "887", + "postalCodeFormat": false + }, + { + "alpha2": "YT", + "alpha3": "MYT", + "numeric3": "175", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "ZA", + "alpha3": "ZAF", + "numeric3": "710", + "postalCodeFormat": "4Digits" + }, + { + "alpha2": "ZM", + "alpha3": "ZMB", + "numeric3": "894", + "postalCodeFormat": "5Digits" + }, + { + "alpha2": "ZW", + "alpha3": "ZWE", + "numeric3": "716", + "postalCodeFormat": false + } +] \ No newline at end of file diff --git a/data/formats.json b/data/formats.json new file mode 100644 index 0000000..87a9346 --- /dev/null +++ b/data/formats.json @@ -0,0 +1,258 @@ +{ + "10Digits": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{10}$" + }, + "2Digits": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{2}$" + }, + "3Digits": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{3}$" + }, + "4Digits": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{4}$" + }, + "5Digits": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{5}$" + }, + "6Digits": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{6}$" + }, + "7Digits": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{7}$" + }, + "8Digits": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{8}$" + }, + "AD": { + "redundantCharacters": " -", + "validationRegex": "^AD[0-9]{3}$" + }, + "AI": { + "redundantCharacters": " -", + "validationRegex": "^AI2640$" + }, + "AQ": { + "redundantCharacters": " -", + "validationRegex": "^BIQQ1ZZ$" + }, + "AX": { + "redundantCharacters": " -", + "validationRegex": "^(AX)?[0-9]{5}$" + }, + "AZ": { + "redundantCharacters": " -", + "validationRegex": "^AZ[0-9]{4}$" + }, + "BB": { + "redundantCharacters": " -", + "validationRegex": "^(BB)?[0-9]{5}$" + }, + "BH": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{3,4}$" + }, + "BL": { + "redundantCharacters": " -", + "validationRegex": "^97133$" + }, + "BN": { + "redundantCharacters": " -", + "validationRegex": "^[a-zA-Z]{2}[0-9]{4}$" + }, + "CA": { + "redundantCharacters": " -", + "validationRegex": "^[ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJ-NPRSTV-Z][\\s\\-]?\\d[ABCEGHJ-NPRSTV-Z]\\d$" + }, + "DK": { + "redundantCharacters": " -", + "validationRegex": "^(DK){0,1}\\d{4}$" + }, + "FK": { + "redundantCharacters": " -", + "validationRegex": "^FIQQ1ZZ$" + }, + "GB": { + "redundantCharacters": " -", + "validationRegex": "((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([AZa-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))[0-9][A-Za-z]{2})|GIR0AA" + }, + "GF": { + "redundantCharacters": " -", + "validationRegex": "^973[0-9]{2}$" + }, + "GG": { + "redundantCharacters": " -", + "validationRegex": "^GY[0-9]{2,3}[A-Za-z]{2}$" + }, + "GI": { + "redundantCharacters": " -", + "validationRegex": "^GX111AA$" + }, + "GP": { + "redundantCharacters": " -", + "validationRegex": "^971[0-9]{2}$" + }, + "GS": { + "redundantCharacters": " -", + "validationRegex": "^SIQQ1ZZ$" + }, + "HN": { + "redundantCharacters": " -", + "validationRegex": "^(HN)?[0-9]{5}$" + }, + "IE": { + "redundantCharacters": "", + "validationRegex": "^[AaC-Fc-fHhKkNnPpRrTtV-Yv-y]\\d[0-9Ww][ -]?[0-9AaC-Fc-fHhKkNnPpRrTtV-Yv-y]{4}$" + }, + "IM": { + "redundantCharacters": " -", + "validationRegex": "^IM[0-9]{2,3}[A-Za-z]{2}$" + }, + "IO": { + "redundantCharacters": " -", + "validationRegex": "^BBND1ZZ$" + }, + "JE": { + "redundantCharacters": " -", + "validationRegex": "^JE[0-9]{2,3}[A-Za-z]{2}$" + }, + "KY": { + "redundantCharacters": " -", + "validationRegex": "^KY[0-9]{5}$" + }, + "LB": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{4}(?:[0-9]{4})?$" + }, + "LC": { + "redundantCharacters": " -", + "validationRegex": "^LC[0-9]{5}$" + }, + "LT": { + "redundantCharacters": " -", + "validationRegex": "^(LT)?[0-9]{5}$" + }, + "LU": { + "redundantCharacters": " -", + "validationRegex": "^(L){0,1}\\d{4}$" + }, + "LV": { + "redundantCharacters": " -", + "validationRegex": "^(LV)?[0-9]{4}$" + }, + "MC": { + "redundantCharacters": " -", + "validationRegex": "^980[0-9]{2}$" + }, + "MD": { + "redundantCharacters": " -", + "validationRegex": "^(MD)?[0-9]{4}$" + }, + "MF": { + "redundantCharacters": " -", + "validationRegex": "^97150$" + }, + "MS": { + "redundantCharacters": " -", + "validationRegex": "^(MSR)?[0-9]{4}$" + }, + "MT": { + "redundantCharacters": " -", + "validationRegex": "^[A-Z]{3}[0-9]{4}$" + }, + "NC": { + "redundantCharacters": " -", + "validationRegex": "^988[0-9]{2}$" + }, + "NL": { + "redundantCharacters": " -", + "validationRegex": "^[1-9][0-9]{3}(?!SA|SD|SS)[A-Z]{2}$" + }, + "PF": { + "redundantCharacters": " -", + "validationRegex": "^987[0-9]{2}$" + }, + "PL": { + "redundantCharacters": " ", + "validationRegex": "^[0-9]{2}-[0-9]{3}$" + }, + "PM": { + "redundantCharacters": " -", + "validationRegex": "^97500$" + }, + "PN": { + "redundantCharacters": " -", + "validationRegex": "^PCRN1ZZ$" + }, + "PT": { + "redundantCharacters": " ", + "validationRegex": "^[0-9]{4}-[0-9]{3}$" + }, + "RE": { + "redundantCharacters": " -", + "validationRegex": "^974[0-9]{2}$" + }, + "RU": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{3}([0-9]{3})?$" + }, + "SH": { + "redundantCharacters": " -", + "validationRegex": "^STHL1ZZ$" + }, + "SM": { + "redundantCharacters": " -", + "validationRegex": "^4789[0-9]{1}$" + }, + "SO": { + "redundantCharacters": " -", + "validationRegex": "^[a-zA-Z]{2}[0-9]{5}$" + }, + "SZ": { + "redundantCharacters": " -", + "validationRegex": "^[a-zA-Z]{1}[0-9]{3}$" + }, + "TC": { + "redundantCharacters": " -", + "validationRegex": "^TKCA1ZZ$" + }, + "TW": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{3}([0-9]{2})?$" + }, + "US": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{5}([0-9]{4})?$" + }, + "VA": { + "redundantCharacters": " -", + "validationRegex": "^00120$" + }, + "VC": { + "redundantCharacters": " -", + "validationRegex": "^(VC)?[0-9]{4}$" + }, + "VE": { + "redundantCharacters": " -", + "validationRegex": "^[0-9]{4}[a-zA-Z]?$" + }, + "VG": { + "redundantCharacters": " -", + "validationRegex": "^(VG)?[0-9]{4}$" + }, + "WF": { + "redundantCharacters": " -", + "validationRegex": "^986[0-9]{2}$" + }, + "WS": { + "redundantCharacters": " -", + "validationRegex": "^(WS)?[0-9]{4}$" + } +} \ No newline at end of file diff --git a/data/lookup.json b/data/lookup.json new file mode 100644 index 0000000..7ad91b1 --- /dev/null +++ b/data/lookup.json @@ -0,0 +1,746 @@ +{ + "100": 22, + "104": 145, + "108": 24, + "112": 35, + "116": 116, + "120": 46, + "124": 37, + "132": 51, + "136": 123, + "140": 40, + "144": 129, + "148": 213, + "152": 45, + "156": 47, + "158": 226, + "162": 52, + "166": 38, + "170": 48, + "174": 118, + "175": 244, + "178": 41, + "180": 39, + "184": 44, + "188": 49, + "191": 96, + "192": 50, + "196": 53, + "203": 54, + "204": 25, + "208": 57, + "212": 58, + "214": 59, + "218": 61, + "222": 209, + "226": 86, + "231": 67, + "232": 65, + "233": 62, + "234": 72, + "238": 70, + "239": 88, + "242": 69, + "246": 68, + "248": 15, + "250": 73, + "254": 78, + "258": 174, + "260": 214, + "262": 56, + "266": 74, + "268": 77, + "270": 83, + "275": 182, + "276": 55, + "288": 80, + "292": 81, + "296": 117, + "300": 87, + "304": 82, + "308": 76, + "312": 85, + "316": 90, + "320": 89, + "324": 84, + "328": 92, + "332": 97, + "334": 94, + "336": 234, + "340": 95, + "344": 93, + "348": 98, + "352": 108, + "356": 104, + "360": 100, + "364": 107, + "368": 106, + "372": 101, + "376": 102, + "380": 109, + "384": 43, + "388": 111, + "392": 113, + "398": 124, + "400": 112, + "404": 114, + "408": 120, + "410": 121, + "414": 122, + "417": 115, + "418": 125, + "422": 126, + "426": 131, + "428": 134, + "430": 130, + "434": 135, + "438": 128, + "440": 132, + "442": 133, + "446": 147, + "450": 141, + "454": 155, + "458": 157, + "462": 154, + "466": 144, + "470": 152, + "474": 149, + "478": 150, + "480": 153, + "484": 156, + "492": 137, + "496": 146, + "498": 138, + "499": 139, + "500": 151, + "504": 136, + "508": 158, + "512": 171, + "516": 159, + "520": 168, + "524": 167, + "528": 165, + "530": 7, + "533": 14, + "540": 160, + "548": 240, + "554": 170, + "558": 164, + "562": 161, + "566": 163, + "570": 169, + "574": 162, + "578": 166, + "580": 148, + "581": 230, + "583": 71, + "584": 142, + "585": 184, + "586": 177, + "591": 172, + "598": 175, + "600": 185, + "604": 173, + "608": 176, + "612": 180, + "616": 178, + "620": 183, + "624": 91, + "626": 219, + "630": 181, + "634": 186, + "638": 187, + "642": 188, + "643": 190, + "646": 191, + "652": 26, + "654": 198, + "659": 119, + "660": 4, + "662": 127, + "663": 140, + "666": 179, + "670": 235, + "674": 203, + "678": 208, + "682": 192, + "686": 204, + "688": 189, + "690": 194, + "694": 202, + "702": 197, + "703": 201, + "704": 239, + "705": 199, + "706": 205, + "710": 245, + "716": 247, + "724": 66, + "728": 207, + "732": 64, + "736": 195, + "740": 206, + "744": 200, + "748": 211, + "752": 196, + "756": 42, + "760": 210, + "762": 217, + "764": 216, + "768": 215, + "772": 218, + "776": 222, + "780": 224, + "784": 1, + "788": 221, + "792": 223, + "795": 220, + "796": 212, + "798": 225, + "800": 229, + "804": 228, + "807": 143, + "818": 63, + "826": 75, + "831": 79, + "832": 110, + "833": 103, + "834": 227, + "840": 231, + "850": 238, + "854": 21, + "858": 232, + "860": 233, + "862": 236, + "876": 241, + "882": 242, + "887": 243, + "894": 246, + "AD": 0, + "AND": 0, + "020": 0, + "AE": 1, + "ARE": 1, + "AF": 2, + "AFG": 2, + "004": 2, + "AG": 3, + "ATG": 3, + "028": 3, + "AI": 4, + "AIA": 4, + "AL": 5, + "ALB": 5, + "008": 5, + "AM": 6, + "ARM": 6, + "051": 6, + "AN": 7, + "ANT": 7, + "AO": 8, + "AGO": 8, + "024": 8, + "AQ": 9, + "ATA": 9, + "010": 9, + "AR": 10, + "ARG": 10, + "032": 10, + "AS": 11, + "ASM": 11, + "016": 11, + "AT": 12, + "AUT": 12, + "040": 12, + "AU": 13, + "AUS": 13, + "036": 13, + "AW": 14, + "ABW": 14, + "AX": 15, + "ALA": 15, + "AZ": 16, + "AZE": 16, + "031": 16, + "BA": 17, + "BIH": 17, + "070": 17, + "BB": 18, + "BRB": 18, + "052": 18, + "BD": 19, + "BGD": 19, + "050": 19, + "BE": 20, + "BEL": 20, + "056": 20, + "BF": 21, + "BFA": 21, + "BG": 22, + "BGR": 22, + "BH": 23, + "BHR": 23, + "048": 23, + "BI": 24, + "BDI": 24, + "BJ": 25, + "BEN": 25, + "BL": 26, + "BLM": 26, + "BM": 27, + "BMU": 27, + "060": 27, + "BN": 28, + "BRN": 28, + "096": 28, + "BO": 29, + "BOL": 29, + "068": 29, + "BR": 30, + "BRA": 30, + "076": 30, + "BS": 31, + "BHS": 31, + "044": 31, + "BT": 32, + "BTN": 32, + "064": 32, + "BV": 33, + "BVT": 33, + "074": 33, + "BW": 34, + "BWA": 34, + "072": 34, + "BY": 35, + "BLR": 35, + "BZ": 36, + "BLZ": 36, + "084": 36, + "CA": 37, + "CAN": 37, + "CC": 38, + "CCK": 38, + "CD": 39, + "COD": 39, + "CF": 40, + "CAF": 40, + "CG": 41, + "COG": 41, + "CH": 42, + "CHE": 42, + "CI": 43, + "CIV": 43, + "CK": 44, + "COK": 44, + "CL": 45, + "CHL": 45, + "CM": 46, + "CMR": 46, + "CN": 47, + "CHN": 47, + "CO": 48, + "COL": 48, + "CR": 49, + "CRI": 49, + "CU": 50, + "CUB": 50, + "CV": 51, + "CPV": 51, + "CX": 52, + "CXR": 52, + "CY": 53, + "CYP": 53, + "CZ": 54, + "CZE": 54, + "DE": 55, + "DEU": 55, + "DJ": 56, + "DJI": 56, + "DK": 57, + "DNK": 57, + "DM": 58, + "DMA": 58, + "DO": 59, + "DOM": 59, + "DZ": 60, + "DZA": 60, + "012": 60, + "EC": 61, + "ECU": 61, + "EE": 62, + "EST": 62, + "EG": 63, + "EGY": 63, + "EH": 64, + "ESH": 64, + "ER": 65, + "ERI": 65, + "ES": 66, + "ESP": 66, + "ET": 67, + "ETH": 67, + "FI": 68, + "FIN": 68, + "FJ": 69, + "FJI": 69, + "FK": 70, + "FLK": 70, + "FM": 71, + "FSM": 71, + "FO": 72, + "FRO": 72, + "FR": 73, + "FRA": 73, + "GA": 74, + "GAB": 74, + "GB": 75, + "GBR": 75, + "GD": 76, + "GRD": 76, + "GE": 77, + "GEO": 77, + "GF": 78, + "GUF": 78, + "GG": 79, + "GGY": 79, + "GH": 80, + "GHA": 80, + "GI": 81, + "GIB": 81, + "GL": 82, + "GRL": 82, + "GM": 83, + "GMB": 83, + "GN": 84, + "GIN": 84, + "GP": 85, + "GLP": 85, + "GQ": 86, + "GNQ": 86, + "GR": 87, + "GRC": 87, + "GS": 88, + "SGS": 88, + "GT": 89, + "GTM": 89, + "GU": 90, + "GUM": 90, + "GW": 91, + "GNB": 91, + "GY": 92, + "GUY": 92, + "HK": 93, + "HKG": 93, + "HM": 94, + "HMD": 94, + "HN": 95, + "HND": 95, + "HR": 96, + "HRV": 96, + "HT": 97, + "HTI": 97, + "HU": 98, + "HUN": 98, + "IC": 99, + "": 99, + "000": 99, + "ID": 100, + "IDN": 100, + "IE": 101, + "IRL": 101, + "IL": 102, + "ISR": 102, + "IM": 103, + "IMN": 103, + "IN": 104, + "IND": 104, + "IO": 105, + "IOT": 105, + "086": 105, + "IQ": 106, + "IRQ": 106, + "IR": 107, + "IRN": 107, + "IS": 108, + "ISL": 108, + "IT": 109, + "ITA": 109, + "JE": 110, + "JEY": 110, + "JM": 111, + "JAM": 111, + "JO": 112, + "JOR": 112, + "JP": 113, + "JPN": 113, + "KE": 114, + "KEN": 114, + "KG": 115, + "KGZ": 115, + "KH": 116, + "KHM": 116, + "KI": 117, + "KIR": 117, + "KM": 118, + "COM": 118, + "KN": 119, + "KNA": 119, + "KP": 120, + "PRK": 120, + "KR": 121, + "KOR": 121, + "KW": 122, + "KWT": 122, + "KY": 123, + "CYM": 123, + "KZ": 124, + "KAZ": 124, + "LA": 125, + "LAO": 125, + "LB": 126, + "LBN": 126, + "LC": 127, + "LCA": 127, + "LI": 128, + "LIE": 128, + "LK": 129, + "LKA": 129, + "LR": 130, + "LBR": 130, + "LS": 131, + "LSO": 131, + "LT": 132, + "LTU": 132, + "LU": 133, + "LUX": 133, + "LV": 134, + "LVA": 134, + "LY": 135, + "LBY": 135, + "MA": 136, + "MAR": 136, + "MC": 137, + "MCO": 137, + "MD": 138, + "MDA": 138, + "ME": 139, + "MNE": 139, + "MF": 140, + "MAF": 140, + "MG": 141, + "MDG": 141, + "MH": 142, + "MHL": 142, + "MK": 143, + "MKD": 143, + "ML": 144, + "MLI": 144, + "MM": 145, + "MMR": 145, + "MN": 146, + "MNG": 146, + "MO": 147, + "MAC": 147, + "MP": 148, + "MNP": 148, + "MQ": 149, + "MTQ": 149, + "MR": 150, + "MRT": 150, + "MS": 151, + "MSR": 151, + "MT": 152, + "MLT": 152, + "MU": 153, + "MUS": 153, + "MV": 154, + "MDV": 154, + "MW": 155, + "MWI": 155, + "MX": 156, + "MEX": 156, + "MY": 157, + "MYS": 157, + "MZ": 158, + "MOZ": 158, + "NA": 159, + "NAM": 159, + "NC": 160, + "NCL": 160, + "NE": 161, + "NER": 161, + "NF": 162, + "NFK": 162, + "NG": 163, + "NGA": 163, + "NI": 164, + "NIC": 164, + "NL": 165, + "NLD": 165, + "NO": 166, + "NOR": 166, + "NP": 167, + "NPL": 167, + "NR": 168, + "NRU": 168, + "NU": 169, + "NIU": 169, + "NZ": 170, + "NZL": 170, + "OM": 171, + "OMN": 171, + "PA": 172, + "PAN": 172, + "PE": 173, + "PER": 173, + "PF": 174, + "PYF": 174, + "PG": 175, + "PNG": 175, + "PH": 176, + "PHL": 176, + "PK": 177, + "PAK": 177, + "PL": 178, + "POL": 178, + "PM": 179, + "SPM": 179, + "PN": 180, + "PCN": 180, + "PR": 181, + "PRI": 181, + "PS": 182, + "PSE": 182, + "PT": 183, + "PRT": 183, + "PW": 184, + "PLW": 184, + "PY": 185, + "PRY": 185, + "QA": 186, + "QAT": 186, + "RE": 187, + "REU": 187, + "RO": 188, + "ROU": 188, + "RS": 189, + "SRB": 189, + "RU": 190, + "RUS": 190, + "RW": 191, + "RWA": 191, + "SA": 192, + "SAU": 192, + "SB": 193, + "SLB": 193, + "090": 193, + "SC": 194, + "SYC": 194, + "SD": 195, + "SDN": 195, + "SE": 196, + "SWE": 196, + "SG": 197, + "SGP": 197, + "SH": 198, + "SHN": 198, + "SI": 199, + "SVN": 199, + "SJ": 200, + "SJM": 200, + "SK": 201, + "SVK": 201, + "SL": 202, + "SLE": 202, + "SM": 203, + "SMR": 203, + "SN": 204, + "SEN": 204, + "SO": 205, + "SOM": 205, + "SR": 206, + "SUR": 206, + "SS": 207, + "SSD": 207, + "ST": 208, + "STP": 208, + "SV": 209, + "SLV": 209, + "SY": 210, + "SYR": 210, + "SZ": 211, + "SWZ": 211, + "TC": 212, + "TCA": 212, + "TD": 213, + "TCD": 213, + "TF": 214, + "ATF": 214, + "TG": 215, + "TGO": 215, + "TH": 216, + "THA": 216, + "TJ": 217, + "TJK": 217, + "TK": 218, + "TKL": 218, + "TL": 219, + "TLS": 219, + "TM": 220, + "TKM": 220, + "TN": 221, + "TUN": 221, + "TO": 222, + "TON": 222, + "TR": 223, + "TUR": 223, + "TT": 224, + "TTO": 224, + "TV": 225, + "TUV": 225, + "TW": 226, + "TWN": 226, + "TZ": 227, + "TZA": 227, + "UA": 228, + "UKR": 228, + "UG": 229, + "UGA": 229, + "UM": 230, + "UMI": 230, + "US": 231, + "USA": 231, + "UY": 232, + "URY": 232, + "UZ": 233, + "UZB": 233, + "VA": 234, + "VAT": 234, + "VC": 235, + "VCT": 235, + "VE": 236, + "VEN": 236, + "VG": 237, + "VGB": 237, + "092": 237, + "VI": 238, + "VIR": 238, + "VN": 239, + "VNM": 239, + "VU": 240, + "VUT": 240, + "WF": 241, + "WLF": 241, + "WS": 242, + "WSM": 242, + "YE": 243, + "YEM": 243, + "YT": 244, + "MYT": 244, + "ZA": 245, + "ZAF": 245, + "ZM": 246, + "ZMB": 246, + "ZW": 247, + "ZWE": 247 +} \ No newline at end of file diff --git a/data/tests.json b/data/tests.json new file mode 100644 index 0000000..8d6b917 --- /dev/null +++ b/data/tests.json @@ -0,0 +1,752 @@ +{ + "10Digits": { + "valid": [ + "1234567890", + "5678567833" + ], + "invalid": [ + "12334545698", + "123s33s12", + "123456789" + ] + }, + "2Digits": { + "valid": [ + "12", + "56" + ], + "invalid": [ + "012", + "1s", + "1", + "x3" + ] + }, + "3Digits": { + "valid": [ + "123", + "567" + ], + "invalid": [ + "1234", + "13s", + "1x3" + ] + }, + "4Digits": { + "valid": [ + "1234", + "5678" + ], + "invalid": [ + "12345", + "123s", + "12x3" + ] + }, + "5Digits": { + "valid": [ + "12345", + "56785" + ], + "invalid": [ + "123456", + "1233s", + "123x3" + ] + }, + "6Digits": { + "valid": [ + "123456", + "567856" + ], + "invalid": [ + "1233456", + "123s3s", + "1s23x3" + ] + }, + "7Digits": { + "valid": [ + "1234567", + "5678567" + ], + "invalid": [ + "123345456", + "123s33s", + "1s23x3" + ] + }, + "8Digits": { + "valid": [ + "12345678", + "56785678" + ], + "invalid": [ + "123345456", + "123s33s", + "1s23x3" + ] + }, + "AD": { + "valid": [ + "AD123", + "AD001" + ], + "invalid": [ + "A1234", + "AD12", + "AD1234" + ] + }, + "AI": { + "valid": [ + "AI2640", + "AI-2640" + ], + "invalid": [ + "A2640", + "AI02640", + "AI-02640" + ] + }, + "AQ": { + "valid": [ + "BIQQ 1ZZ", + "BIQQ1ZZ" + ], + "invalid": [ + "BIQQ1Z", + "BIQQ01ZZ" + ] + }, + "AX": { + "valid": [ + "12345", + "AX-12345", + "AX12345" + ], + "invalid": [ + "AX123", + "A1234", + "AX-1234" + ] + }, + "AZ": { + "valid": [ + "AZ1234", + "AZ-1234" + ], + "invalid": [ + "AZ123", + "A1234", + "AZ-12345" + ] + }, + "BB": { + "valid": [ + "BB12345", + "12345" + ], + "invalid": [ + "x1231s", + "1231sd" + ] + }, + "BH": { + "valid": [ + "123", + "1234" + ], + "invalid": [ + "12", + "12345" + ] + }, + "BL": { + "valid": [ + "97133" + ], + "invalid": [ + "971330", + "9713" + ] + }, + "BN": { + "valid": [ + "AB1234", + "tK0987" + ], + "invalid": [ + "abc123", + "a12345", + "at123", + "BH12345" + ] + }, + "CA": { + "valid": [ + "A4B5X5", + "A4B5A5" + ], + "invalid": [ + "123AAA", + "12A5AA" + ] + }, + "DK": { + "valid": [ + "1124", + "DK1054", + "DK-1120", + "DK1120", + "DK 1125", + "DK - 1234", + "dk-1123" + ], + "invalid": [ + "1125DK", + "DK12345", + "DK123", + "123", + "" + ] + }, + "FK": { + "valid": [ + "FIQQ 1ZZ", + "FIQQ1ZZ" + ], + "invalid": [ + "FIQQ01ZZ", + "FIQQ1ZZZ" + ] + }, + "GB": { + "valid": [ + "CW3 9SS", + "SE5 0EG", + "SE50EG", + "WC2H 7LT", + "se5 0eg", + "Z29ZZ", + "Z699ZZ", + "ZX99ZZ", + "ZC999ZZ", + "EC1A 1BB", + "W1A 0AX", + "M1 1AE", + "B33 8TH", + "CR2 6XH", + "DN55 1PT", + "GIR 0AA", + "W1U 1BW", + "SK8 7NA" + ], + "invalid": [ + "WC2H 7LTa", + "WC2H" + ] + }, + "GF": { + "valid": [ + "97300", + "97390" + ], + "invalid": [ + "9732", + "973999", + "97290", + "097390" + ] + }, + "GG": { + "valid": [ + "GY1 1AA", + "GY111AA" + ], + "invalid": [ + "CW3 9SS", + "GG1 1AA", + "SE5 0EG", + "SE50EG", + "WC2H 7LTa", + "WC2H" + ] + }, + "GI": { + "valid": [ + "GX111AA", + "GX11 1AA" + ], + "invalid": [ + "GX1101AA", + "GX111AAA" + ] + }, + "GP": { + "valid": [ + "97100", + "97190" + ], + "invalid": [ + "9712", + "971999", + "97290", + "097190" + ] + }, + "GS": { + "valid": [ + "SIQQ 1ZZ", + "SIqq 1zz", + "SIQQ1ZZ" + ], + "invalid": [ + "SIQQ01ZZ", + "SIQQ1ZZZ" + ] + }, + "HN": { + "valid": [ + "HN12345", + "12345" + ], + "invalid": [ + "123456", + "HN123456", + "HN1234" + ] + }, + "IE": { + "valid": [ + "D6W1234", + "A23 0984", + "D00-AV92", + "y631fhk", + "a00 0000", + "d44-n4x4", + "A65F4E2" + ], + "invalid": [ + "D6Z1234", + "y63 1fhk" + ] + }, + "IM": { + "valid": [ + "IM1 1AA", + "IM111AA" + ], + "invalid": [ + "CW3 9SS", + "SE5 0EG", + "SE50EG", + "WC2H 7LTa", + "WC2H" + ] + }, + "IO": { + "valid": [ + "BBND 1ZZ", + "BBND1ZZ" + ], + "invalid": [ + "BBND01ZZ", + "BBND1ZZZ" + ] + }, + "JE": { + "valid": [ + "JE1 1AA", + "JE111AA" + ], + "invalid": [ + "CW3 9SS", + "SE5 0EG", + "SE50EG", + "WC2H 7LTa", + "WC2H" + ] + }, + "KY": { + "valid": [ + "KY1-1234", + "KY12345" + ], + "invalid": [ + "KY1234", + "KY123456", + "K1-1234" + ] + }, + "LB": { + "valid": [ + "1234", + "1234 1234", + "12341234" + ], + "invalid": [ + "123", + "1234567", + "123456789" + ] + }, + "LC": { + "valid": [ + "LC12 345", + "LC12345" + ], + "invalid": [ + "12345", + "x1231s", + "1231sd" + ] + }, + "LT": { + "valid": [ + "12345", + "LT12345", + "LT-12345" + ], + "invalid": [ + "1234", + "123456", + "LT-1234" + ] + }, + "LU": { + "valid": [ + "1124", + "L1054", + "L-1120", + "L1120", + "L 1125", + "L - 1234", + "l-1123" + ], + "invalid": [ + "1125L", + "L12345", + "L123", + "123", + "" + ] + }, + "LV": { + "valid": [ + "1234", + "LV-1234", + "LV1234" + ], + "invalid": [ + "LV123", + "L1234", + "LV-12345" + ] + }, + "MC": { + "valid": [ + "98000", + "98099" + ], + "invalid": [ + "98100", + "97099" + ] + }, + "MD": { + "valid": [ + "1234", + "MD1234", + "MD-1234" + ], + "invalid": [ + "MD123", + "M1234", + "MD-12345" + ] + }, + "MF": { + "valid": [ + "97150" + ], + "invalid": [ + "971500", + "9715" + ] + }, + "MS": { + "valid": [ + "MSR 1110", + "MSR 1350", + "1350" + ], + "invalid": [ + "MS1110", + "MSR01350", + "12345" + ] + }, + "MT": { + "valid": [ + "abc1234", + "ABC1234", + "SHD4783" + ], + "invalid": [ + "ABCABC", + "123ABCD" + ] + }, + "NC": { + "valid": [ + "98800", + "98890" + ], + "invalid": [ + "9882", + "988999", + "98990", + "098890" + ] + }, + "NL": { + "valid": [ + "1235DF", + "5983DH", + "1000 AP" + ], + "invalid": [ + "1235D", + "12j4h", + "k3j51l", + "1945SS" + ] + }, + "PF": { + "valid": [ + "98700", + "98790" + ], + "invalid": [ + "9872", + "987999", + "98690", + "098790" + ] + }, + "PL": { + "valid": [ + "44-100 ", + "44-100" + ], + "invalid": [ + "44100", + "44f00", + "e4410", + "44-100d", + "c44-100", + "b44100", + "44100a" + ] + }, + "PM": { + "valid": [ + "97500" + ], + "invalid": [ + "975000", + "9750" + ] + }, + "PN": { + "valid": [ + "PCRN 1ZZ", + "PCRN1ZZ" + ], + "invalid": [ + "PCRN01ZZ", + "PCRN1ZZZ" + ] + }, + "PT": { + "valid": [ + "1234-123" + ], + "invalid": [ + "1255", + "1234567", + "1234 123", + "x1231s", + "1231sd", + "1010101010", + "1234 12" + ] + }, + "RE": { + "valid": [ + "97400", + "97490" + ], + "invalid": [ + "9742", + "974999", + "97390", + "097490" + ] + }, + "RU": { + "valid": [ + "125", + "123456" + ], + "invalid": [ + "x1231s", + "1231sd", + "1010101010" + ] + }, + "SH": { + "valid": [ + "STHL 1ZZ", + "STHL1ZZ" + ], + "invalid": [ + "STHL01ZZ", + "STHL1ZZZ" + ] + }, + "SM": { + "valid": [ + "47890", + "47899" + ], + "invalid": [ + "4789", + "478900", + "47889" + ] + }, + "SO": { + "valid": [ + "AW12345", + "BN47899" + ], + "invalid": [ + "12345", + "A12345", + "SL123456" + ] + }, + "SZ": { + "valid": [ + "S123", + "a789" + ], + "invalid": [ + "F1234", + "D12" + ] + }, + "TC": { + "valid": [ + "TKCA1ZZ", + "TKCA 1ZZ" + ], + "invalid": [ + "TKCA01ZZ", + "TKCA1ZZZ" + ] + }, + "TW": { + "valid": [ + "123", + "123-45", + "12345" + ], + "invalid": [ + "12", + "1234", + "101010" + ] + }, + "US": { + "valid": [ + "12345", + "12345-7689" + ], + "invalid": [ + "x1231s", + "1231sd", + "1010101010" + ] + }, + "VA": { + "valid": [ + "00120" + ], + "invalid": [ + "0012", + "001200" + ] + }, + "VC": { + "valid": [ + "1234", + "VC1234", + "VC-1234" + ], + "invalid": [ + "VC123", + "V1234", + "VC-12345" + ] + }, + "VE": { + "valid": [ + "1234", + "1234-A" + ], + "invalid": [ + "123", + "1234AA" + ] + }, + "VG": { + "valid": [ + "1234", + "VG1234", + "VG-1234" + ], + "invalid": [ + "VG123", + "V1234", + "VG-12345" + ] + }, + "WF": { + "valid": [ + "98600", + "98690" + ], + "invalid": [ + "9862", + "986999", + "98990", + "098690" + ] + }, + "WS": { + "valid": [ + "1234", + "WS1234", + "WS-1234" + ], + "invalid": [ + "WS123", + "V1234", + "WS-12345" + ] + } +} \ No newline at end of file diff --git a/formats-node.js b/formats-node.js deleted file mode 100644 index 5840e38..0000000 --- a/formats-node.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -const path = require('path'); - -module.exports = function getFormat(postalCodeFormat) { - //use eval(require) to workaround webpack which can't require dynamic path - return eval('require')(path.join(__dirname, 'formats', postalCodeFormat)); -}; \ No newline at end of file diff --git a/formats-web.js b/formats-web.js deleted file mode 100644 index aa264f0..0000000 --- a/formats-web.js +++ /dev/null @@ -1,73 +0,0 @@ -'use strict'; - -const formats = {}; - -formats["10Digits.json"] = require("./formats/10Digits.json"); -formats["2Digits.json"] = require("./formats/2Digits.json"); -formats["3Digits.json"] = require("./formats/3Digits.json"); -formats["4Digits.json"] = require("./formats/4Digits.json"); -formats["5Digits.json"] = require("./formats/5Digits.json"); -formats["6Digits.json"] = require("./formats/6Digits.json"); -formats["7Digits.json"] = require("./formats/7Digits.json"); -formats["8Digits.json"] = require("./formats/8Digits.json"); -formats["AD.json"] = require("./formats/AD.json"); -formats["AI.json"] = require("./formats/AI.json"); -formats["AQ.json"] = require("./formats/AQ.json"); -formats["AX.json"] = require("./formats/AX.json"); -formats["AZ.json"] = require("./formats/AZ.json"); -formats["BB.json"] = require("./formats/BB.json"); -formats["BH.json"] = require("./formats/BH.json"); -formats["BL.json"] = require("./formats/BL.json"); -formats["BN.json"] = require("./formats/BN.json"); -formats["CA.json"] = require("./formats/CA.json"); -formats["DK.json"] = require("./formats/DK.json"); -formats["FK.json"] = require("./formats/FK.json"); -formats["GB.json"] = require("./formats/GB.json"); -formats["GF.json"] = require("./formats/GF.json"); -formats["GG.json"] = require("./formats/GG.json"); -formats["GI.json"] = require("./formats/GI.json"); -formats["GP.json"] = require("./formats/GP.json"); -formats["GS.json"] = require("./formats/GS.json"); -formats["HN.json"] = require("./formats/HN.json"); -formats["IE.json"] = require("./formats/IE.json"); -formats["IM.json"] = require("./formats/IM.json"); -formats["IO.json"] = require("./formats/IO.json"); -formats["JE.json"] = require("./formats/JE.json"); -formats["KY.json"] = require("./formats/KY.json"); -formats["LB.json"] = require("./formats/LB.json"); -formats["LC.json"] = require("./formats/LC.json"); -formats["LT.json"] = require("./formats/LT.json"); -formats["LU.json"] = require("./formats/LU.json"); -formats["LV.json"] = require("./formats/LV.json"); -formats["MC.json"] = require("./formats/MC.json"); -formats["MD.json"] = require("./formats/MD.json"); -formats["MF.json"] = require("./formats/MF.json"); -formats["MS.json"] = require("./formats/MS.json"); -formats["MT.json"] = require("./formats/MT.json"); -formats["NC.json"] = require("./formats/NC.json"); -formats["NL.json"] = require("./formats/NL.json"); -formats["PF.json"] = require("./formats/PF.json"); -formats["PL.json"] = require("./formats/PL.json"); -formats["PM.json"] = require("./formats/PM.json"); -formats["PN.json"] = require("./formats/PN.json"); -formats["PT.json"] = require("./formats/PT.json"); -formats["RE.json"] = require("./formats/RE.json"); -formats["RU.json"] = require("./formats/RU.json"); -formats["SH.json"] = require("./formats/SH.json"); -formats["SM.json"] = require("./formats/SM.json"); -formats["SO.json"] = require("./formats/SO.json"); -formats["SZ.json"] = require("./formats/SZ.json"); -formats["TC.json"] = require("./formats/TC.json"); -formats["TW.json"] = require("./formats/TW.json"); -formats["US.json"] = require("./formats/US.json"); -formats["VA.json"] = require("./formats/VA.json"); -formats["VC.json"] = require("./formats/VC.json"); -formats["VE.json"] = require("./formats/VE.json"); -formats["VG.json"] = require("./formats/VG.json"); -formats["WF.json"] = require("./formats/WF.json"); -formats["WS.json"] = require("./formats/WS.json"); - - -module.exports = function getFormat(postalCodeFormat) { - return formats[postalCodeFormat]; -}; \ No newline at end of file diff --git a/formats/10Digits.json b/formats/10Digits.json deleted file mode 100644 index 761aa88..0000000 --- a/formats/10Digits.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "10-Digits - NNNNNNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{10}$", - "TestData": { - "Valid": [ - "1234567890", - "5678567833" - ], - "Invalid": [ - "12334545698", - "123s33s12", - "123456789" - ] - } -} diff --git a/formats/2Digits.json b/formats/2Digits.json deleted file mode 100644 index 3927aad..0000000 --- a/formats/2Digits.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "2-Digits - NN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{2}$", - "TestData": { - "Valid": [ - "12", - "56" - ], - "Invalid": [ - "012", - "1s", - "1", - "x3" - ] - } -} diff --git a/formats/3Digits.json b/formats/3Digits.json deleted file mode 100644 index 0e6888c..0000000 --- a/formats/3Digits.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "3-Digits - NNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{3}$", - "TestData": { - "Valid": [ - "123", - "567" - ], - "Invalid": [ - "1234", - "13s", - "1x3" - ] - } -} diff --git a/formats/4Digits.json b/formats/4Digits.json deleted file mode 100644 index eddfb32..0000000 --- a/formats/4Digits.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "4-Digits - NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "5678" - ], - "Invalid": [ - "12345", - "123s", - "12x3" - ] - } -} diff --git a/formats/5Digits.json b/formats/5Digits.json deleted file mode 100644 index 9c42489..0000000 --- a/formats/5Digits.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "5-Digits - NNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{5}$", - "TestData": { - "Valid": [ - "12345", - "56785" - ], - "Invalid": [ - "123456", - "1233s", - "123x3" - ] - } -} diff --git a/formats/6Digits.json b/formats/6Digits.json deleted file mode 100644 index a08dc7f..0000000 --- a/formats/6Digits.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "6-Digits - NNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{6}$", - "TestData": { - "Valid": [ - "123456", - "567856" - ], - "Invalid": [ - "1233456", - "123s3s", - "1s23x3" - ] - } -} diff --git a/formats/7Digits.json b/formats/7Digits.json deleted file mode 100644 index 71fb36b..0000000 --- a/formats/7Digits.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "7-Digits - NNNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{7}$", - "TestData": { - "Valid": [ - "1234567", - "5678567" - ], - "Invalid": [ - "123345456", - "123s33s", - "1s23x3" - ] - } -} diff --git a/formats/8Digits.json b/formats/8Digits.json deleted file mode 100644 index bce644e..0000000 --- a/formats/8Digits.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "8-Digits - NNNNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{8}$", - "TestData": { - "Valid": [ - "12345678", - "56785678" - ], - "Invalid": [ - "123345456", - "123s33s", - "1s23x3" - ] - } -} diff --git a/formats/AD.json b/formats/AD.json deleted file mode 100644 index 54e7327..0000000 --- a/formats/AD.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "AD : CCNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^AD[0-9]{3}$", - "TestData": { - "Valid": [ - "AD123", - "AD001" - ], - "Invalid": [ - "A1234", - "AD12", - "AD1234" - ] - } -} \ No newline at end of file diff --git a/formats/AI.json b/formats/AI.json deleted file mode 100644 index f6d71fb..0000000 --- a/formats/AI.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "AI : CC2640", - "RedundantCharacters": " -", - "ValidationRegex": "^AI2640$", - "TestData": { - "Valid": [ - "AI2640", - "AI-2640" - ], - "Invalid": [ - "A2640", - "AI02640", - "AI-02640" - ] - } -} \ No newline at end of file diff --git a/formats/AQ.json b/formats/AQ.json deleted file mode 100644 index aab5c36..0000000 --- a/formats/AQ.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "AQ : BIQQ 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^BIQQ1ZZ$", - "TestData": { - "Valid": [ - "BIQQ 1ZZ", - "BIQQ1ZZ" - ], - "Invalid": [ - "BIQQ1Z", - "BIQQ01ZZ" - ] - } -} \ No newline at end of file diff --git a/formats/AX.json b/formats/AX.json deleted file mode 100644 index 2e9fd21..0000000 --- a/formats/AX.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "AX : NNNNN, CC-NNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(AX)?[0-9]{5}$", - "TestData": { - "Valid": [ - "12345", - "AX-12345", - "AX12345" - ], - "Invalid": [ - "AX123", - "A1234", - "AX-1234" - ] - } -} \ No newline at end of file diff --git a/formats/AZ.json b/formats/AZ.json deleted file mode 100644 index 3d685f8..0000000 --- a/formats/AZ.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "AZ : CCNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^AZ[0-9]{4}$", - "TestData": { - "Valid": [ - "AZ1234", - "AZ-1234" - ], - "Invalid": [ - "AZ123", - "A1234", - "AZ-12345" - ] - } -} \ No newline at end of file diff --git a/formats/BB.json b/formats/BB.json deleted file mode 100644 index eabb63a..0000000 --- a/formats/BB.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "BB : CCNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(BB)?[0-9]{5}$", - "TestData": { - "Valid": [ - "BB12345", - "12345" - ], - "Invalid": [ - "x1231s", - "1231sd" - ] - } -} \ No newline at end of file diff --git a/formats/BH.json b/formats/BH.json deleted file mode 100644 index 78954a6..0000000 --- a/formats/BH.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "BH : NNN, NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{3,4}$", - "TestData": { - "Valid": [ - "123", - "1234" - ], - "Invalid": [ - "12", - "12345" - ] - } -} \ No newline at end of file diff --git a/formats/BL.json b/formats/BL.json deleted file mode 100644 index 860c67c..0000000 --- a/formats/BL.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Description": "BL : 97133", - "RedundantCharacters": " -", - "ValidationRegex": "^97133$", - "TestData": { - "Valid": [ - "97133" - ], - "Invalid": [ - "971330", - "9713" - ] - } -} \ No newline at end of file diff --git a/formats/BN.json b/formats/BN.json deleted file mode 100644 index d42f937..0000000 --- a/formats/BN.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "BN : LLNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[a-zA-Z]{2}[0-9]{4}$", - "TestData": { - "Valid": [ - "AB1234", - "tK0987" - ], - "Invalid": [ - "abc123", - "a12345", - "at123", - "BH12345" - ] - } -} \ No newline at end of file diff --git a/formats/CA.json b/formats/CA.json deleted file mode 100644 index 887be62..0000000 --- a/formats/CA.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "CA : A0A 0A0", - "RedundantCharacters": " -", - "ValidationRegex": "^[ABCEGHJKLMNPRSTVXY]\\d[ABCEGHJ-NPRSTV-Z][\\s\\-]?\\d[ABCEGHJ-NPRSTV-Z]\\d$", - "TestData": { - "Valid": [ - "A4B5X5", - "A4B5A5" - ], - "Invalid": [ - "123AAA", - "12A5AA" - ] - } -} \ No newline at end of file diff --git a/formats/DK.json b/formats/DK.json deleted file mode 100644 index f00b853..0000000 --- a/formats/DK.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "Description": "DK", - "RedundantCharacters": " -", - "ValidationRegex": "^(DK){0,1}\\d{4}$", - "TestData": { - "Valid": [ - "1124", - "DK1054", - "DK-1120", - "DK1120", - "DK 1125", - "DK - 1234", - "dk-1123" - ], - "Invalid": [ - "1125DK", - "DK12345", - "DK123", - "123", - "" - ] - } -} \ No newline at end of file diff --git a/formats/FK.json b/formats/FK.json deleted file mode 100644 index 5d3cd5e..0000000 --- a/formats/FK.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "FK : FIQQ 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^FIQQ1ZZ$", - "TestData": { - "Valid": [ - "FIQQ 1ZZ", - "FIQQ1ZZ" - ], - "Invalid": [ - "FIQQ01ZZ", - "FIQQ1ZZZ" - ] - } -} \ No newline at end of file diff --git a/formats/GB.json b/formats/GB.json deleted file mode 100644 index 9900e95..0000000 --- a/formats/GB.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "Description": "GB", - "RedundantCharacters": " -", - "ValidationRegex": "((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([AZa-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))[0-9][A-Za-z]{2})|GIR0AA", - "ValidationRegex.DOC": "https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/488478/Bulk_Data_Transfer_-_additional_validation_valid_from_12_November_2015.pdf", - "TestData": { - "Valid": [ - "CW3 9SS", - "SE5 0EG", - "SE50EG", - "WC2H 7LT", - "se5 0eg", - "Z29ZZ", - "Z699ZZ", - "ZX99ZZ", - "ZC999ZZ", - "EC1A 1BB", - "W1A 0AX", - "M1 1AE", - "B33 8TH", - "CR2 6XH", - "DN55 1PT", - "GIR 0AA", - "W1U 1BW", - "SK8 7NA" - ], - "Invalid": [ - "WC2H 7LTa", - "WC2H" - ] - } -} \ No newline at end of file diff --git a/formats/GF.json b/formats/GF.json deleted file mode 100644 index 6564713..0000000 --- a/formats/GF.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "GF : 973NN", - "RedundantCharacters": " -", - "ValidationRegex": "^973[0-9]{2}$", - "TestData": { - "Valid": [ - "97300", - "97390" - ], - "Invalid": [ - "9732", - "973999", - "97290", - "097390" - ] - } -} \ No newline at end of file diff --git a/formats/GG.json b/formats/GG.json deleted file mode 100644 index d40c9d8..0000000 --- a/formats/GG.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "Description": "GG", - "RedundantCharacters": " -", - "ValidationRegex": "^GY[0-9]{2,3}[A-Za-z]{2}$", - "TestData": { - "Valid": [ - "GY1 1AA", - "GY111AA" - ], - "Invalid": [ - "CW3 9SS", - "GG1 1AA", - "SE5 0EG", - "SE50EG", - "WC2H 7LTa", - "WC2H" - ] - } -} \ No newline at end of file diff --git a/formats/GI.json b/formats/GI.json deleted file mode 100644 index d915b6b..0000000 --- a/formats/GI.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "GI : GX11 1AA", - "RedundantCharacters": " -", - "ValidationRegex": "^GX111AA$", - "TestData": { - "Valid": [ - "GX111AA", - "GX11 1AA" - ], - "Invalid": [ - "GX1101AA", - "GX111AAA" - ] - } -} \ No newline at end of file diff --git a/formats/GP.json b/formats/GP.json deleted file mode 100644 index af81abc..0000000 --- a/formats/GP.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "GP : 971NN", - "RedundantCharacters": " -", - "ValidationRegex": "^971[0-9]{2}$", - "TestData": { - "Valid": [ - "97100", - "97190" - ], - "Invalid": [ - "9712", - "971999", - "97290", - "097190" - ] - } -} \ No newline at end of file diff --git a/formats/GS.json b/formats/GS.json deleted file mode 100644 index a7d4063..0000000 --- a/formats/GS.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "GS : SIQQ 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^SIQQ1ZZ$", - "TestData": { - "Valid": [ - "SIQQ 1ZZ", - "SIqq 1zz", - "SIQQ1ZZ" - ], - "Invalid": [ - "SIQQ01ZZ", - "SIQQ1ZZZ" - ] - } -} \ No newline at end of file diff --git a/formats/HN.json b/formats/HN.json deleted file mode 100644 index 1a175f3..0000000 --- a/formats/HN.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "HN : CCNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(HN)?[0-9]{5}$", - "TestData": { - "Valid": [ - "HN12345", - "12345" - ], - "Invalid": [ - "123456", - "HN123456", - "HN1234" - ] - } -} \ No newline at end of file diff --git a/formats/IE.json b/formats/IE.json deleted file mode 100644 index f073ef7..0000000 --- a/formats/IE.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Description": "IE", - "RedundantCharacters": "", - "ValidationRegex": "^[AaC-Fc-fHhKkNnPpRrTtV-Yv-y]\\d[0-9Ww][ -]?[0-9AaC-Fc-fHhKkNnPpRrTtV-Yv-y]{4}$", - "ValidationRegex.DOC": "https://www.eircode.ie/docs/default-source/Common/prepareyourbusinessforeircode-edition3published.pdf?sfvrsn=2", - "TestData": { - "Valid": [ - "D6W1234", - "A23 0984", - "D00-AV92", - "y631fhk", - "a00 0000", - "d44-n4x4", - "A65F4E2" - ], - "Invalid": ["D6Z1234", "y63 1fhk"] - } -} diff --git a/formats/IM.json b/formats/IM.json deleted file mode 100644 index fc1a0b2..0000000 --- a/formats/IM.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Description": "IM", - "RedundantCharacters": " -", - "ValidationRegex": "^IM[0-9]{2,3}[A-Za-z]{2}$", - "TestData": { - "Valid": [ - "IM1 1AA", - "IM111AA" - ], - "Invalid": [ - "CW3 9SS", - "SE5 0EG", - "SE50EG", - "WC2H 7LTa", - "WC2H" - ] - } -} \ No newline at end of file diff --git a/formats/IO.json b/formats/IO.json deleted file mode 100644 index 84807c9..0000000 --- a/formats/IO.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "IO : BBND 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^BBND1ZZ$", - "TestData": { - "Valid": [ - "BBND 1ZZ", - "BBND1ZZ" - ], - "Invalid": [ - "BBND01ZZ", - "BBND1ZZZ" - ] - } -} \ No newline at end of file diff --git a/formats/JE.json b/formats/JE.json deleted file mode 100644 index 509ac0f..0000000 --- a/formats/JE.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Description": "JE", - "RedundantCharacters": " -", - "ValidationRegex": "^JE[0-9]{2,3}[A-Za-z]{2}$", - "TestData": { - "Valid": [ - "JE1 1AA", - "JE111AA" - ], - "Invalid": [ - "CW3 9SS", - "SE5 0EG", - "SE50EG", - "WC2H 7LTa", - "WC2H" - ] - } -} \ No newline at end of file diff --git a/formats/KY.json b/formats/KY.json deleted file mode 100644 index dd217ca..0000000 --- a/formats/KY.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "KY : CCN-NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^KY[0-9]{5}$", - "TestData": { - "Valid": [ - "KY1-1234", - "KY12345" - ], - "Invalid": [ - "KY1234", - "KY123456", - "K1-1234" - ] - } -} \ No newline at end of file diff --git a/formats/LB.json b/formats/LB.json deleted file mode 100644 index 67de913..0000000 --- a/formats/LB.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "LB : NNNNN, NNNN NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{4}(?:[0-9]{4})?$", - "TestData": { - "Valid": [ - "1234", - "1234 1234", - "12341234" - ], - "Invalid": [ - "123", - "1234567", - "123456789" - ] - } -} \ No newline at end of file diff --git a/formats/LC.json b/formats/LC.json deleted file mode 100644 index fdd8708..0000000 --- a/formats/LC.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "LC : CCNN NNN", - "RedundantCharacters": " -", - "ValidationRegex": "^LC[0-9]{5}$", - "TestData": { - "Valid": [ - "LC12 345", - "LC12345" - ], - "Invalid": [ - "12345", - "x1231s", - "1231sd" - ] - } -} \ No newline at end of file diff --git a/formats/LT.json b/formats/LT.json deleted file mode 100644 index 9fcc953..0000000 --- a/formats/LT.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "LT : LT-NNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(LT)?[0-9]{5}$", - "TestData": { - "Valid": [ - "12345", - "LT12345", - "LT-12345" - ], - "Invalid": [ - "1234", - "123456", - "LT-1234" - ] - } -} \ No newline at end of file diff --git a/formats/LU.json b/formats/LU.json deleted file mode 100644 index 1c533e0..0000000 --- a/formats/LU.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "Description": "LU", - "RedundantCharacters": " -", - "ValidationRegex": "^(L){0,1}\\d{4}$", - "TestData": { - "Valid": [ - "1124", - "L1054", - "L-1120", - "L1120", - "L 1125", - "L - 1234", - "l-1123" - ], - "Invalid": [ - "1125L", - "L12345", - "L123", - "123", - "" - ] - } -} \ No newline at end of file diff --git a/formats/LV.json b/formats/LV.json deleted file mode 100644 index 755ab1e..0000000 --- a/formats/LV.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "LV : NNNNN, CC-NNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(LV)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "LV-1234", - "LV1234" - ], - "Invalid": [ - "LV123", - "L1234", - "LV-12345" - ] - } -} \ No newline at end of file diff --git a/formats/MC.json b/formats/MC.json deleted file mode 100644 index 9d2e2fd..0000000 --- a/formats/MC.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "MC : 980NN", - "RedundantCharacters": " -", - "ValidationRegex": "^980[0-9]{2}$", - "TestData": { - "Valid": [ - "98000", - "98099" - ], - "Invalid": [ - "98100", - "97099" - ] - } -} diff --git a/formats/MD.json b/formats/MD.json deleted file mode 100644 index eb6eb78..0000000 --- a/formats/MD.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "MD : CCNNNN, CC-NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(MD)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "MD1234", - "MD-1234" - ], - "Invalid": [ - "MD123", - "M1234", - "MD-12345" - ] - } -} \ No newline at end of file diff --git a/formats/MF.json b/formats/MF.json deleted file mode 100644 index fd7fab5..0000000 --- a/formats/MF.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Description": "MF : 97150", - "RedundantCharacters": " -", - "ValidationRegex": "^97150$", - "TestData": { - "Valid": [ - "97150" - ], - "Invalid": [ - "971500", - "9715" - ] - } -} \ No newline at end of file diff --git a/formats/MS.json b/formats/MS.json deleted file mode 100644 index c8750ab..0000000 --- a/formats/MS.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "MS : MSR NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(MSR)?[0-9]{4}$", - "TestData": { - "Valid": [ - "MSR 1110", - "MSR 1350", - "1350" - ], - "Invalid": [ - "MS1110", - "MSR01350", - "12345" - ] - } -} \ No newline at end of file diff --git a/formats/MT.json b/formats/MT.json deleted file mode 100644 index 5ceb493..0000000 --- a/formats/MT.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "MA : LLL NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[A-Z]{3}[0-9]{4}$", - "TestData": { - "Valid": [ - "abc1234", - "ABC1234", - "SHD4783" - ], - "Invalid": [ - "ABCABC", - "123ABCD" - ] - } -} \ No newline at end of file diff --git a/formats/NC.json b/formats/NC.json deleted file mode 100644 index 821056a..0000000 --- a/formats/NC.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "NC : 988NN", - "RedundantCharacters": " -", - "ValidationRegex": "^988[0-9]{2}$", - "TestData": { - "Valid": [ - "98800", - "98890" - ], - "Invalid": [ - "9882", - "988999", - "98990", - "098890" - ] - } -} \ No newline at end of file diff --git a/formats/NL.json b/formats/NL.json deleted file mode 100644 index 009c7f8..0000000 --- a/formats/NL.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "Description": "NL : NNNN LL", - "RedundantCharacters": " -", - "ValidationRegex": "^[1-9][0-9]{3}(?!SA|SD|SS)[A-Z]{2}$", - "TestData": { - "Valid": [ - "1235DF", - "5983DH", - "1000 AP" - ], - "Invalid": [ - "1235D", - "12j4h", - "k3j51l", - "1945SS" - ] - } -} \ No newline at end of file diff --git a/formats/PF.json b/formats/PF.json deleted file mode 100644 index d377477..0000000 --- a/formats/PF.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "PF : 987NN", - "RedundantCharacters": " -", - "ValidationRegex": "^987[0-9]{2}$", - "TestData": { - "Valid": [ - "98700", - "98790" - ], - "Invalid": [ - "9872", - "987999", - "98690", - "098790" - ] - } -} \ No newline at end of file diff --git a/formats/PL.json b/formats/PL.json deleted file mode 100644 index 9ca0206..0000000 --- a/formats/PL.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "Description": "PL : 99-999", - "RedundantCharacters": " ", - "ValidationRegex": "^[0-9]{2}-[0-9]{3}$", - "TestData": { - "Valid": [ - "44-100 ", - "44-100" - ], - "Invalid": [ - "44100", - "44f00", - "e4410", - "44-100d", - "c44-100", - "b44100", - "44100a" - ] - } -} diff --git a/formats/PM.json b/formats/PM.json deleted file mode 100644 index 889aa33..0000000 --- a/formats/PM.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Description": "PM : 97500", - "RedundantCharacters": " -", - "ValidationRegex": "^97500$", - "TestData": { - "Valid": [ - "97500" - ], - "Invalid": [ - "975000", - "9750" - ] - } -} \ No newline at end of file diff --git a/formats/PN.json b/formats/PN.json deleted file mode 100644 index af8415d..0000000 --- a/formats/PN.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "PN : PCRN 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^PCRN1ZZ$", - "TestData": { - "Valid": [ - "PCRN 1ZZ", - "PCRN1ZZ" - ], - "Invalid": [ - "PCRN01ZZ", - "PCRN1ZZZ" - ] - } -} \ No newline at end of file diff --git a/formats/PT.json b/formats/PT.json deleted file mode 100644 index 1b7a340..0000000 --- a/formats/PT.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "Description": "PT : NNNN-NNN", - "RedundantCharacters": " ", - "ValidationRegex": "^[0-9]{4}-[0-9]{3}$", - "TestData": { - "Valid": [ - "1234-123" - ], - "Invalid": [ - "1255", - "1234567", - "1234 123", - "x1231s", - "1231sd", - "1010101010", - "1234 12" - ] - } -} diff --git a/formats/RE.json b/formats/RE.json deleted file mode 100644 index 66d8ece..0000000 --- a/formats/RE.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "RE : 974NN", - "RedundantCharacters": " -", - "ValidationRegex": "^974[0-9]{2}$", - "TestData": { - "Valid": [ - "97400", - "97490" - ], - "Invalid": [ - "9742", - "974999", - "97390", - "097490" - ] - } -} \ No newline at end of file diff --git a/formats/RU.json b/formats/RU.json deleted file mode 100644 index 9456709..0000000 --- a/formats/RU.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "RU : NNN[-NNN]", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{3}([0-9]{3})?$", - "TestData": { - "Valid": [ - "125", - "123456" - ], - "Invalid": [ - "x1231s", - "1231sd", - "1010101010" - ] - } -} \ No newline at end of file diff --git a/formats/SH.json b/formats/SH.json deleted file mode 100644 index ecea8b5..0000000 --- a/formats/SH.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "SH : STHL 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^STHL1ZZ$", - "TestData": { - "Valid": [ - "STHL 1ZZ", - "STHL1ZZ" - ], - "Invalid": [ - "STHL01ZZ", - "STHL1ZZZ" - ] - } -} \ No newline at end of file diff --git a/formats/SM.json b/formats/SM.json deleted file mode 100644 index 0d4d375..0000000 --- a/formats/SM.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "SM : 4789N", - "RedundantCharacters": " -", - "ValidationRegex": "^4789[0-9]{1}$", - "TestData": { - "Valid": [ - "47890", - "47899" - ], - "Invalid": [ - "4789", - "478900", - "47889" - ] - } -} \ No newline at end of file diff --git a/formats/SO.json b/formats/SO.json deleted file mode 100644 index 3d0d0cb..0000000 --- a/formats/SO.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "SO : AA NNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[a-zA-Z]{2}[0-9]{5}$", - "TestData": { - "Valid": [ - "AW12345", - "BN47899" - ], - "Invalid": [ - "12345", - "A12345", - "SL123456" - ] - } -} \ No newline at end of file diff --git a/formats/SZ.json b/formats/SZ.json deleted file mode 100644 index 8c18813..0000000 --- a/formats/SZ.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "SZ : ANNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[a-zA-Z]{1}[0-9]{3}$", - "TestData": { - "Valid": [ - "S123", - "a789" - ], - "Invalid": [ - "F1234", - "D12" - ] - } -} \ No newline at end of file diff --git a/formats/TC.json b/formats/TC.json deleted file mode 100644 index 4ef268b..0000000 --- a/formats/TC.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "TC : TKCA 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^TKCA1ZZ$", - "TestData": { - "Valid": [ - "TKCA1ZZ", - "TKCA 1ZZ" - ], - "Invalid": [ - "TKCA01ZZ", - "TKCA1ZZZ" - ] - } -} \ No newline at end of file diff --git a/formats/TW.json b/formats/TW.json deleted file mode 100644 index 5132162..0000000 --- a/formats/TW.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "TW : NNN[-NN]", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{3}([0-9]{2})?$", - "TestData": { - "Valid": [ - "123", - "123-45", - "12345" - ], - "Invalid": [ - "12", - "1234", - "101010" - ] - } -} diff --git a/formats/US.json b/formats/US.json deleted file mode 100644 index aef04c9..0000000 --- a/formats/US.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "Description": "US : NNNNN[-NNNN]", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{5}([0-9]{4})?$", - "TestData": { - "Valid": [ - "12345", - "12345-7689" - ], - "Invalid": [ - "x1231s", - "1231sd", - "1010101010" - ] - } -} diff --git a/formats/VA.json b/formats/VA.json deleted file mode 100644 index 51a6dc8..0000000 --- a/formats/VA.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "Description": "VA : 00120", - "RedundantCharacters": " -", - "ValidationRegex": "^00120$", - "TestData": { - "Valid": [ - "00120" - ], - "Invalid": [ - "0012", - "001200" - ] - } -} \ No newline at end of file diff --git a/formats/VC.json b/formats/VC.json deleted file mode 100644 index 02bb7de..0000000 --- a/formats/VC.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "VC : CCNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(VC)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "VC1234", - "VC-1234" - ], - "Invalid": [ - "VC123", - "V1234", - "VC-12345" - ] - } -} \ No newline at end of file diff --git a/formats/VE.json b/formats/VE.json deleted file mode 100644 index 876250b..0000000 --- a/formats/VE.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Description": "VE : NNNN, NNNN-A", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{4}[a-zA-Z]?$", - "TestData": { - "Valid": [ - "1234", - "1234-A" - ], - "Invalid": [ - "123", - "1234AA" - ] - } -} \ No newline at end of file diff --git a/formats/VG.json b/formats/VG.json deleted file mode 100644 index 42c0cdf..0000000 --- a/formats/VG.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "VG : CCNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(VG)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "VG1234", - "VG-1234" - ], - "Invalid": [ - "VG123", - "V1234", - "VG-12345" - ] - } -} diff --git a/formats/WF.json b/formats/WF.json deleted file mode 100644 index f966b4a..0000000 --- a/formats/WF.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "WF : 986NN", - "RedundantCharacters": " -", - "ValidationRegex": "^986[0-9]{2}$", - "TestData": { - "Valid": [ - "98600", - "98690" - ], - "Invalid": [ - "9862", - "986999", - "98990", - "098690" - ] - } -} \ No newline at end of file diff --git a/formats/WS.json b/formats/WS.json deleted file mode 100644 index dd605df..0000000 --- a/formats/WS.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Description": "WS : CCNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(WS)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "WS1234", - "WS-1234" - ], - "Invalid": [ - "WS123", - "V1234", - "WS-12345" - ] - } -} \ No newline at end of file diff --git a/generated/postal-codes-alpha2.json b/generated/postal-codes-alpha2.json deleted file mode 100644 index 3d3f98c..0000000 --- a/generated/postal-codes-alpha2.json +++ /dev/null @@ -1,1677 +0,0 @@ -{ - "AF": { - "countryName": "Afghanistan", - "postalCodeFormat": "4Digits.json", - "alpha2": "AF", - "alpha3": "AFG", - "numeric3": "4" - }, - "AX": { - "countryName": "Aland Islands", - "postalCodeFormat": "AX.json", - "alpha2": "AX", - "alpha3": "ALA", - "numeric3": "248" - }, - "AL": { - "countryName": "Albania", - "postalCodeFormat": "4Digits.json", - "alpha2": "AL", - "alpha3": "ALB", - "numeric3": "8" - }, - "DZ": { - "countryName": "Algeria", - "postalCodeFormat": "5Digits.json", - "alpha2": "DZ", - "alpha3": "DZA", - "numeric3": "12" - }, - "AS": { - "countryName": "American Samoa", - "postalCodeFormat": "5Digits.json", - "alpha2": "AS", - "alpha3": "ASM", - "numeric3": "16" - }, - "AD": { - "countryName": "Andorra", - "postalCodeFormat": "AD.json", - "alpha2": "AD", - "alpha3": "AND", - "numeric3": "20" - }, - "AO": { - "countryName": "Angola", - "alpha2": "AO", - "alpha3": "AGO", - "numeric3": "24" - }, - "AI": { - "countryName": "Anguilla", - "postalCodeFormat": "AI.json", - "alpha2": "AI", - "alpha3": "AIA", - "numeric3": "660" - }, - "AQ": { - "countryName": "Antarctica", - "postalCodeFormat": "AQ.json", - "alpha2": "AQ", - "alpha3": "ATA", - "numeric3": "10" - }, - "AG": { - "countryName": "Antigua and Barbuda", - "alpha2": "AG", - "alpha3": "ATG", - "numeric3": "28" - }, - "AR": { - "countryName": "Argentina", - "postalCodeFormat": "4Digits.json", - "alpha2": "AR", - "alpha3": "ARG", - "numeric3": "32" - }, - "AM": { - "countryName": "Armenia", - "postalCodeFormat": "4Digits.json", - "alpha2": "AM", - "alpha3": "ARM", - "numeric3": "51" - }, - "AW": { - "countryName": "Aruba", - "alpha2": "AW", - "alpha3": "ABW", - "numeric3": "533" - }, - "AU": { - "countryName": "Australia", - "postalCodeFormat": "4Digits.json", - "alpha2": "AU", - "alpha3": "AUS", - "numeric3": "36" - }, - "AT": { - "countryName": "Austria", - "postalCodeFormat": "4Digits.json", - "alpha2": "AT", - "alpha3": "AUT", - "numeric3": "40" - }, - "AZ": { - "countryName": "Azerbaijan", - "postalCodeFormat": "AZ.json", - "alpha2": "AZ", - "alpha3": "AZE", - "numeric3": "31" - }, - "BS": { - "countryName": "Bahamas", - "alpha2": "BS", - "alpha3": "BHS", - "numeric3": "44" - }, - "BH": { - "countryName": "Bahrain", - "postalCodeFormat": "BH.json", - "alpha2": "BH", - "alpha3": "BHR", - "numeric3": "48" - }, - "BD": { - "countryName": "Bangladesh", - "postalCodeFormat": "4Digits.json", - "alpha2": "BD", - "alpha3": "BGD", - "numeric3": "50" - }, - "BB": { - "countryName": "Barbados", - "postalCodeFormat": "BB.json", - "alpha2": "BB", - "alpha3": "BRB", - "numeric3": "52" - }, - "BY": { - "countryName": "Belarus", - "postalCodeFormat": "6Digits.json", - "alpha2": "BY", - "alpha3": "BLR", - "numeric3": "112" - }, - "BE": { - "countryName": "Belgium", - "postalCodeFormat": "4Digits.json", - "alpha2": "BE", - "alpha3": "BEL", - "numeric3": "56" - }, - "BZ": { - "countryName": "Belize", - "alpha2": "BZ", - "alpha3": "BLZ", - "numeric3": "84" - }, - "BJ": { - "countryName": "Benin", - "alpha2": "BJ", - "alpha3": "BEN", - "numeric3": "204" - }, - "BM": { - "countryName": "Bermuda", - "alpha2": "BM", - "alpha3": "BMU", - "numeric3": "60" - }, - "BT": { - "countryName": "Bhutan", - "postalCodeFormat": "5Digits.json", - "alpha2": "BT", - "alpha3": "BTN", - "numeric3": "64" - }, - "BO": { - "countryName": "Bolivia", - "postalCodeFormat": "4Digits.json", - "alpha2": "BO", - "alpha3": "BOL", - "numeric3": "68" - }, - "BA": { - "countryName": "Bosnia and Herzegovina", - "postalCodeFormat": "5Digits.json", - "alpha2": "BA", - "alpha3": "BIH", - "numeric3": "70" - }, - "BW": { - "countryName": "Botswana", - "alpha2": "BW", - "alpha3": "BWA", - "numeric3": "72" - }, - "BV": { - "countryName": "Bouvet Island", - "alpha2": "BV", - "alpha3": "BVT", - "numeric3": "74" - }, - "BR": { - "countryName": "Brazil", - "postalCodeFormat": "8Digits.json", - "alpha2": "BR", - "alpha3": "BRA", - "numeric3": "76" - }, - "VG": { - "countryName": "British Virgin Islands", - "postalCodeFormat": "VG.json", - "alpha2": "VG", - "alpha3": "VGB", - "numeric3": "92" - }, - "IO": { - "countryName": "British Indian Ocean Territory", - "postalCodeFormat": "IO.json", - "alpha2": "IO", - "alpha3": "IOT", - "numeric3": "86" - }, - "BN": { - "countryName": "Brunei Darussalam", - "postalCodeFormat": "BN.json", - "alpha2": "BN", - "alpha3": "BRN", - "numeric3": "96" - }, - "BG": { - "countryName": "Bulgaria", - "postalCodeFormat": "4Digits.json", - "alpha2": "BG", - "alpha3": "BGR", - "numeric3": "100" - }, - "BF": { - "countryName": "Burkina Faso", - "alpha2": "BF", - "alpha3": "BFA", - "numeric3": "854" - }, - "BI": { - "countryName": "Burundi", - "alpha2": "BI", - "alpha3": "BDI", - "numeric3": "108" - }, - "KH": { - "countryName": "Cambodia", - "postalCodeFormat": "5Digits.json", - "alpha2": "KH", - "alpha3": "KHM", - "numeric3": "116" - }, - "CM": { - "countryName": "Cameroon", - "alpha2": "CM", - "alpha3": "CMR", - "numeric3": "120" - }, - "CA": { - "countryName": "Canada", - "postalCodeFormat": "CA.json", - "alpha2": "CA", - "alpha3": "CAN", - "numeric3": "124" - }, - "CV": { - "countryName": "Cape Verde", - "postalCodeFormat": "4Digits.json", - "alpha2": "CV", - "alpha3": "CPV", - "numeric3": "132" - }, - "KY": { - "countryName": "Cayman Islands", - "postalCodeFormat": "KY.json", - "alpha2": "KY", - "alpha3": "CYM", - "numeric3": "136" - }, - "CF": { - "countryName": "Central African Republic", - "alpha2": "CF", - "alpha3": "CAF", - "numeric3": "140" - }, - "TD": { - "countryName": "Chad", - "postalCodeFormat": "5Digits.json", - "alpha2": "TD", - "alpha3": "TCD", - "numeric3": "148" - }, - "CL": { - "countryName": "Chile", - "postalCodeFormat": "7Digits.json", - "alpha2": "CL", - "alpha3": "CHL", - "numeric3": "152" - }, - "CN": { - "countryName": "China", - "postalCodeFormat": "6Digits.json", - "alpha2": "CN", - "alpha3": "CHN", - "numeric3": "156" - }, - "HK": { - "countryName": "Hong Kong, Special Administrative Region of China", - "alpha2": "HK", - "alpha3": "HKG", - "numeric3": "344" - }, - "MO": { - "countryName": "Macao, Special Administrative Region of China", - "alpha2": "MO", - "alpha3": "MAC", - "numeric3": "446" - }, - "CX": { - "countryName": "Christmas Island", - "postalCodeFormat": "4Digits.json", - "alpha2": "CX", - "alpha3": "CXR", - "numeric3": "162" - }, - "CC": { - "countryName": "Cocos (Keeling) Islands", - "postalCodeFormat": "4Digits.json", - "alpha2": "CC", - "alpha3": "CCK", - "numeric3": "166" - }, - "CO": { - "countryName": "Colombia", - "postalCodeFormat": "6Digits.json", - "alpha2": "CO", - "alpha3": "COL", - "numeric3": "170" - }, - "KM": { - "countryName": "Comoros", - "alpha2": "KM", - "alpha3": "COM", - "numeric3": "174" - }, - "CG": { - "countryName": "Congo (Brazzaville)", - "alpha2": "CG", - "alpha3": "COG", - "numeric3": "178" - }, - "CD": { - "countryName": "Congo, Democratic Republic of the", - "alpha2": "CD", - "alpha3": "COD", - "numeric3": "180" - }, - "CK": { - "countryName": "Cook Islands", - "alpha2": "CK", - "alpha3": "COK", - "numeric3": "184" - }, - "CR": { - "countryName": "Costa Rica", - "postalCodeFormat": "5Digits.json", - "alpha2": "CR", - "alpha3": "CRI", - "numeric3": "188" - }, - "CI": { - "countryName": "Côte d'Ivoire", - "alpha2": "CI", - "alpha3": "CIV", - "numeric3": "384" - }, - "HR": { - "countryName": "Croatia", - "postalCodeFormat": "5Digits.json", - "alpha2": "HR", - "alpha3": "HRV", - "numeric3": "191" - }, - "CU": { - "countryName": "Cuba", - "postalCodeFormat": "5Digits.json", - "alpha2": "CU", - "alpha3": "CUB", - "numeric3": "192" - }, - "CY": { - "countryName": "Cyprus", - "postalCodeFormat": "4Digits.json", - "alpha2": "CY", - "alpha3": "CYP", - "numeric3": "196" - }, - "CZ": { - "countryName": "Czech Republic", - "postalCodeFormat": "5Digits.json", - "alpha2": "CZ", - "alpha3": "CZE", - "numeric3": "203" - }, - "DK": { - "countryName": "Denmark", - "postalCodeFormat": "DK.json", - "alpha2": "DK", - "alpha3": "DNK", - "numeric3": "208" - }, - "DJ": { - "countryName": "Djibouti", - "alpha2": "DJ", - "alpha3": "DJI", - "numeric3": "262" - }, - "DM": { - "countryName": "Dominica", - "alpha2": "DM", - "alpha3": "DMA", - "numeric3": "212" - }, - "DO": { - "countryName": "Dominican Republic", - "postalCodeFormat": "5Digits.json", - "alpha2": "DO", - "alpha3": "DOM", - "numeric3": "214" - }, - "EC": { - "countryName": "Ecuador", - "postalCodeFormat": "6Digits.json", - "alpha2": "EC", - "alpha3": "ECU", - "numeric3": "218" - }, - "EG": { - "countryName": "Egypt", - "postalCodeFormat": "5Digits.json", - "alpha2": "EG", - "alpha3": "EGY", - "numeric3": "818" - }, - "SV": { - "countryName": "El Salvador", - "postalCodeFormat": "4Digits.json", - "alpha2": "SV", - "alpha3": "SLV", - "numeric3": "222" - }, - "GQ": { - "countryName": "Equatorial Guinea", - "alpha2": "GQ", - "alpha3": "GNQ", - "numeric3": "226" - }, - "ER": { - "countryName": "Eritrea", - "alpha2": "ER", - "alpha3": "ERI", - "numeric3": "232" - }, - "EE": { - "countryName": "Estonia", - "postalCodeFormat": "5Digits.json", - "alpha2": "EE", - "alpha3": "EST", - "numeric3": "233" - }, - "ET": { - "countryName": "Ethiopia", - "postalCodeFormat": "4Digits.json", - "alpha2": "ET", - "alpha3": "ETH", - "numeric3": "231" - }, - "FK": { - "countryName": "Falkland Islands (Malvinas)", - "postalCodeFormat": "FK.json", - "alpha2": "FK", - "alpha3": "FLK", - "numeric3": "238" - }, - "FO": { - "countryName": "Faroe Islands", - "postalCodeFormat": "3Digits.json", - "alpha2": "FO", - "alpha3": "FRO", - "numeric3": "234" - }, - "FJ": { - "countryName": "Fiji", - "alpha2": "FJ", - "alpha3": "FJI", - "numeric3": "242" - }, - "FI": { - "countryName": "Finland", - "postalCodeFormat": "5Digits.json", - "alpha2": "FI", - "alpha3": "FIN", - "numeric3": "246" - }, - "FR": { - "countryName": "France", - "postalCodeFormat": "5Digits.json", - "alpha2": "FR", - "alpha3": "FRA", - "numeric3": "250" - }, - "GF": { - "countryName": "French Guiana", - "postalCodeFormat": "GF.json", - "alpha2": "GF", - "alpha3": "GUF", - "numeric3": "254" - }, - "PF": { - "countryName": "French Polynesia", - "postalCodeFormat": "PF.json", - "alpha2": "PF", - "alpha3": "PYF", - "numeric3": "258" - }, - "TF": { - "countryName": "French Southern Territories", - "alpha2": "TF", - "alpha3": "ATF", - "numeric3": "260" - }, - "GA": { - "countryName": "Gabon", - "alpha2": "GA", - "alpha3": "GAB", - "numeric3": "266" - }, - "GM": { - "countryName": "Gambia", - "alpha2": "GM", - "alpha3": "GMB", - "numeric3": "270" - }, - "GE": { - "countryName": "Georgia", - "postalCodeFormat": "4Digits.json", - "alpha2": "GE", - "alpha3": "GEO", - "numeric3": "268" - }, - "DE": { - "countryName": "Germany", - "postalCodeFormat": "5Digits.json", - "alpha2": "DE", - "alpha3": "DEU", - "numeric3": "276" - }, - "GH": { - "countryName": "Ghana", - "alpha2": "GH", - "alpha3": "GHA", - "numeric3": "288" - }, - "GI": { - "countryName": "Gibraltar", - "postalCodeFormat": "GI.json", - "alpha2": "GI", - "alpha3": "GIB", - "numeric3": "292" - }, - "GR": { - "countryName": "Greece", - "postalCodeFormat": "5Digits.json", - "alpha2": "GR", - "alpha3": "GRC", - "numeric3": "300" - }, - "GL": { - "countryName": "Greenland", - "postalCodeFormat": "4Digits.json", - "alpha2": "GL", - "alpha3": "GRL", - "numeric3": "304" - }, - "GD": { - "countryName": "Grenada", - "alpha2": "GD", - "alpha3": "GRD", - "numeric3": "308" - }, - "GP": { - "countryName": "Guadeloupe", - "postalCodeFormat": "GP.json", - "alpha2": "GP", - "alpha3": "GLP", - "numeric3": "312" - }, - "GU": { - "countryName": "Guam", - "postalCodeFormat": "US.json", - "alpha2": "GU", - "alpha3": "GUM", - "numeric3": "316" - }, - "GT": { - "countryName": "Guatemala", - "postalCodeFormat": "5Digits.json", - "alpha2": "GT", - "alpha3": "GTM", - "numeric3": "320" - }, - "GG": { - "countryName": "Guernsey", - "postalCodeFormat": "GG.json", - "alpha2": "GG", - "alpha3": "GGY", - "numeric3": "831" - }, - "GN": { - "countryName": "Guinea", - "postalCodeFormat": "3Digits.json", - "alpha2": "GN", - "alpha3": "GIN", - "numeric3": "324" - }, - "GW": { - "countryName": "Guinea-Bissau", - "postalCodeFormat": "4Digits.json", - "alpha2": "GW", - "alpha3": "GNB", - "numeric3": "624" - }, - "GY": { - "countryName": "Guyana", - "alpha2": "GY", - "alpha3": "GUY", - "numeric3": "328" - }, - "HT": { - "countryName": "Haiti", - "postalCodeFormat": "4Digits.json", - "alpha2": "HT", - "alpha3": "HTI", - "numeric3": "332" - }, - "HM": { - "countryName": "Heard Island and Mcdonald Islands", - "postalCodeFormat": "4Digits.json", - "alpha2": "HM", - "alpha3": "HMD", - "numeric3": "334" - }, - "VA": { - "countryName": "Holy See (Vatican City State)", - "postalCodeFormat": "VA.json", - "alpha2": "VA", - "alpha3": "VAT", - "numeric3": "336" - }, - "HN": { - "countryName": "Honduras", - "postalCodeFormat": "HN.json", - "alpha2": "HN", - "alpha3": "HND", - "numeric3": "340" - }, - "HU": { - "countryName": "Hungary", - "postalCodeFormat": "4Digits.json", - "alpha2": "HU", - "alpha3": "HUN", - "numeric3": "348" - }, - "IS": { - "countryName": "Iceland", - "postalCodeFormat": "3Digits.json", - "alpha2": "IS", - "alpha3": "ISL", - "numeric3": "352" - }, - "IN": { - "countryName": "India", - "postalCodeFormat": "6Digits.json", - "alpha2": "IN", - "alpha3": "IND", - "numeric3": "356" - }, - "IC": { - "countryName": "Canary Islands", - "postalCodeFormat": "5Digits.json", - "alpha2": "IC", - "alpha3": "", - "numeric3": "" - }, - "ID": { - "countryName": "Indonesia", - "postalCodeFormat": "5Digits.json", - "alpha2": "ID", - "alpha3": "IDN", - "numeric3": "360" - }, - "IR": { - "countryName": "Iran, Islamic Republic of", - "postalCodeFormat": "10Digits.json", - "alpha2": "IR", - "alpha3": "IRN", - "numeric3": "364" - }, - "IQ": { - "countryName": "Iraq", - "postalCodeFormat": "5Digits.json", - "alpha2": "IQ", - "alpha3": "IRQ", - "numeric3": "368" - }, - "IE": { - "countryName": "Ireland", - "postalCodeFormat": "IE.json", - "alpha2": "IE", - "alpha3": "IRL", - "numeric3": "372" - }, - "IM": { - "countryName": "Isle of Man", - "postalCodeFormat": "IM.json", - "alpha2": "IM", - "alpha3": "IMN", - "numeric3": "833" - }, - "IL": { - "countryName": "Israel", - "postalCodeFormat": "7Digits.json", - "alpha2": "IL", - "alpha3": "ISR", - "numeric3": "376" - }, - "IT": { - "countryName": "Italy", - "postalCodeFormat": "5Digits.json", - "alpha2": "IT", - "alpha3": "ITA", - "numeric3": "380" - }, - "JM": { - "countryName": "Jamaica", - "postalCodeFormat": "2Digits.json", - "alpha2": "JM", - "alpha3": "JAM", - "numeric3": "388" - }, - "JP": { - "countryName": "Japan", - "postalCodeFormat": "7Digits.json", - "alpha2": "JP", - "alpha3": "JPN", - "numeric3": "392" - }, - "JE": { - "countryName": "Jersey", - "postalCodeFormat": "JE.json", - "alpha2": "JE", - "alpha3": "JEY", - "numeric3": "832" - }, - "JO": { - "countryName": "Jordan", - "postalCodeFormat": "5Digits.json", - "alpha2": "JO", - "alpha3": "JOR", - "numeric3": "400" - }, - "KZ": { - "countryName": "Kazakhstan", - "postalCodeFormat": "6Digits.json", - "alpha2": "KZ", - "alpha3": "KAZ", - "numeric3": "398" - }, - "KE": { - "countryName": "Kenya", - "postalCodeFormat": "5Digits.json", - "alpha2": "KE", - "alpha3": "KEN", - "numeric3": "404" - }, - "KI": { - "countryName": "Kiribati", - "alpha2": "KI", - "alpha3": "KIR", - "numeric3": "296" - }, - "KP": { - "countryName": "Korea, Democratic People's Republic of", - "alpha2": "KP", - "alpha3": "PRK", - "numeric3": "408" - }, - "KR": { - "countryName": "Korea, Republic of", - "postalCodeFormat": "5Digits.json", - "alpha2": "KR", - "alpha3": "KOR", - "numeric3": "410" - }, - "KW": { - "countryName": "Kuwait", - "postalCodeFormat": "5Digits.json", - "alpha2": "KW", - "alpha3": "KWT", - "numeric3": "414" - }, - "KG": { - "countryName": "Kyrgyzstan", - "postalCodeFormat": "6Digits.json", - "alpha2": "KG", - "alpha3": "KGZ", - "numeric3": "417" - }, - "LA": { - "countryName": "Lao PDR", - "postalCodeFormat": "5Digits.json", - "alpha2": "LA", - "alpha3": "LAO", - "numeric3": "418" - }, - "LV": { - "countryName": "Latvia", - "postalCodeFormat": "LV.json", - "alpha2": "LV", - "alpha3": "LVA", - "numeric3": "428" - }, - "LB": { - "countryName": "Lebanon", - "postalCodeFormat": "LB.json", - "alpha2": "LB", - "alpha3": "LBN", - "numeric3": "422" - }, - "LS": { - "countryName": "Lesotho", - "postalCodeFormat": "3Digits.json", - "alpha2": "LS", - "alpha3": "LSO", - "numeric3": "426" - }, - "LR": { - "countryName": "Liberia", - "postalCodeFormat": "4Digits.json", - "alpha2": "LR", - "alpha3": "LBR", - "numeric3": "430" - }, - "LY": { - "countryName": "Libya", - "postalCodeFormat": "5Digits.json", - "alpha2": "LY", - "alpha3": "LBY", - "numeric3": "434" - }, - "LI": { - "countryName": "Liechtenstein", - "postalCodeFormat": "4Digits.json", - "alpha2": "LI", - "alpha3": "LIE", - "numeric3": "438" - }, - "LT": { - "countryName": "Lithuania", - "postalCodeFormat": "LT.json", - "alpha2": "LT", - "alpha3": "LTU", - "numeric3": "440" - }, - "LU": { - "countryName": "Luxembourg", - "postalCodeFormat": "LU.json", - "alpha2": "LU", - "alpha3": "LUX", - "numeric3": "442" - }, - "MK": { - "countryName": "Macedonia, Republic of", - "postalCodeFormat": "4Digits.json", - "alpha2": "MK", - "alpha3": "MKD", - "numeric3": "807" - }, - "MG": { - "countryName": "Madagascar", - "postalCodeFormat": "3Digits.json", - "alpha2": "MG", - "alpha3": "MDG", - "numeric3": "450" - }, - "MW": { - "countryName": "Malawi", - "alpha2": "MW", - "alpha3": "MWI", - "numeric3": "454" - }, - "MY": { - "countryName": "Malaysia", - "postalCodeFormat": "5Digits.json", - "alpha2": "MY", - "alpha3": "MYS", - "numeric3": "458" - }, - "MV": { - "countryName": "Maldives", - "postalCodeFormat": "5Digits.json", - "alpha2": "MV", - "alpha3": "MDV", - "numeric3": "462" - }, - "ML": { - "countryName": "Mali", - "alpha2": "ML", - "alpha3": "MLI", - "numeric3": "466" - }, - "MT": { - "countryName": "Malta", - "postalCodeFormat": "MT.json", - "alpha2": "MT", - "alpha3": "MLT", - "numeric3": "470" - }, - "MH": { - "countryName": "Marshall Islands", - "postalCodeFormat": "US.json", - "alpha2": "MH", - "alpha3": "MHL", - "numeric3": "584" - }, - "MQ": { - "countryName": "Martinique", - "postalCodeFormat": "5Digits.json", - "alpha2": "MQ", - "alpha3": "MTQ", - "numeric3": "474" - }, - "MR": { - "countryName": "Mauritania", - "alpha2": "MR", - "alpha3": "MRT", - "numeric3": "478" - }, - "MU": { - "countryName": "Mauritius", - "postalCodeFormat": "5Digits.json", - "alpha2": "MU", - "alpha3": "MUS", - "numeric3": "480" - }, - "YT": { - "countryName": "Mayotte", - "postalCodeFormat": "5Digits.json", - "alpha2": "YT", - "alpha3": "MYT", - "numeric3": "175" - }, - "MX": { - "countryName": "Mexico", - "postalCodeFormat": "5Digits.json", - "alpha2": "MX", - "alpha3": "MEX", - "numeric3": "484" - }, - "FM": { - "countryName": "Micronesia, Federated States of", - "postalCodeFormat": "US.json", - "alpha2": "FM", - "alpha3": "FSM", - "numeric3": "583" - }, - "MD": { - "countryName": "Moldova", - "postalCodeFormat": "MD.json", - "alpha2": "MD", - "alpha3": "MDA", - "numeric3": "498" - }, - "MC": { - "countryName": "Monaco", - "postalCodeFormat": "MC.json", - "alpha2": "MC", - "alpha3": "MCO", - "numeric3": "492" - }, - "MN": { - "countryName": "Mongolia", - "postalCodeFormat": "5Digits.json", - "alpha2": "MN", - "alpha3": "MNG", - "numeric3": "496" - }, - "ME": { - "countryName": "Montenegro", - "postalCodeFormat": "5Digits.json", - "alpha2": "ME", - "alpha3": "MNE", - "numeric3": "499" - }, - "MS": { - "countryName": "Montserrat", - "postalCodeFormat": "MS.json", - "alpha2": "MS", - "alpha3": "MSR", - "numeric3": "500" - }, - "MA": { - "countryName": "Morocco", - "postalCodeFormat": "5Digits.json", - "alpha2": "MA", - "alpha3": "MAR", - "numeric3": "504" - }, - "MZ": { - "countryName": "Mozambique", - "postalCodeFormat": "4Digits.json", - "alpha2": "MZ", - "alpha3": "MOZ", - "numeric3": "508" - }, - "MM": { - "countryName": "Myanmar", - "postalCodeFormat": "5Digits.json", - "alpha2": "MM", - "alpha3": "MMR", - "numeric3": "104" - }, - "NA": { - "countryName": "Namibia", - "postalCodeFormat": "5Digits.json", - "alpha2": "NA", - "alpha3": "NAM", - "numeric3": "516" - }, - "NR": { - "countryName": "Nauru", - "alpha2": "NR", - "alpha3": "NRU", - "numeric3": "520" - }, - "NP": { - "countryName": "Nepal", - "postalCodeFormat": "5Digits.json", - "alpha2": "NP", - "alpha3": "NPL", - "numeric3": "524" - }, - "NL": { - "countryName": "Netherlands", - "postalCodeFormat": "NL.json", - "alpha2": "NL", - "alpha3": "NLD", - "numeric3": "528" - }, - "AN": { - "countryName": "Netherlands Antilles", - "alpha2": "AN", - "alpha3": "ANT", - "numeric3": "530" - }, - "NC": { - "countryName": "New Caledonia", - "postalCodeFormat": "NC.json", - "alpha2": "NC", - "alpha3": "NCL", - "numeric3": "540" - }, - "NZ": { - "countryName": "New Zealand", - "postalCodeFormat": "4Digits.json", - "alpha2": "NZ", - "alpha3": "NZL", - "numeric3": "554" - }, - "NI": { - "countryName": "Nicaragua", - "postalCodeFormat": "5Digits.json", - "alpha2": "NI", - "alpha3": "NIC", - "numeric3": "558" - }, - "NE": { - "countryName": "Niger", - "postalCodeFormat": "4Digits.json", - "alpha2": "NE", - "alpha3": "NER", - "numeric3": "562" - }, - "NG": { - "countryName": "Nigeria", - "postalCodeFormat": "6Digits.json", - "alpha2": "NG", - "alpha3": "NGA", - "numeric3": "566" - }, - "NU": { - "countryName": "Niue", - "alpha2": "NU", - "alpha3": "NIU", - "numeric3": "570" - }, - "NF": { - "countryName": "Norfolk Island", - "postalCodeFormat": "4Digits.json", - "alpha2": "NF", - "alpha3": "NFK", - "numeric3": "574" - }, - "MP": { - "countryName": "Northern Mariana Islands", - "postalCodeFormat": "US.json", - "alpha2": "MP", - "alpha3": "MNP", - "numeric3": "580" - }, - "NO": { - "countryName": "Norway", - "postalCodeFormat": "4Digits.json", - "alpha2": "NO", - "alpha3": "NOR", - "numeric3": "578" - }, - "OM": { - "countryName": "Oman", - "postalCodeFormat": "3Digits.json", - "alpha2": "OM", - "alpha3": "OMN", - "numeric3": "512" - }, - "PK": { - "countryName": "Pakistan", - "postalCodeFormat": "5Digits.json", - "alpha2": "PK", - "alpha3": "PAK", - "numeric3": "586" - }, - "PW": { - "countryName": "Palau", - "postalCodeFormat": "US.json", - "alpha2": "PW", - "alpha3": "PLW", - "numeric3": "585" - }, - "PS": { - "countryName": "Palestinian Territory, Occupied", - "postalCodeFormat": "3Digits.json", - "alpha2": "PS", - "alpha3": "PSE", - "numeric3": "275" - }, - "PA": { - "countryName": "Panama", - "postalCodeFormat": "4Digits.json", - "alpha2": "PA", - "alpha3": "PAN", - "numeric3": "591" - }, - "PG": { - "countryName": "Papua New Guinea", - "postalCodeFormat": "3Digits.json", - "alpha2": "PG", - "alpha3": "PNG", - "numeric3": "598" - }, - "PY": { - "countryName": "Paraguay", - "postalCodeFormat": "4Digits.json", - "alpha2": "PY", - "alpha3": "PRY", - "numeric3": "600" - }, - "PE": { - "countryName": "Peru", - "postalCodeFormat": "5Digits.json", - "alpha2": "PE", - "alpha3": "PER", - "numeric3": "604" - }, - "PH": { - "countryName": "Philippines", - "postalCodeFormat": "4Digits.json", - "alpha2": "PH", - "alpha3": "PHL", - "numeric3": "608" - }, - "PN": { - "countryName": "Pitcairn", - "postalCodeFormat": "PN.json", - "alpha2": "PN", - "alpha3": "PCN", - "numeric3": "612" - }, - "PL": { - "countryName": "Poland", - "postalCodeFormat": "PL.json", - "alpha2": "PL", - "alpha3": "POL", - "numeric3": "616" - }, - "PT": { - "countryName": "Portugal", - "postalCodeFormat": "PT.json", - "alpha2": "PT", - "alpha3": "PRT", - "numeric3": "620" - }, - "PR": { - "countryName": "Puerto Rico", - "postalCodeFormat": "US.json", - "alpha2": "PR", - "alpha3": "PRI", - "numeric3": "630" - }, - "QA": { - "countryName": "Qatar", - "alpha2": "QA", - "alpha3": "QAT", - "numeric3": "634" - }, - "RE": { - "countryName": "Réunion", - "postalCodeFormat": "RE.json", - "alpha2": "RE", - "alpha3": "REU", - "numeric3": "638" - }, - "RO": { - "countryName": "Romania", - "postalCodeFormat": "6Digits.json", - "alpha2": "RO", - "alpha3": "ROU", - "numeric3": "642" - }, - "RU": { - "countryName": "Russian Federation", - "postalCodeFormat": "RU.json", - "alpha2": "RU", - "alpha3": "RUS", - "numeric3": "643" - }, - "RW": { - "countryName": "Rwanda", - "alpha2": "RW", - "alpha3": "RWA", - "numeric3": "646" - }, - "BL": { - "countryName": "Saint-Barthélemy", - "postalCodeFormat": "BL.json", - "alpha2": "BL", - "alpha3": "BLM", - "numeric3": "652" - }, - "SH": { - "countryName": "Saint Helena", - "postalCodeFormat": "SH.json", - "alpha2": "SH", - "alpha3": "SHN", - "numeric3": "654" - }, - "KN": { - "countryName": "Saint Kitts and Nevis", - "alpha2": "KN", - "alpha3": "KNA", - "numeric3": "659" - }, - "LC": { - "countryName": "Saint Lucia", - "postalCodeFormat": "LC.json", - "alpha2": "LC", - "alpha3": "LCA", - "numeric3": "662" - }, - "MF": { - "countryName": "Saint-Martin (French part)", - "postalCodeFormat": "MF.json", - "alpha2": "MF", - "alpha3": "MAF", - "numeric3": "663" - }, - "PM": { - "countryName": "Saint Pierre and Miquelon", - "postalCodeFormat": "PM.json", - "alpha2": "PM", - "alpha3": "SPM", - "numeric3": "666" - }, - "VC": { - "countryName": "Saint Vincent and Grenadines", - "postalCodeFormat": "VC.json", - "alpha2": "VC", - "alpha3": "VCT", - "numeric3": "670" - }, - "WS": { - "countryName": "Samoa", - "postalCodeFormat": "WS.json", - "alpha2": "WS", - "alpha3": "WSM", - "numeric3": "882" - }, - "SM": { - "countryName": "San Marino", - "postalCodeFormat": "SM.json", - "alpha2": "SM", - "alpha3": "SMR", - "numeric3": "674" - }, - "ST": { - "countryName": "Sao Tome and Principe", - "alpha2": "ST", - "alpha3": "STP", - "numeric3": "678" - }, - "SA": { - "countryName": "Saudi Arabia", - "postalCodeFormat": "US.json", - "alpha2": "SA", - "alpha3": "SAU", - "numeric3": "682" - }, - "SN": { - "countryName": "Senegal", - "postalCodeFormat": "5Digits.json", - "alpha2": "SN", - "alpha3": "SEN", - "numeric3": "686" - }, - "RS": { - "countryName": "Serbia", - "postalCodeFormat": "5Digits.json", - "alpha2": "RS", - "alpha3": "SRB", - "numeric3": "688" - }, - "SC": { - "countryName": "Seychelles", - "alpha2": "SC", - "alpha3": "SYC", - "numeric3": "690" - }, - "SL": { - "countryName": "Sierra Leone", - "alpha2": "SL", - "alpha3": "SLE", - "numeric3": "694" - }, - "SG": { - "countryName": "Singapore", - "postalCodeFormat": "6Digits.json", - "alpha2": "SG", - "alpha3": "SGP", - "numeric3": "702" - }, - "SK": { - "countryName": "Slovakia", - "postalCodeFormat": "5Digits.json", - "alpha2": "SK", - "alpha3": "SVK", - "numeric3": "703" - }, - "SI": { - "countryName": "Slovenia", - "postalCodeFormat": "4Digits.json", - "alpha2": "SI", - "alpha3": "SVN", - "numeric3": "705" - }, - "SB": { - "countryName": "Solomon Islands", - "alpha2": "SB", - "alpha3": "SLB", - "numeric3": "90" - }, - "SO": { - "countryName": "Somalia", - "postalCodeFormat": "SO.json", - "alpha2": "SO", - "alpha3": "SOM", - "numeric3": "706" - }, - "ZA": { - "countryName": "South Africa", - "postalCodeFormat": "4Digits.json", - "alpha2": "ZA", - "alpha3": "ZAF", - "numeric3": "710" - }, - "GS": { - "countryName": "South Georgia and the South Sandwich Islands", - "postalCodeFormat": "GS.json", - "alpha2": "GS", - "alpha3": "SGS", - "numeric3": "239" - }, - "SS": { - "countryName": "South Sudan", - "alpha2": "SS", - "alpha3": "SSD", - "numeric3": "728" - }, - "ES": { - "countryName": "Spain", - "postalCodeFormat": "5Digits.json", - "alpha2": "ES", - "alpha3": "ESP", - "numeric3": "724" - }, - "LK": { - "countryName": "Sri Lanka", - "postalCodeFormat": "5Digits.json", - "alpha2": "LK", - "alpha3": "LKA", - "numeric3": "144" - }, - "SD": { - "countryName": "Sudan", - "postalCodeFormat": "5Digits.json", - "alpha2": "SD", - "alpha3": "SDN", - "numeric3": "736" - }, - "SR": { - "countryName": "Suriname *", - "alpha2": "SR", - "alpha3": "SUR", - "numeric3": "740" - }, - "SJ": { - "countryName": "Svalbard and Jan Mayen Islands", - "postalCodeFormat": "4Digits.json", - "alpha2": "SJ", - "alpha3": "SJM", - "numeric3": "744" - }, - "SZ": { - "countryName": "Swaziland", - "postalCodeFormat": "SZ.json", - "alpha2": "SZ", - "alpha3": "SWZ", - "numeric3": "748" - }, - "SE": { - "countryName": "Sweden", - "postalCodeFormat": "5Digits.json", - "alpha2": "SE", - "alpha3": "SWE", - "numeric3": "752" - }, - "CH": { - "countryName": "Switzerland", - "postalCodeFormat": "4Digits.json", - "alpha2": "CH", - "alpha3": "CHE", - "numeric3": "756" - }, - "SY": { - "countryName": "Syrian Arab Republic (Syria)", - "alpha2": "SY", - "alpha3": "SYR", - "numeric3": "760" - }, - "TW": { - "countryName": "Taiwan, Republic of China", - "postalCodeFormat": "TW.json", - "alpha2": "TW", - "alpha3": "TWN", - "numeric3": "158" - }, - "TJ": { - "countryName": "Tajikistan", - "postalCodeFormat": "6Digits.json", - "alpha2": "TJ", - "alpha3": "TJK", - "numeric3": "762" - }, - "TZ": { - "countryName": "Tanzania *, United Republic of", - "postalCodeFormat": "5Digits.json", - "alpha2": "TZ", - "alpha3": "TZA", - "numeric3": "834" - }, - "TH": { - "countryName": "Thailand", - "postalCodeFormat": "5Digits.json", - "alpha2": "TH", - "alpha3": "THA", - "numeric3": "764" - }, - "TL": { - "countryName": "Timor-Leste", - "alpha2": "TL", - "alpha3": "TLS", - "numeric3": "626" - }, - "TG": { - "countryName": "Togo", - "alpha2": "TG", - "alpha3": "TGO", - "numeric3": "768" - }, - "TK": { - "countryName": "Tokelau", - "alpha2": "TK", - "alpha3": "TKL", - "numeric3": "772" - }, - "TO": { - "countryName": "Tonga", - "alpha2": "TO", - "alpha3": "TON", - "numeric3": "776" - }, - "TT": { - "countryName": "Trinidad and Tobago", - "postalCodeFormat": "6Digits.json", - "alpha2": "TT", - "alpha3": "TTO", - "numeric3": "780" - }, - "TN": { - "countryName": "Tunisia", - "postalCodeFormat": "4Digits.json", - "alpha2": "TN", - "alpha3": "TUN", - "numeric3": "788" - }, - "TR": { - "countryName": "Turkey", - "postalCodeFormat": "5Digits.json", - "alpha2": "TR", - "alpha3": "TUR", - "numeric3": "792" - }, - "TM": { - "countryName": "Turkmenistan", - "postalCodeFormat": "6Digits.json", - "alpha2": "TM", - "alpha3": "TKM", - "numeric3": "795" - }, - "TC": { - "countryName": "Turks and Caicos Islands", - "postalCodeFormat": "TC.json", - "alpha2": "TC", - "alpha3": "TCA", - "numeric3": "796" - }, - "TV": { - "countryName": "Tuvalu", - "alpha2": "TV", - "alpha3": "TUV", - "numeric3": "798" - }, - "UG": { - "countryName": "Uganda", - "alpha2": "UG", - "alpha3": "UGA", - "numeric3": "800" - }, - "UA": { - "countryName": "Ukraine", - "postalCodeFormat": "5Digits.json", - "alpha2": "UA", - "alpha3": "UKR", - "numeric3": "804" - }, - "AE": { - "countryName": "United Arab Emirates", - "alpha2": "AE", - "alpha3": "ARE", - "numeric3": "784" - }, - "GB": { - "countryName": "United Kingdom", - "postalCodeFormat": "GB.json", - "alpha2": "GB", - "alpha3": "GBR", - "numeric3": "826" - }, - "US": { - "countryName": "United States of America", - "postalCodeFormat": "US.json", - "alpha2": "US", - "alpha3": "USA", - "numeric3": "840" - }, - "UM": { - "countryName": "United States Minor Outlying Islands", - "alpha2": "UM", - "alpha3": "UMI", - "numeric3": "581" - }, - "UY": { - "countryName": "Uruguay", - "postalCodeFormat": "5Digits.json", - "alpha2": "UY", - "alpha3": "URY", - "numeric3": "858" - }, - "UZ": { - "countryName": "Uzbekistan", - "postalCodeFormat": "6Digits.json", - "alpha2": "UZ", - "alpha3": "UZB", - "numeric3": "860" - }, - "VU": { - "countryName": "Vanuatu", - "alpha2": "VU", - "alpha3": "VUT", - "numeric3": "548" - }, - "VE": { - "countryName": "Venezuela (Bolivarian Republic of)", - "postalCodeFormat": "VE.json", - "alpha2": "VE", - "alpha3": "VEN", - "numeric3": "862" - }, - "VN": { - "countryName": "Viet Nam", - "postalCodeFormat": "6Digits.json", - "alpha2": "VN", - "alpha3": "VNM", - "numeric3": "704" - }, - "VI": { - "countryName": "Virgin Islands, US", - "postalCodeFormat": "US.json", - "alpha2": "VI", - "alpha3": "VIR", - "numeric3": "850" - }, - "WF": { - "countryName": "Wallis and Futuna Islands", - "postalCodeFormat": "WF.json", - "alpha2": "WF", - "alpha3": "WLF", - "numeric3": "876" - }, - "EH": { - "countryName": "Western Sahara", - "alpha2": "EH", - "alpha3": "ESH", - "numeric3": "732" - }, - "YE": { - "countryName": "Yemen", - "alpha2": "YE", - "alpha3": "YEM", - "numeric3": "887" - }, - "ZM": { - "countryName": "Zambia", - "postalCodeFormat": "5Digits.json", - "alpha2": "ZM", - "alpha3": "ZMB", - "numeric3": "894" - }, - "ZW": { - "countryName": "Zimbabwe", - "alpha2": "ZW", - "alpha3": "ZWE", - "numeric3": "716" - } -} diff --git a/generated/postal-codes-alpha3.json b/generated/postal-codes-alpha3.json deleted file mode 100644 index 6d96b25..0000000 --- a/generated/postal-codes-alpha3.json +++ /dev/null @@ -1,1670 +0,0 @@ -{ - "AFG": { - "countryName": "Afghanistan", - "postalCodeFormat": "4Digits.json", - "alpha2": "AF", - "alpha3": "AFG", - "numeric3": "4" - }, - "ALA": { - "countryName": "Aland Islands", - "postalCodeFormat": "AX.json", - "alpha2": "AX", - "alpha3": "ALA", - "numeric3": "248" - }, - "ALB": { - "countryName": "Albania", - "postalCodeFormat": "4Digits.json", - "alpha2": "AL", - "alpha3": "ALB", - "numeric3": "8" - }, - "DZA": { - "countryName": "Algeria", - "postalCodeFormat": "5Digits.json", - "alpha2": "DZ", - "alpha3": "DZA", - "numeric3": "12" - }, - "ASM": { - "countryName": "American Samoa", - "postalCodeFormat": "5Digits.json", - "alpha2": "AS", - "alpha3": "ASM", - "numeric3": "16" - }, - "AND": { - "countryName": "Andorra", - "postalCodeFormat": "AD.json", - "alpha2": "AD", - "alpha3": "AND", - "numeric3": "20" - }, - "AGO": { - "countryName": "Angola", - "alpha2": "AO", - "alpha3": "AGO", - "numeric3": "24" - }, - "AIA": { - "countryName": "Anguilla", - "postalCodeFormat": "AI.json", - "alpha2": "AI", - "alpha3": "AIA", - "numeric3": "660" - }, - "ATA": { - "countryName": "Antarctica", - "postalCodeFormat": "AQ.json", - "alpha2": "AQ", - "alpha3": "ATA", - "numeric3": "10" - }, - "ATG": { - "countryName": "Antigua and Barbuda", - "alpha2": "AG", - "alpha3": "ATG", - "numeric3": "28" - }, - "ARG": { - "countryName": "Argentina", - "postalCodeFormat": "4Digits.json", - "alpha2": "AR", - "alpha3": "ARG", - "numeric3": "32" - }, - "ARM": { - "countryName": "Armenia", - "postalCodeFormat": "4Digits.json", - "alpha2": "AM", - "alpha3": "ARM", - "numeric3": "51" - }, - "ABW": { - "countryName": "Aruba", - "alpha2": "AW", - "alpha3": "ABW", - "numeric3": "533" - }, - "AUS": { - "countryName": "Australia", - "postalCodeFormat": "4Digits.json", - "alpha2": "AU", - "alpha3": "AUS", - "numeric3": "36" - }, - "AUT": { - "countryName": "Austria", - "postalCodeFormat": "4Digits.json", - "alpha2": "AT", - "alpha3": "AUT", - "numeric3": "40" - }, - "AZE": { - "countryName": "Azerbaijan", - "postalCodeFormat": "AZ.json", - "alpha2": "AZ", - "alpha3": "AZE", - "numeric3": "31" - }, - "BHS": { - "countryName": "Bahamas", - "alpha2": "BS", - "alpha3": "BHS", - "numeric3": "44" - }, - "BHR": { - "countryName": "Bahrain", - "postalCodeFormat": "BH.json", - "alpha2": "BH", - "alpha3": "BHR", - "numeric3": "48" - }, - "BGD": { - "countryName": "Bangladesh", - "postalCodeFormat": "4Digits.json", - "alpha2": "BD", - "alpha3": "BGD", - "numeric3": "50" - }, - "BRB": { - "countryName": "Barbados", - "postalCodeFormat": "BB.json", - "alpha2": "BB", - "alpha3": "BRB", - "numeric3": "52" - }, - "BLR": { - "countryName": "Belarus", - "postalCodeFormat": "6Digits.json", - "alpha2": "BY", - "alpha3": "BLR", - "numeric3": "112" - }, - "BEL": { - "countryName": "Belgium", - "postalCodeFormat": "4Digits.json", - "alpha2": "BE", - "alpha3": "BEL", - "numeric3": "56" - }, - "BLZ": { - "countryName": "Belize", - "alpha2": "BZ", - "alpha3": "BLZ", - "numeric3": "84" - }, - "BEN": { - "countryName": "Benin", - "alpha2": "BJ", - "alpha3": "BEN", - "numeric3": "204" - }, - "BMU": { - "countryName": "Bermuda", - "alpha2": "BM", - "alpha3": "BMU", - "numeric3": "60" - }, - "BTN": { - "countryName": "Bhutan", - "postalCodeFormat": "5Digits.json", - "alpha2": "BT", - "alpha3": "BTN", - "numeric3": "64" - }, - "BOL": { - "countryName": "Bolivia", - "postalCodeFormat": "4Digits.json", - "alpha2": "BO", - "alpha3": "BOL", - "numeric3": "68" - }, - "BIH": { - "countryName": "Bosnia and Herzegovina", - "postalCodeFormat": "5Digits.json", - "alpha2": "BA", - "alpha3": "BIH", - "numeric3": "70" - }, - "BWA": { - "countryName": "Botswana", - "alpha2": "BW", - "alpha3": "BWA", - "numeric3": "72" - }, - "BVT": { - "countryName": "Bouvet Island", - "alpha2": "BV", - "alpha3": "BVT", - "numeric3": "74" - }, - "BRA": { - "countryName": "Brazil", - "postalCodeFormat": "8Digits.json", - "alpha2": "BR", - "alpha3": "BRA", - "numeric3": "76" - }, - "VGB": { - "countryName": "British Virgin Islands", - "postalCodeFormat": "VG.json", - "alpha2": "VG", - "alpha3": "VGB", - "numeric3": "92" - }, - "IOT": { - "countryName": "British Indian Ocean Territory", - "postalCodeFormat": "IO.json", - "alpha2": "IO", - "alpha3": "IOT", - "numeric3": "86" - }, - "BRN": { - "countryName": "Brunei Darussalam", - "postalCodeFormat": "BN.json", - "alpha2": "BN", - "alpha3": "BRN", - "numeric3": "96" - }, - "BGR": { - "countryName": "Bulgaria", - "postalCodeFormat": "4Digits.json", - "alpha2": "BG", - "alpha3": "BGR", - "numeric3": "100" - }, - "BFA": { - "countryName": "Burkina Faso", - "alpha2": "BF", - "alpha3": "BFA", - "numeric3": "854" - }, - "BDI": { - "countryName": "Burundi", - "alpha2": "BI", - "alpha3": "BDI", - "numeric3": "108" - }, - "KHM": { - "countryName": "Cambodia", - "postalCodeFormat": "5Digits.json", - "alpha2": "KH", - "alpha3": "KHM", - "numeric3": "116" - }, - "CMR": { - "countryName": "Cameroon", - "alpha2": "CM", - "alpha3": "CMR", - "numeric3": "120" - }, - "CAN": { - "countryName": "Canada", - "postalCodeFormat": "CA.json", - "alpha2": "CA", - "alpha3": "CAN", - "numeric3": "124" - }, - "CPV": { - "countryName": "Cape Verde", - "postalCodeFormat": "4Digits.json", - "alpha2": "CV", - "alpha3": "CPV", - "numeric3": "132" - }, - "CYM": { - "countryName": "Cayman Islands", - "postalCodeFormat": "KY.json", - "alpha2": "KY", - "alpha3": "CYM", - "numeric3": "136" - }, - "CAF": { - "countryName": "Central African Republic", - "alpha2": "CF", - "alpha3": "CAF", - "numeric3": "140" - }, - "TCD": { - "countryName": "Chad", - "postalCodeFormat": "5Digits.json", - "alpha2": "TD", - "alpha3": "TCD", - "numeric3": "148" - }, - "CHL": { - "countryName": "Chile", - "postalCodeFormat": "7Digits.json", - "alpha2": "CL", - "alpha3": "CHL", - "numeric3": "152" - }, - "CHN": { - "countryName": "China", - "postalCodeFormat": "6Digits.json", - "alpha2": "CN", - "alpha3": "CHN", - "numeric3": "156" - }, - "HKG": { - "countryName": "Hong Kong, Special Administrative Region of China", - "alpha2": "HK", - "alpha3": "HKG", - "numeric3": "344" - }, - "MAC": { - "countryName": "Macao, Special Administrative Region of China", - "alpha2": "MO", - "alpha3": "MAC", - "numeric3": "446" - }, - "CXR": { - "countryName": "Christmas Island", - "postalCodeFormat": "4Digits.json", - "alpha2": "CX", - "alpha3": "CXR", - "numeric3": "162" - }, - "CCK": { - "countryName": "Cocos (Keeling) Islands", - "postalCodeFormat": "4Digits.json", - "alpha2": "CC", - "alpha3": "CCK", - "numeric3": "166" - }, - "COL": { - "countryName": "Colombia", - "postalCodeFormat": "6Digits.json", - "alpha2": "CO", - "alpha3": "COL", - "numeric3": "170" - }, - "COM": { - "countryName": "Comoros", - "alpha2": "KM", - "alpha3": "COM", - "numeric3": "174" - }, - "COG": { - "countryName": "Congo (Brazzaville)", - "alpha2": "CG", - "alpha3": "COG", - "numeric3": "178" - }, - "COD": { - "countryName": "Congo, Democratic Republic of the", - "alpha2": "CD", - "alpha3": "COD", - "numeric3": "180" - }, - "COK": { - "countryName": "Cook Islands", - "alpha2": "CK", - "alpha3": "COK", - "numeric3": "184" - }, - "CRI": { - "countryName": "Costa Rica", - "postalCodeFormat": "5Digits.json", - "alpha2": "CR", - "alpha3": "CRI", - "numeric3": "188" - }, - "CIV": { - "countryName": "Côte d'Ivoire", - "alpha2": "CI", - "alpha3": "CIV", - "numeric3": "384" - }, - "HRV": { - "countryName": "Croatia", - "postalCodeFormat": "5Digits.json", - "alpha2": "HR", - "alpha3": "HRV", - "numeric3": "191" - }, - "CUB": { - "countryName": "Cuba", - "postalCodeFormat": "5Digits.json", - "alpha2": "CU", - "alpha3": "CUB", - "numeric3": "192" - }, - "CYP": { - "countryName": "Cyprus", - "postalCodeFormat": "4Digits.json", - "alpha2": "CY", - "alpha3": "CYP", - "numeric3": "196" - }, - "CZE": { - "countryName": "Czech Republic", - "postalCodeFormat": "5Digits.json", - "alpha2": "CZ", - "alpha3": "CZE", - "numeric3": "203" - }, - "DNK": { - "countryName": "Denmark", - "postalCodeFormat": "DK.json", - "alpha2": "DK", - "alpha3": "DNK", - "numeric3": "208" - }, - "DJI": { - "countryName": "Djibouti", - "alpha2": "DJ", - "alpha3": "DJI", - "numeric3": "262" - }, - "DMA": { - "countryName": "Dominica", - "alpha2": "DM", - "alpha3": "DMA", - "numeric3": "212" - }, - "DOM": { - "countryName": "Dominican Republic", - "postalCodeFormat": "5Digits.json", - "alpha2": "DO", - "alpha3": "DOM", - "numeric3": "214" - }, - "ECU": { - "countryName": "Ecuador", - "postalCodeFormat": "6Digits.json", - "alpha2": "EC", - "alpha3": "ECU", - "numeric3": "218" - }, - "EGY": { - "countryName": "Egypt", - "postalCodeFormat": "5Digits.json", - "alpha2": "EG", - "alpha3": "EGY", - "numeric3": "818" - }, - "SLV": { - "countryName": "El Salvador", - "postalCodeFormat": "4Digits.json", - "alpha2": "SV", - "alpha3": "SLV", - "numeric3": "222" - }, - "GNQ": { - "countryName": "Equatorial Guinea", - "alpha2": "GQ", - "alpha3": "GNQ", - "numeric3": "226" - }, - "ERI": { - "countryName": "Eritrea", - "alpha2": "ER", - "alpha3": "ERI", - "numeric3": "232" - }, - "EST": { - "countryName": "Estonia", - "postalCodeFormat": "5Digits.json", - "alpha2": "EE", - "alpha3": "EST", - "numeric3": "233" - }, - "ETH": { - "countryName": "Ethiopia", - "postalCodeFormat": "4Digits.json", - "alpha2": "ET", - "alpha3": "ETH", - "numeric3": "231" - }, - "FLK": { - "countryName": "Falkland Islands (Malvinas)", - "postalCodeFormat": "FK.json", - "alpha2": "FK", - "alpha3": "FLK", - "numeric3": "238" - }, - "FRO": { - "countryName": "Faroe Islands", - "postalCodeFormat": "3Digits.json", - "alpha2": "FO", - "alpha3": "FRO", - "numeric3": "234" - }, - "FJI": { - "countryName": "Fiji", - "alpha2": "FJ", - "alpha3": "FJI", - "numeric3": "242" - }, - "FIN": { - "countryName": "Finland", - "postalCodeFormat": "5Digits.json", - "alpha2": "FI", - "alpha3": "FIN", - "numeric3": "246" - }, - "FRA": { - "countryName": "France", - "postalCodeFormat": "5Digits.json", - "alpha2": "FR", - "alpha3": "FRA", - "numeric3": "250" - }, - "GUF": { - "countryName": "French Guiana", - "postalCodeFormat": "GF.json", - "alpha2": "GF", - "alpha3": "GUF", - "numeric3": "254" - }, - "PYF": { - "countryName": "French Polynesia", - "postalCodeFormat": "PF.json", - "alpha2": "PF", - "alpha3": "PYF", - "numeric3": "258" - }, - "ATF": { - "countryName": "French Southern Territories", - "alpha2": "TF", - "alpha3": "ATF", - "numeric3": "260" - }, - "GAB": { - "countryName": "Gabon", - "alpha2": "GA", - "alpha3": "GAB", - "numeric3": "266" - }, - "GMB": { - "countryName": "Gambia", - "alpha2": "GM", - "alpha3": "GMB", - "numeric3": "270" - }, - "GEO": { - "countryName": "Georgia", - "postalCodeFormat": "4Digits.json", - "alpha2": "GE", - "alpha3": "GEO", - "numeric3": "268" - }, - "DEU": { - "countryName": "Germany", - "postalCodeFormat": "5Digits.json", - "alpha2": "DE", - "alpha3": "DEU", - "numeric3": "276" - }, - "GHA": { - "countryName": "Ghana", - "alpha2": "GH", - "alpha3": "GHA", - "numeric3": "288" - }, - "GIB": { - "countryName": "Gibraltar", - "postalCodeFormat": "GI.json", - "alpha2": "GI", - "alpha3": "GIB", - "numeric3": "292" - }, - "GRC": { - "countryName": "Greece", - "postalCodeFormat": "5Digits.json", - "alpha2": "GR", - "alpha3": "GRC", - "numeric3": "300" - }, - "GRL": { - "countryName": "Greenland", - "postalCodeFormat": "4Digits.json", - "alpha2": "GL", - "alpha3": "GRL", - "numeric3": "304" - }, - "GRD": { - "countryName": "Grenada", - "alpha2": "GD", - "alpha3": "GRD", - "numeric3": "308" - }, - "GLP": { - "countryName": "Guadeloupe", - "postalCodeFormat": "GP.json", - "alpha2": "GP", - "alpha3": "GLP", - "numeric3": "312" - }, - "GUM": { - "countryName": "Guam", - "postalCodeFormat": "US.json", - "alpha2": "GU", - "alpha3": "GUM", - "numeric3": "316" - }, - "GTM": { - "countryName": "Guatemala", - "postalCodeFormat": "5Digits.json", - "alpha2": "GT", - "alpha3": "GTM", - "numeric3": "320" - }, - "GGY": { - "countryName": "Guernsey", - "postalCodeFormat": "GG.json", - "alpha2": "GG", - "alpha3": "GGY", - "numeric3": "831" - }, - "GIN": { - "countryName": "Guinea", - "postalCodeFormat": "3Digits.json", - "alpha2": "GN", - "alpha3": "GIN", - "numeric3": "324" - }, - "GNB": { - "countryName": "Guinea-Bissau", - "postalCodeFormat": "4Digits.json", - "alpha2": "GW", - "alpha3": "GNB", - "numeric3": "624" - }, - "GUY": { - "countryName": "Guyana", - "alpha2": "GY", - "alpha3": "GUY", - "numeric3": "328" - }, - "HTI": { - "countryName": "Haiti", - "postalCodeFormat": "4Digits.json", - "alpha2": "HT", - "alpha3": "HTI", - "numeric3": "332" - }, - "HMD": { - "countryName": "Heard Island and Mcdonald Islands", - "postalCodeFormat": "4Digits.json", - "alpha2": "HM", - "alpha3": "HMD", - "numeric3": "334" - }, - "VAT": { - "countryName": "Holy See (Vatican City State)", - "postalCodeFormat": "VA.json", - "alpha2": "VA", - "alpha3": "VAT", - "numeric3": "336" - }, - "HND": { - "countryName": "Honduras", - "postalCodeFormat": "HN.json", - "alpha2": "HN", - "alpha3": "HND", - "numeric3": "340" - }, - "HUN": { - "countryName": "Hungary", - "postalCodeFormat": "4Digits.json", - "alpha2": "HU", - "alpha3": "HUN", - "numeric3": "348" - }, - "ISL": { - "countryName": "Iceland", - "postalCodeFormat": "3Digits.json", - "alpha2": "IS", - "alpha3": "ISL", - "numeric3": "352" - }, - "IND": { - "countryName": "India", - "postalCodeFormat": "6Digits.json", - "alpha2": "IN", - "alpha3": "IND", - "numeric3": "356" - }, - "IDN": { - "countryName": "Indonesia", - "postalCodeFormat": "5Digits.json", - "alpha2": "ID", - "alpha3": "IDN", - "numeric3": "360" - }, - "IRN": { - "countryName": "Iran, Islamic Republic of", - "postalCodeFormat": "10Digits.json", - "alpha2": "IR", - "alpha3": "IRN", - "numeric3": "364" - }, - "IRQ": { - "countryName": "Iraq", - "postalCodeFormat": "5Digits.json", - "alpha2": "IQ", - "alpha3": "IRQ", - "numeric3": "368" - }, - "IRL": { - "countryName": "Ireland", - "postalCodeFormat": "IE.json", - "alpha2": "IE", - "alpha3": "IRL", - "numeric3": "372" - }, - "IMN": { - "countryName": "Isle of Man", - "postalCodeFormat": "IM.json", - "alpha2": "IM", - "alpha3": "IMN", - "numeric3": "833" - }, - "ISR": { - "countryName": "Israel", - "postalCodeFormat": "7Digits.json", - "alpha2": "IL", - "alpha3": "ISR", - "numeric3": "376" - }, - "ITA": { - "countryName": "Italy", - "postalCodeFormat": "5Digits.json", - "alpha2": "IT", - "alpha3": "ITA", - "numeric3": "380" - }, - "JAM": { - "countryName": "Jamaica", - "postalCodeFormat": "2Digits.json", - "alpha2": "JM", - "alpha3": "JAM", - "numeric3": "388" - }, - "JPN": { - "countryName": "Japan", - "postalCodeFormat": "7Digits.json", - "alpha2": "JP", - "alpha3": "JPN", - "numeric3": "392" - }, - "JEY": { - "countryName": "Jersey", - "postalCodeFormat": "JE.json", - "alpha2": "JE", - "alpha3": "JEY", - "numeric3": "832" - }, - "JOR": { - "countryName": "Jordan", - "postalCodeFormat": "5Digits.json", - "alpha2": "JO", - "alpha3": "JOR", - "numeric3": "400" - }, - "KAZ": { - "countryName": "Kazakhstan", - "postalCodeFormat": "6Digits.json", - "alpha2": "KZ", - "alpha3": "KAZ", - "numeric3": "398" - }, - "KEN": { - "countryName": "Kenya", - "postalCodeFormat": "5Digits.json", - "alpha2": "KE", - "alpha3": "KEN", - "numeric3": "404" - }, - "KIR": { - "countryName": "Kiribati", - "alpha2": "KI", - "alpha3": "KIR", - "numeric3": "296" - }, - "PRK": { - "countryName": "Korea, Democratic People's Republic of", - "alpha2": "KP", - "alpha3": "PRK", - "numeric3": "408" - }, - "KOR": { - "countryName": "Korea, Republic of", - "postalCodeFormat": "5Digits.json", - "alpha2": "KR", - "alpha3": "KOR", - "numeric3": "410" - }, - "KWT": { - "countryName": "Kuwait", - "postalCodeFormat": "5Digits.json", - "alpha2": "KW", - "alpha3": "KWT", - "numeric3": "414" - }, - "KGZ": { - "countryName": "Kyrgyzstan", - "postalCodeFormat": "6Digits.json", - "alpha2": "KG", - "alpha3": "KGZ", - "numeric3": "417" - }, - "LAO": { - "countryName": "Lao PDR", - "postalCodeFormat": "5Digits.json", - "alpha2": "LA", - "alpha3": "LAO", - "numeric3": "418" - }, - "LVA": { - "countryName": "Latvia", - "postalCodeFormat": "LV.json", - "alpha2": "LV", - "alpha3": "LVA", - "numeric3": "428" - }, - "LBN": { - "countryName": "Lebanon", - "postalCodeFormat": "LB.json", - "alpha2": "LB", - "alpha3": "LBN", - "numeric3": "422" - }, - "LSO": { - "countryName": "Lesotho", - "postalCodeFormat": "3Digits.json", - "alpha2": "LS", - "alpha3": "LSO", - "numeric3": "426" - }, - "LBR": { - "countryName": "Liberia", - "postalCodeFormat": "4Digits.json", - "alpha2": "LR", - "alpha3": "LBR", - "numeric3": "430" - }, - "LBY": { - "countryName": "Libya", - "postalCodeFormat": "5Digits.json", - "alpha2": "LY", - "alpha3": "LBY", - "numeric3": "434" - }, - "LIE": { - "countryName": "Liechtenstein", - "postalCodeFormat": "4Digits.json", - "alpha2": "LI", - "alpha3": "LIE", - "numeric3": "438" - }, - "LTU": { - "countryName": "Lithuania", - "postalCodeFormat": "LT.json", - "alpha2": "LT", - "alpha3": "LTU", - "numeric3": "440" - }, - "LUX": { - "countryName": "Luxembourg", - "postalCodeFormat": "LU.json", - "alpha2": "LU", - "alpha3": "LUX", - "numeric3": "442" - }, - "MKD": { - "countryName": "Macedonia, Republic of", - "postalCodeFormat": "4Digits.json", - "alpha2": "MK", - "alpha3": "MKD", - "numeric3": "807" - }, - "MDG": { - "countryName": "Madagascar", - "postalCodeFormat": "3Digits.json", - "alpha2": "MG", - "alpha3": "MDG", - "numeric3": "450" - }, - "MWI": { - "countryName": "Malawi", - "alpha2": "MW", - "alpha3": "MWI", - "numeric3": "454" - }, - "MYS": { - "countryName": "Malaysia", - "postalCodeFormat": "5Digits.json", - "alpha2": "MY", - "alpha3": "MYS", - "numeric3": "458" - }, - "MDV": { - "countryName": "Maldives", - "postalCodeFormat": "5Digits.json", - "alpha2": "MV", - "alpha3": "MDV", - "numeric3": "462" - }, - "MLI": { - "countryName": "Mali", - "alpha2": "ML", - "alpha3": "MLI", - "numeric3": "466" - }, - "MLT": { - "countryName": "Malta", - "postalCodeFormat": "MT.json", - "alpha2": "MT", - "alpha3": "MLT", - "numeric3": "470" - }, - "MHL": { - "countryName": "Marshall Islands", - "postalCodeFormat": "US.json", - "alpha2": "MH", - "alpha3": "MHL", - "numeric3": "584" - }, - "MTQ": { - "countryName": "Martinique", - "postalCodeFormat": "5Digits.json", - "alpha2": "MQ", - "alpha3": "MTQ", - "numeric3": "474" - }, - "MRT": { - "countryName": "Mauritania", - "alpha2": "MR", - "alpha3": "MRT", - "numeric3": "478" - }, - "MUS": { - "countryName": "Mauritius", - "postalCodeFormat": "5Digits.json", - "alpha2": "MU", - "alpha3": "MUS", - "numeric3": "480" - }, - "MYT": { - "countryName": "Mayotte", - "postalCodeFormat": "5Digits.json", - "alpha2": "YT", - "alpha3": "MYT", - "numeric3": "175" - }, - "MEX": { - "countryName": "Mexico", - "postalCodeFormat": "5Digits.json", - "alpha2": "MX", - "alpha3": "MEX", - "numeric3": "484" - }, - "FSM": { - "countryName": "Micronesia, Federated States of", - "postalCodeFormat": "US.json", - "alpha2": "FM", - "alpha3": "FSM", - "numeric3": "583" - }, - "MDA": { - "countryName": "Moldova", - "postalCodeFormat": "MD.json", - "alpha2": "MD", - "alpha3": "MDA", - "numeric3": "498" - }, - "MCO": { - "countryName": "Monaco", - "postalCodeFormat": "MC.json", - "alpha2": "MC", - "alpha3": "MCO", - "numeric3": "492" - }, - "MNG": { - "countryName": "Mongolia", - "postalCodeFormat": "5Digits.json", - "alpha2": "MN", - "alpha3": "MNG", - "numeric3": "496" - }, - "MNE": { - "countryName": "Montenegro", - "postalCodeFormat": "5Digits.json", - "alpha2": "ME", - "alpha3": "MNE", - "numeric3": "499" - }, - "MSR": { - "countryName": "Montserrat", - "postalCodeFormat": "MS.json", - "alpha2": "MS", - "alpha3": "MSR", - "numeric3": "500" - }, - "MAR": { - "countryName": "Morocco", - "postalCodeFormat": "5Digits.json", - "alpha2": "MA", - "alpha3": "MAR", - "numeric3": "504" - }, - "MOZ": { - "countryName": "Mozambique", - "postalCodeFormat": "4Digits.json", - "alpha2": "MZ", - "alpha3": "MOZ", - "numeric3": "508" - }, - "MMR": { - "countryName": "Myanmar", - "postalCodeFormat": "5Digits.json", - "alpha2": "MM", - "alpha3": "MMR", - "numeric3": "104" - }, - "NAM": { - "countryName": "Namibia", - "postalCodeFormat": "5Digits.json", - "alpha2": "NA", - "alpha3": "NAM", - "numeric3": "516" - }, - "NRU": { - "countryName": "Nauru", - "alpha2": "NR", - "alpha3": "NRU", - "numeric3": "520" - }, - "NPL": { - "countryName": "Nepal", - "postalCodeFormat": "5Digits.json", - "alpha2": "NP", - "alpha3": "NPL", - "numeric3": "524" - }, - "NLD": { - "countryName": "Netherlands", - "postalCodeFormat": "NL.json", - "alpha2": "NL", - "alpha3": "NLD", - "numeric3": "528" - }, - "ANT": { - "countryName": "Netherlands Antilles", - "alpha2": "AN", - "alpha3": "ANT", - "numeric3": "530" - }, - "NCL": { - "countryName": "New Caledonia", - "postalCodeFormat": "NC.json", - "alpha2": "NC", - "alpha3": "NCL", - "numeric3": "540" - }, - "NZL": { - "countryName": "New Zealand", - "postalCodeFormat": "4Digits.json", - "alpha2": "NZ", - "alpha3": "NZL", - "numeric3": "554" - }, - "NIC": { - "countryName": "Nicaragua", - "postalCodeFormat": "5Digits.json", - "alpha2": "NI", - "alpha3": "NIC", - "numeric3": "558" - }, - "NER": { - "countryName": "Niger", - "postalCodeFormat": "4Digits.json", - "alpha2": "NE", - "alpha3": "NER", - "numeric3": "562" - }, - "NGA": { - "countryName": "Nigeria", - "postalCodeFormat": "6Digits.json", - "alpha2": "NG", - "alpha3": "NGA", - "numeric3": "566" - }, - "NIU": { - "countryName": "Niue", - "alpha2": "NU", - "alpha3": "NIU", - "numeric3": "570" - }, - "NFK": { - "countryName": "Norfolk Island", - "postalCodeFormat": "4Digits.json", - "alpha2": "NF", - "alpha3": "NFK", - "numeric3": "574" - }, - "MNP": { - "countryName": "Northern Mariana Islands", - "postalCodeFormat": "US.json", - "alpha2": "MP", - "alpha3": "MNP", - "numeric3": "580" - }, - "NOR": { - "countryName": "Norway", - "postalCodeFormat": "4Digits.json", - "alpha2": "NO", - "alpha3": "NOR", - "numeric3": "578" - }, - "OMN": { - "countryName": "Oman", - "postalCodeFormat": "3Digits.json", - "alpha2": "OM", - "alpha3": "OMN", - "numeric3": "512" - }, - "PAK": { - "countryName": "Pakistan", - "postalCodeFormat": "5Digits.json", - "alpha2": "PK", - "alpha3": "PAK", - "numeric3": "586" - }, - "PLW": { - "countryName": "Palau", - "postalCodeFormat": "US.json", - "alpha2": "PW", - "alpha3": "PLW", - "numeric3": "585" - }, - "PSE": { - "countryName": "Palestinian Territory, Occupied", - "postalCodeFormat": "3Digits.json", - "alpha2": "PS", - "alpha3": "PSE", - "numeric3": "275" - }, - "PAN": { - "countryName": "Panama", - "postalCodeFormat": "4Digits.json", - "alpha2": "PA", - "alpha3": "PAN", - "numeric3": "591" - }, - "PNG": { - "countryName": "Papua New Guinea", - "postalCodeFormat": "3Digits.json", - "alpha2": "PG", - "alpha3": "PNG", - "numeric3": "598" - }, - "PRY": { - "countryName": "Paraguay", - "postalCodeFormat": "4Digits.json", - "alpha2": "PY", - "alpha3": "PRY", - "numeric3": "600" - }, - "PER": { - "countryName": "Peru", - "postalCodeFormat": "5Digits.json", - "alpha2": "PE", - "alpha3": "PER", - "numeric3": "604" - }, - "PHL": { - "countryName": "Philippines", - "postalCodeFormat": "4Digits.json", - "alpha2": "PH", - "alpha3": "PHL", - "numeric3": "608" - }, - "PCN": { - "countryName": "Pitcairn", - "postalCodeFormat": "PN.json", - "alpha2": "PN", - "alpha3": "PCN", - "numeric3": "612" - }, - "POL": { - "countryName": "Poland", - "postalCodeFormat": "PL.json", - "alpha2": "PL", - "alpha3": "POL", - "numeric3": "616" - }, - "PRT": { - "countryName": "Portugal", - "postalCodeFormat": "PT.json", - "alpha2": "PT", - "alpha3": "PRT", - "numeric3": "620" - }, - "PRI": { - "countryName": "Puerto Rico", - "postalCodeFormat": "US.json", - "alpha2": "PR", - "alpha3": "PRI", - "numeric3": "630" - }, - "QAT": { - "countryName": "Qatar", - "alpha2": "QA", - "alpha3": "QAT", - "numeric3": "634" - }, - "REU": { - "countryName": "Réunion", - "postalCodeFormat": "RE.json", - "alpha2": "RE", - "alpha3": "REU", - "numeric3": "638" - }, - "ROU": { - "countryName": "Romania", - "postalCodeFormat": "6Digits.json", - "alpha2": "RO", - "alpha3": "ROU", - "numeric3": "642" - }, - "RUS": { - "countryName": "Russian Federation", - "postalCodeFormat": "RU.json", - "alpha2": "RU", - "alpha3": "RUS", - "numeric3": "643" - }, - "RWA": { - "countryName": "Rwanda", - "alpha2": "RW", - "alpha3": "RWA", - "numeric3": "646" - }, - "BLM": { - "countryName": "Saint-Barthélemy", - "postalCodeFormat": "BL.json", - "alpha2": "BL", - "alpha3": "BLM", - "numeric3": "652" - }, - "SHN": { - "countryName": "Saint Helena", - "postalCodeFormat": "SH.json", - "alpha2": "SH", - "alpha3": "SHN", - "numeric3": "654" - }, - "KNA": { - "countryName": "Saint Kitts and Nevis", - "alpha2": "KN", - "alpha3": "KNA", - "numeric3": "659" - }, - "LCA": { - "countryName": "Saint Lucia", - "postalCodeFormat": "LC.json", - "alpha2": "LC", - "alpha3": "LCA", - "numeric3": "662" - }, - "MAF": { - "countryName": "Saint-Martin (French part)", - "postalCodeFormat": "MF.json", - "alpha2": "MF", - "alpha3": "MAF", - "numeric3": "663" - }, - "SPM": { - "countryName": "Saint Pierre and Miquelon", - "postalCodeFormat": "PM.json", - "alpha2": "PM", - "alpha3": "SPM", - "numeric3": "666" - }, - "VCT": { - "countryName": "Saint Vincent and Grenadines", - "postalCodeFormat": "VC.json", - "alpha2": "VC", - "alpha3": "VCT", - "numeric3": "670" - }, - "WSM": { - "countryName": "Samoa", - "postalCodeFormat": "WS.json", - "alpha2": "WS", - "alpha3": "WSM", - "numeric3": "882" - }, - "SMR": { - "countryName": "San Marino", - "postalCodeFormat": "SM.json", - "alpha2": "SM", - "alpha3": "SMR", - "numeric3": "674" - }, - "STP": { - "countryName": "Sao Tome and Principe", - "alpha2": "ST", - "alpha3": "STP", - "numeric3": "678" - }, - "SAU": { - "countryName": "Saudi Arabia", - "postalCodeFormat": "US.json", - "alpha2": "SA", - "alpha3": "SAU", - "numeric3": "682" - }, - "SEN": { - "countryName": "Senegal", - "postalCodeFormat": "5Digits.json", - "alpha2": "SN", - "alpha3": "SEN", - "numeric3": "686" - }, - "SRB": { - "countryName": "Serbia", - "postalCodeFormat": "5Digits.json", - "alpha2": "RS", - "alpha3": "SRB", - "numeric3": "688" - }, - "SYC": { - "countryName": "Seychelles", - "alpha2": "SC", - "alpha3": "SYC", - "numeric3": "690" - }, - "SLE": { - "countryName": "Sierra Leone", - "alpha2": "SL", - "alpha3": "SLE", - "numeric3": "694" - }, - "SGP": { - "countryName": "Singapore", - "postalCodeFormat": "6Digits.json", - "alpha2": "SG", - "alpha3": "SGP", - "numeric3": "702" - }, - "SVK": { - "countryName": "Slovakia", - "postalCodeFormat": "5Digits.json", - "alpha2": "SK", - "alpha3": "SVK", - "numeric3": "703" - }, - "SVN": { - "countryName": "Slovenia", - "postalCodeFormat": "4Digits.json", - "alpha2": "SI", - "alpha3": "SVN", - "numeric3": "705" - }, - "SLB": { - "countryName": "Solomon Islands", - "alpha2": "SB", - "alpha3": "SLB", - "numeric3": "90" - }, - "SOM": { - "countryName": "Somalia", - "postalCodeFormat": "SO.json", - "alpha2": "SO", - "alpha3": "SOM", - "numeric3": "706" - }, - "ZAF": { - "countryName": "South Africa", - "postalCodeFormat": "4Digits.json", - "alpha2": "ZA", - "alpha3": "ZAF", - "numeric3": "710" - }, - "SGS": { - "countryName": "South Georgia and the South Sandwich Islands", - "postalCodeFormat": "GS.json", - "alpha2": "GS", - "alpha3": "SGS", - "numeric3": "239" - }, - "SSD": { - "countryName": "South Sudan", - "alpha2": "SS", - "alpha3": "SSD", - "numeric3": "728" - }, - "ESP": { - "countryName": "Spain", - "postalCodeFormat": "5Digits.json", - "alpha2": "ES", - "alpha3": "ESP", - "numeric3": "724" - }, - "LKA": { - "countryName": "Sri Lanka", - "postalCodeFormat": "5Digits.json", - "alpha2": "LK", - "alpha3": "LKA", - "numeric3": "144" - }, - "SDN": { - "countryName": "Sudan", - "postalCodeFormat": "5Digits.json", - "alpha2": "SD", - "alpha3": "SDN", - "numeric3": "736" - }, - "SUR": { - "countryName": "Suriname *", - "alpha2": "SR", - "alpha3": "SUR", - "numeric3": "740" - }, - "SJM": { - "countryName": "Svalbard and Jan Mayen Islands", - "postalCodeFormat": "4Digits.json", - "alpha2": "SJ", - "alpha3": "SJM", - "numeric3": "744" - }, - "SWZ": { - "countryName": "Swaziland", - "postalCodeFormat": "SZ.json", - "alpha2": "SZ", - "alpha3": "SWZ", - "numeric3": "748" - }, - "SWE": { - "countryName": "Sweden", - "postalCodeFormat": "5Digits.json", - "alpha2": "SE", - "alpha3": "SWE", - "numeric3": "752" - }, - "CHE": { - "countryName": "Switzerland", - "postalCodeFormat": "4Digits.json", - "alpha2": "CH", - "alpha3": "CHE", - "numeric3": "756" - }, - "SYR": { - "countryName": "Syrian Arab Republic (Syria)", - "alpha2": "SY", - "alpha3": "SYR", - "numeric3": "760" - }, - "TWN": { - "countryName": "Taiwan, Republic of China", - "postalCodeFormat": "TW.json", - "alpha2": "TW", - "alpha3": "TWN", - "numeric3": "158" - }, - "TJK": { - "countryName": "Tajikistan", - "postalCodeFormat": "6Digits.json", - "alpha2": "TJ", - "alpha3": "TJK", - "numeric3": "762" - }, - "TZA": { - "countryName": "Tanzania *, United Republic of", - "postalCodeFormat": "5Digits.json", - "alpha2": "TZ", - "alpha3": "TZA", - "numeric3": "834" - }, - "THA": { - "countryName": "Thailand", - "postalCodeFormat": "5Digits.json", - "alpha2": "TH", - "alpha3": "THA", - "numeric3": "764" - }, - "TLS": { - "countryName": "Timor-Leste", - "alpha2": "TL", - "alpha3": "TLS", - "numeric3": "626" - }, - "TGO": { - "countryName": "Togo", - "alpha2": "TG", - "alpha3": "TGO", - "numeric3": "768" - }, - "TKL": { - "countryName": "Tokelau", - "alpha2": "TK", - "alpha3": "TKL", - "numeric3": "772" - }, - "TON": { - "countryName": "Tonga", - "alpha2": "TO", - "alpha3": "TON", - "numeric3": "776" - }, - "TTO": { - "countryName": "Trinidad and Tobago", - "postalCodeFormat": "6Digits.json", - "alpha2": "TT", - "alpha3": "TTO", - "numeric3": "780" - }, - "TUN": { - "countryName": "Tunisia", - "postalCodeFormat": "4Digits.json", - "alpha2": "TN", - "alpha3": "TUN", - "numeric3": "788" - }, - "TUR": { - "countryName": "Turkey", - "postalCodeFormat": "5Digits.json", - "alpha2": "TR", - "alpha3": "TUR", - "numeric3": "792" - }, - "TKM": { - "countryName": "Turkmenistan", - "postalCodeFormat": "6Digits.json", - "alpha2": "TM", - "alpha3": "TKM", - "numeric3": "795" - }, - "TCA": { - "countryName": "Turks and Caicos Islands", - "postalCodeFormat": "TC.json", - "alpha2": "TC", - "alpha3": "TCA", - "numeric3": "796" - }, - "TUV": { - "countryName": "Tuvalu", - "alpha2": "TV", - "alpha3": "TUV", - "numeric3": "798" - }, - "UGA": { - "countryName": "Uganda", - "alpha2": "UG", - "alpha3": "UGA", - "numeric3": "800" - }, - "UKR": { - "countryName": "Ukraine", - "postalCodeFormat": "5Digits.json", - "alpha2": "UA", - "alpha3": "UKR", - "numeric3": "804" - }, - "ARE": { - "countryName": "United Arab Emirates", - "alpha2": "AE", - "alpha3": "ARE", - "numeric3": "784" - }, - "GBR": { - "countryName": "United Kingdom", - "postalCodeFormat": "GB.json", - "alpha2": "GB", - "alpha3": "GBR", - "numeric3": "826" - }, - "USA": { - "countryName": "United States of America", - "postalCodeFormat": "US.json", - "alpha2": "US", - "alpha3": "USA", - "numeric3": "840" - }, - "UMI": { - "countryName": "United States Minor Outlying Islands", - "alpha2": "UM", - "alpha3": "UMI", - "numeric3": "581" - }, - "URY": { - "countryName": "Uruguay", - "postalCodeFormat": "5Digits.json", - "alpha2": "UY", - "alpha3": "URY", - "numeric3": "858" - }, - "UZB": { - "countryName": "Uzbekistan", - "postalCodeFormat": "6Digits.json", - "alpha2": "UZ", - "alpha3": "UZB", - "numeric3": "860" - }, - "VUT": { - "countryName": "Vanuatu", - "alpha2": "VU", - "alpha3": "VUT", - "numeric3": "548" - }, - "VEN": { - "countryName": "Venezuela (Bolivarian Republic of)", - "postalCodeFormat": "VE.json", - "alpha2": "VE", - "alpha3": "VEN", - "numeric3": "862" - }, - "VNM": { - "countryName": "Viet Nam", - "postalCodeFormat": "6Digits.json", - "alpha2": "VN", - "alpha3": "VNM", - "numeric3": "704" - }, - "VIR": { - "countryName": "Virgin Islands, US", - "postalCodeFormat": "US.json", - "alpha2": "VI", - "alpha3": "VIR", - "numeric3": "850" - }, - "WLF": { - "countryName": "Wallis and Futuna Islands", - "postalCodeFormat": "WF.json", - "alpha2": "WF", - "alpha3": "WLF", - "numeric3": "876" - }, - "ESH": { - "countryName": "Western Sahara", - "alpha2": "EH", - "alpha3": "ESH", - "numeric3": "732" - }, - "YEM": { - "countryName": "Yemen", - "alpha2": "YE", - "alpha3": "YEM", - "numeric3": "887" - }, - "ZMB": { - "countryName": "Zambia", - "postalCodeFormat": "5Digits.json", - "alpha2": "ZM", - "alpha3": "ZMB", - "numeric3": "894" - }, - "ZWE": { - "countryName": "Zimbabwe", - "alpha2": "ZW", - "alpha3": "ZWE", - "numeric3": "716" - } -} \ No newline at end of file diff --git a/index.d.ts b/index.d.ts index bc9da55..9066910 100644 --- a/index.d.ts +++ b/index.d.ts @@ -11,4 +11,4 @@ export function validate( countryCode: string, postalCode: string | number -): boolean | string; +): boolean; diff --git a/mappings/alpha2-to-formats.json b/mappings/alpha2-to-formats.json deleted file mode 100644 index e28b7da..0000000 --- a/mappings/alpha2-to-formats.json +++ /dev/null @@ -1,322 +0,0 @@ -{ - "2Digits.json": [ - "JM" - ], - "3Digits.json": [ - "FO", - "GN", - "IS", - "LS", - "MG", - "OM", - "PG", - "PS" - ], - "4Digits.json": [ - "AF", - "AL", - "AM", - "AR", - "AT", - "AU", - "BD", - "BE", - "BE", - "BG", - "BO", - "CC", - "CH", - "CV", - "CX", - "CY", - "CY", - "ET", - "GE", - "GL", - "GW", - "HM", - "HT", - "HU", - "LI", - "LR", - "MK", - "MZ", - "NE", - "NF", - "NO", - "NO", - "NZ", - "PA", - "PH", - "PY", - "SI", - "SJ", - "SV", - "TN", - "ZA" - ], - "5Digits.json": [ - "AS", - "BA", - "BT", - "CR", - "CU", - "CZ", - "DE", - "DO", - "DZ", - "EE", - "EG", - "ES", - "FI", - "FR", - "GR", - "GT", - "HR", - "HR", - "IC", - "ID", - "IQ", - "IT", - "JO", - "KE", - "KH", - "KR", - "KW", - "LA", - "LK", - "LY", - "MA", - "ME", - "MM", - "MN", - "MQ", - "MU", - "MX", - "MV", - "MY", - "NA", - "NI", - "NP", - "PE", - "PK", - "RS", - "SD", - "SE", - "SK", - "SN", - "TD", - "TH", - "TR", - "TZ", - "UA", - "UY", - "XK", - "YT", - "ZM" - ], - "6Digits.json": [ - "BY", - "CN", - "CO", - "EC", - "IN", - "KG", - "KZ", - "NG", - "RO", - "SG", - "TJ", - "TM", - "TT", - "UZ", - "VN" - ], - "7Digits.json": [ - "CL", - "IL", - "JP" - ], - "8Digits.json": [ - "BR" - ], - "10Digits.json": [ - "IR" - ], - "AD.json": [ - "AD" - ], - "AI.json": [ - "AI" - ], - "AQ.json": [ - "AQ" - ], - "AX.json": [ - "AX" - ], - "AZ.json": [ - "AZ" - ], - "BB.json": [ - "BB" - ], - "BH.json": [ - "BH" - ], - "BL.json": [ - "BL" - ], - "BN.json": [ - "BN" - ], - "CA.json": [ - "CA" - ], - "DK.json": [ - "DK" - ], - "FK.json": [ - "FK" - ], - "GB.json": [ - "GB" - ], - "GF.json": [ - "GF" - ], - "GG.json": [ - "GG" - ], - "GI.json": [ - "GI" - ], - "GP.json": [ - "GP" - ], - "GS.json": [ - "GS" - ], - "HN.json": [ - "HN" - ], - "IE.json": [ - "IE" - ], - "IM.json": [ - "IM" - ], - "IO.json": [ - "IO" - ], - "JE.json": [ - "JE" - ], - "KY.json": [ - "KY" - ], - "LB.json": [ - "LB" - ], - "LC.json": [ - "LC" - ], - "LT.json": [ - "LT" - ], - "LU.json": [ - "LU" - ], - "LV.json": [ - "LV" - ], - "MC.json": [ - "MC" - ], - "MD.json": [ - "MD" - ], - "MF.json": [ - "MF" - ], - "MS.json": [ - "MS" - ], - "MT.json": [ - "MT" - ], - "NC.json": [ - "NC" - ], - "NL.json": [ - "NL" - ], - "PF.json": [ - "PF" - ], - "PL.json": [ - "PL" - ], - "PM.json": [ - "PM" - ], - "PN.json": [ - "PN" - ], - "PT.json": [ - "PT" - ], - "RE.json": [ - "RE" - ], - "RU.json": [ - "RU" - ], - "SH.json": [ - "SH" - ], - "SM.json": [ - "SM" - ], - "SO.json": [ - "SO" - ], - "SZ.json": [ - "SZ" - ], - "TC.json": [ - "TC" - ], - "TW.json": [ - "TW" - ], - "US.json": [ - "FM", - "GU", - "MH", - "MP", - "PR", - "PW", - "SA", - "US", - "VI" - ], - "VA.json": [ - "VA" - ], - "VE.json": [ - "VE" - ], - "VC.json": [ - "VC" - ], - "VG.json": [ - "VG" - ], - "WF.json": [ - "WF" - ], - "WS.json": [ - "WS" - ] -} diff --git a/mappings/iso-3-country-code-mapping.json b/mappings/iso-3-country-code-mapping.json deleted file mode 100644 index 759cdea..0000000 --- a/mappings/iso-3-country-code-mapping.json +++ /dev/null @@ -1,1237 +0,0 @@ -{ - "AFG": { - "iso2CountryCode": "AF", - "countryName": "Afghanistan", - "isoNumericCountryCode": "4" - }, - "ALA": { - "iso2CountryCode": "AX", - "countryName": "Aland Islands", - "isoNumericCountryCode": "248" - }, - "ALB": { - "iso2CountryCode": "AL", - "countryName": "Albania", - "isoNumericCountryCode": "8" - }, - "DZA": { - "iso2CountryCode": "DZ", - "countryName": "Algeria", - "isoNumericCountryCode": "12" - }, - "ASM": { - "iso2CountryCode": "AS", - "countryName": "American Samoa", - "isoNumericCountryCode": "16" - }, - "AND": { - "iso2CountryCode": "AD", - "countryName": "Andorra", - "isoNumericCountryCode": "20" - }, - "AGO": { - "iso2CountryCode": "AO", - "countryName": "Angola", - "isoNumericCountryCode": "24" - }, - "AIA": { - "iso2CountryCode": "AI", - "countryName": "Anguilla", - "isoNumericCountryCode": "660" - }, - "ATA": { - "iso2CountryCode": "AQ", - "countryName": "Antarctica", - "isoNumericCountryCode": "10" - }, - "ATG": { - "iso2CountryCode": "AG", - "countryName": "Antigua and Barbuda", - "isoNumericCountryCode": "28" - }, - "ARG": { - "iso2CountryCode": "AR", - "countryName": "Argentina", - "isoNumericCountryCode": "32" - }, - "ARM": { - "iso2CountryCode": "AM", - "countryName": "Armenia", - "isoNumericCountryCode": "51" - }, - "ABW": { - "iso2CountryCode": "AW", - "countryName": "Aruba", - "isoNumericCountryCode": "533" - }, - "AUS": { - "iso2CountryCode": "AU", - "countryName": "Australia", - "isoNumericCountryCode": "36" - }, - "AUT": { - "iso2CountryCode": "AT", - "countryName": "Austria", - "isoNumericCountryCode": "40" - }, - "AZE": { - "iso2CountryCode": "AZ", - "countryName": "Azerbaijan", - "isoNumericCountryCode": "31" - }, - "BHS": { - "iso2CountryCode": "BS", - "countryName": "Bahamas", - "isoNumericCountryCode": "44" - }, - "BHR": { - "iso2CountryCode": "BH", - "countryName": "Bahrain", - "isoNumericCountryCode": "48" - }, - "BGD": { - "iso2CountryCode": "BD", - "countryName": "Bangladesh", - "isoNumericCountryCode": "50" - }, - "BRB": { - "iso2CountryCode": "BB", - "countryName": "Barbados", - "isoNumericCountryCode": "52" - }, - "BLR": { - "iso2CountryCode": "BY", - "countryName": "Belarus", - "isoNumericCountryCode": "112" - }, - "BEL": { - "iso2CountryCode": "BE", - "countryName": "Belgium", - "isoNumericCountryCode": "56" - }, - "BLZ": { - "iso2CountryCode": "BZ", - "countryName": "Belize", - "isoNumericCountryCode": "84" - }, - "BEN": { - "iso2CountryCode": "BJ", - "countryName": "Benin", - "isoNumericCountryCode": "204" - }, - "BMU": { - "iso2CountryCode": "BM", - "countryName": "Bermuda", - "isoNumericCountryCode": "60" - }, - "BTN": { - "iso2CountryCode": "BT", - "countryName": "Bhutan", - "isoNumericCountryCode": "64" - }, - "BOL": { - "iso2CountryCode": "BO", - "countryName": "Bolivia", - "isoNumericCountryCode": "68" - }, - "BIH": { - "iso2CountryCode": "BA", - "countryName": "Bosnia and Herzegovina", - "isoNumericCountryCode": "70" - }, - "BWA": { - "iso2CountryCode": "BW", - "countryName": "Botswana", - "isoNumericCountryCode": "72" - }, - "BVT": { - "iso2CountryCode": "BV", - "countryName": "Bouvet Island", - "isoNumericCountryCode": "74" - }, - "BRA": { - "iso2CountryCode": "BR", - "countryName": "Brazil", - "isoNumericCountryCode": "76" - }, - "VGB": { - "iso2CountryCode": "VG", - "countryName": "British Virgin Islands", - "isoNumericCountryCode": "92" - }, - "IOT": { - "iso2CountryCode": "IO", - "countryName": "British Indian Ocean Territory", - "isoNumericCountryCode": "86" - }, - "BRN": { - "iso2CountryCode": "BN", - "countryName": "Brunei Darussalam", - "isoNumericCountryCode": "96" - }, - "BGR": { - "iso2CountryCode": "BG", - "countryName": "Bulgaria", - "isoNumericCountryCode": "100" - }, - "BFA": { - "iso2CountryCode": "BF", - "countryName": "Burkina Faso", - "isoNumericCountryCode": "854" - }, - "BDI": { - "iso2CountryCode": "BI", - "countryName": "Burundi", - "isoNumericCountryCode": "108" - }, - "KHM": { - "iso2CountryCode": "KH", - "countryName": "Cambodia", - "isoNumericCountryCode": "116" - }, - "CMR": { - "iso2CountryCode": "CM", - "countryName": "Cameroon", - "isoNumericCountryCode": "120" - }, - "CAN": { - "iso2CountryCode": "CA", - "countryName": "Canada", - "isoNumericCountryCode": "124" - }, - "CPV": { - "iso2CountryCode": "CV", - "countryName": "Cape Verde", - "isoNumericCountryCode": "132" - }, - "CYM": { - "iso2CountryCode": "KY", - "countryName": "Cayman Islands", - "isoNumericCountryCode": "136" - }, - "CAF": { - "iso2CountryCode": "CF", - "countryName": "Central African Republic", - "isoNumericCountryCode": "140" - }, - "TCD": { - "iso2CountryCode": "TD", - "countryName": "Chad", - "isoNumericCountryCode": "148" - }, - "CHL": { - "iso2CountryCode": "CL", - "countryName": "Chile", - "isoNumericCountryCode": "152" - }, - "CHN": { - "iso2CountryCode": "CN", - "countryName": "China", - "isoNumericCountryCode": "156" - }, - "HKG": { - "iso2CountryCode": "HK", - "countryName": "Hong Kong, Special Administrative Region of China", - "isoNumericCountryCode": "344" - }, - "MAC": { - "iso2CountryCode": "MO", - "countryName": "Macao, Special Administrative Region of China", - "isoNumericCountryCode": "446" - }, - "CXR": { - "iso2CountryCode": "CX", - "countryName": "Christmas Island", - "isoNumericCountryCode": "162" - }, - "CCK": { - "iso2CountryCode": "CC", - "countryName": "Cocos (Keeling) Islands", - "isoNumericCountryCode": "166" - }, - "COL": { - "iso2CountryCode": "CO", - "countryName": "Colombia", - "isoNumericCountryCode": "170" - }, - "COM": { - "iso2CountryCode": "KM", - "countryName": "Comoros", - "isoNumericCountryCode": "174" - }, - "COG": { - "iso2CountryCode": "CG", - "countryName": "Congo (Brazzaville)", - "isoNumericCountryCode": "178" - }, - "COD": { - "iso2CountryCode": "CD", - "countryName": "Congo, Democratic Republic of the", - "isoNumericCountryCode": "180" - }, - "COK": { - "iso2CountryCode": "CK", - "countryName": "Cook Islands", - "isoNumericCountryCode": "184" - }, - "CRI": { - "iso2CountryCode": "CR", - "countryName": "Costa Rica", - "isoNumericCountryCode": "188" - }, - "CIV": { - "iso2CountryCode": "CI", - "countryName": "Côte d'Ivoire", - "isoNumericCountryCode": "384" - }, - "HRV": { - "iso2CountryCode": "HR", - "countryName": "Croatia", - "isoNumericCountryCode": "191" - }, - "CUB": { - "iso2CountryCode": "CU", - "countryName": "Cuba", - "isoNumericCountryCode": "192" - }, - "CYP": { - "iso2CountryCode": "CY", - "countryName": "Cyprus", - "isoNumericCountryCode": "196" - }, - "CZE": { - "iso2CountryCode": "CZ", - "countryName": "Czech Republic", - "isoNumericCountryCode": "203" - }, - "DNK": { - "iso2CountryCode": "DK", - "countryName": "Denmark", - "isoNumericCountryCode": "208" - }, - "DJI": { - "iso2CountryCode": "DJ", - "countryName": "Djibouti", - "isoNumericCountryCode": "262" - }, - "DMA": { - "iso2CountryCode": "DM", - "countryName": "Dominica", - "isoNumericCountryCode": "212" - }, - "DOM": { - "iso2CountryCode": "DO", - "countryName": "Dominican Republic", - "isoNumericCountryCode": "214" - }, - "ECU": { - "iso2CountryCode": "EC", - "countryName": "Ecuador", - "isoNumericCountryCode": "218" - }, - "EGY": { - "iso2CountryCode": "EG", - "countryName": "Egypt", - "isoNumericCountryCode": "818" - }, - "SLV": { - "iso2CountryCode": "SV", - "countryName": "El Salvador", - "isoNumericCountryCode": "222" - }, - "GNQ": { - "iso2CountryCode": "GQ", - "countryName": "Equatorial Guinea", - "isoNumericCountryCode": "226" - }, - "ERI": { - "iso2CountryCode": "ER", - "countryName": "Eritrea", - "isoNumericCountryCode": "232" - }, - "EST": { - "iso2CountryCode": "EE", - "countryName": "Estonia", - "isoNumericCountryCode": "233" - }, - "ETH": { - "iso2CountryCode": "ET", - "countryName": "Ethiopia", - "isoNumericCountryCode": "231" - }, - "FLK": { - "iso2CountryCode": "FK", - "countryName": "Falkland Islands (Malvinas)", - "isoNumericCountryCode": "238" - }, - "FRO": { - "iso2CountryCode": "FO", - "countryName": "Faroe Islands", - "isoNumericCountryCode": "234" - }, - "FJI": { - "iso2CountryCode": "FJ", - "countryName": "Fiji", - "isoNumericCountryCode": "242" - }, - "FIN": { - "iso2CountryCode": "FI", - "countryName": "Finland", - "isoNumericCountryCode": "246" - }, - "FRA": { - "iso2CountryCode": "FR", - "countryName": "France", - "isoNumericCountryCode": "250" - }, - "GUF": { - "iso2CountryCode": "GF", - "countryName": "French Guiana", - "isoNumericCountryCode": "254" - }, - "PYF": { - "iso2CountryCode": "PF", - "countryName": "French Polynesia", - "isoNumericCountryCode": "258" - }, - "ATF": { - "iso2CountryCode": "TF", - "countryName": "French Southern Territories", - "isoNumericCountryCode": "260" - }, - "GAB": { - "iso2CountryCode": "GA", - "countryName": "Gabon", - "isoNumericCountryCode": "266" - }, - "GMB": { - "iso2CountryCode": "GM", - "countryName": "Gambia", - "isoNumericCountryCode": "270" - }, - "GEO": { - "iso2CountryCode": "GE", - "countryName": "Georgia", - "isoNumericCountryCode": "268" - }, - "DEU": { - "iso2CountryCode": "DE", - "countryName": "Germany", - "isoNumericCountryCode": "276" - }, - "GHA": { - "iso2CountryCode": "GH", - "countryName": "Ghana", - "isoNumericCountryCode": "288" - }, - "GIB": { - "iso2CountryCode": "GI", - "countryName": "Gibraltar", - "isoNumericCountryCode": "292" - }, - "GRC": { - "iso2CountryCode": "GR", - "countryName": "Greece", - "isoNumericCountryCode": "300" - }, - "GRL": { - "iso2CountryCode": "GL", - "countryName": "Greenland", - "isoNumericCountryCode": "304" - }, - "GRD": { - "iso2CountryCode": "GD", - "countryName": "Grenada", - "isoNumericCountryCode": "308" - }, - "GLP": { - "iso2CountryCode": "GP", - "countryName": "Guadeloupe", - "isoNumericCountryCode": "312" - }, - "GUM": { - "iso2CountryCode": "GU", - "countryName": "Guam", - "isoNumericCountryCode": "316" - }, - "GTM": { - "iso2CountryCode": "GT", - "countryName": "Guatemala", - "isoNumericCountryCode": "320" - }, - "GGY": { - "iso2CountryCode": "GG", - "countryName": "Guernsey", - "isoNumericCountryCode": "831" - }, - "GIN": { - "iso2CountryCode": "GN", - "countryName": "Guinea", - "isoNumericCountryCode": "324" - }, - "GNB": { - "iso2CountryCode": "GW", - "countryName": "Guinea-Bissau", - "isoNumericCountryCode": "624" - }, - "GUY": { - "iso2CountryCode": "GY", - "countryName": "Guyana", - "isoNumericCountryCode": "328" - }, - "HTI": { - "iso2CountryCode": "HT", - "countryName": "Haiti", - "isoNumericCountryCode": "332" - }, - "HMD": { - "iso2CountryCode": "HM", - "countryName": "Heard Island and Mcdonald Islands", - "isoNumericCountryCode": "334" - }, - "VAT": { - "iso2CountryCode": "VA", - "countryName": "Holy See (Vatican City State)", - "isoNumericCountryCode": "336" - }, - "HND": { - "iso2CountryCode": "HN", - "countryName": "Honduras", - "isoNumericCountryCode": "340" - }, - "HUN": { - "iso2CountryCode": "HU", - "countryName": "Hungary", - "isoNumericCountryCode": "348" - }, - "ISL": { - "iso2CountryCode": "IS", - "countryName": "Iceland", - "isoNumericCountryCode": "352" - }, - "IND": { - "iso2CountryCode": "IN", - "countryName": "India", - "isoNumericCountryCode": "356" - }, - "IDN": { - "iso2CountryCode": "ID", - "countryName": "Indonesia", - "isoNumericCountryCode": "360" - }, - "IRN": { - "iso2CountryCode": "IR", - "countryName": "Iran, Islamic Republic of", - "isoNumericCountryCode": "364" - }, - "IRQ": { - "iso2CountryCode": "IQ", - "countryName": "Iraq", - "isoNumericCountryCode": "368" - }, - "IRL": { - "iso2CountryCode": "IE", - "countryName": "Ireland", - "isoNumericCountryCode": "372" - }, - "IMN": { - "iso2CountryCode": "IM", - "countryName": "Isle of Man", - "isoNumericCountryCode": "833" - }, - "ISR": { - "iso2CountryCode": "IL", - "countryName": "Israel", - "isoNumericCountryCode": "376" - }, - "ITA": { - "iso2CountryCode": "IT", - "countryName": "Italy", - "isoNumericCountryCode": "380" - }, - "JAM": { - "iso2CountryCode": "JM", - "countryName": "Jamaica", - "isoNumericCountryCode": "388" - }, - "JPN": { - "iso2CountryCode": "JP", - "countryName": "Japan", - "isoNumericCountryCode": "392" - }, - "JEY": { - "iso2CountryCode": "JE", - "countryName": "Jersey", - "isoNumericCountryCode": "832" - }, - "JOR": { - "iso2CountryCode": "JO", - "countryName": "Jordan", - "isoNumericCountryCode": "400" - }, - "KAZ": { - "iso2CountryCode": "KZ", - "countryName": "Kazakhstan", - "isoNumericCountryCode": "398" - }, - "KEN": { - "iso2CountryCode": "KE", - "countryName": "Kenya", - "isoNumericCountryCode": "404" - }, - "KIR": { - "iso2CountryCode": "KI", - "countryName": "Kiribati", - "isoNumericCountryCode": "296" - }, - "PRK": { - "iso2CountryCode": "KP", - "countryName": "Korea, Democratic People's Republic of", - "isoNumericCountryCode": "408" - }, - "KOR": { - "iso2CountryCode": "KR", - "countryName": "Korea, Republic of", - "isoNumericCountryCode": "410" - }, - "KWT": { - "iso2CountryCode": "KW", - "countryName": "Kuwait", - "isoNumericCountryCode": "414" - }, - "KGZ": { - "iso2CountryCode": "KG", - "countryName": "Kyrgyzstan", - "isoNumericCountryCode": "417" - }, - "LAO": { - "iso2CountryCode": "LA", - "countryName": "Lao PDR", - "isoNumericCountryCode": "418" - }, - "LVA": { - "iso2CountryCode": "LV", - "countryName": "Latvia", - "isoNumericCountryCode": "428" - }, - "LBN": { - "iso2CountryCode": "LB", - "countryName": "Lebanon", - "isoNumericCountryCode": "422" - }, - "LSO": { - "iso2CountryCode": "LS", - "countryName": "Lesotho", - "isoNumericCountryCode": "426" - }, - "LBR": { - "iso2CountryCode": "LR", - "countryName": "Liberia", - "isoNumericCountryCode": "430" - }, - "LBY": { - "iso2CountryCode": "LY", - "countryName": "Libya", - "isoNumericCountryCode": "434" - }, - "LIE": { - "iso2CountryCode": "LI", - "countryName": "Liechtenstein", - "isoNumericCountryCode": "438" - }, - "LTU": { - "iso2CountryCode": "LT", - "countryName": "Lithuania", - "isoNumericCountryCode": "440" - }, - "LUX": { - "iso2CountryCode": "LU", - "countryName": "Luxembourg", - "isoNumericCountryCode": "442" - }, - "MKD": { - "iso2CountryCode": "MK", - "countryName": "Macedonia, Republic of", - "isoNumericCountryCode": "807" - }, - "MDG": { - "iso2CountryCode": "MG", - "countryName": "Madagascar", - "isoNumericCountryCode": "450" - }, - "MWI": { - "iso2CountryCode": "MW", - "countryName": "Malawi", - "isoNumericCountryCode": "454" - }, - "MYS": { - "iso2CountryCode": "MY", - "countryName": "Malaysia", - "isoNumericCountryCode": "458" - }, - "MDV": { - "iso2CountryCode": "MV", - "countryName": "Maldives", - "isoNumericCountryCode": "462" - }, - "MLI": { - "iso2CountryCode": "ML", - "countryName": "Mali", - "isoNumericCountryCode": "466" - }, - "MLT": { - "iso2CountryCode": "MT", - "countryName": "Malta", - "isoNumericCountryCode": "470" - }, - "MHL": { - "iso2CountryCode": "MH", - "countryName": "Marshall Islands", - "isoNumericCountryCode": "584" - }, - "MTQ": { - "iso2CountryCode": "MQ", - "countryName": "Martinique", - "isoNumericCountryCode": "474" - }, - "MRT": { - "iso2CountryCode": "MR", - "countryName": "Mauritania", - "isoNumericCountryCode": "478" - }, - "MUS": { - "iso2CountryCode": "MU", - "countryName": "Mauritius", - "isoNumericCountryCode": "480" - }, - "MYT": { - "iso2CountryCode": "YT", - "countryName": "Mayotte", - "isoNumericCountryCode": "175" - }, - "MEX": { - "iso2CountryCode": "MX", - "countryName": "Mexico", - "isoNumericCountryCode": "484" - }, - "FSM": { - "iso2CountryCode": "FM", - "countryName": "Micronesia, Federated States of", - "isoNumericCountryCode": "583" - }, - "MDA": { - "iso2CountryCode": "MD", - "countryName": "Moldova", - "isoNumericCountryCode": "498" - }, - "MCO": { - "iso2CountryCode": "MC", - "countryName": "Monaco", - "isoNumericCountryCode": "492" - }, - "MNG": { - "iso2CountryCode": "MN", - "countryName": "Mongolia", - "isoNumericCountryCode": "496" - }, - "MNE": { - "iso2CountryCode": "ME", - "countryName": "Montenegro", - "isoNumericCountryCode": "499" - }, - "MSR": { - "iso2CountryCode": "MS", - "countryName": "Montserrat", - "isoNumericCountryCode": "500" - }, - "MAR": { - "iso2CountryCode": "MA", - "countryName": "Morocco", - "isoNumericCountryCode": "504" - }, - "MOZ": { - "iso2CountryCode": "MZ", - "countryName": "Mozambique", - "isoNumericCountryCode": "508" - }, - "MMR": { - "iso2CountryCode": "MM", - "countryName": "Myanmar", - "isoNumericCountryCode": "104" - }, - "NAM": { - "iso2CountryCode": "NA", - "countryName": "Namibia", - "isoNumericCountryCode": "516" - }, - "NRU": { - "iso2CountryCode": "NR", - "countryName": "Nauru", - "isoNumericCountryCode": "520" - }, - "NPL": { - "iso2CountryCode": "NP", - "countryName": "Nepal", - "isoNumericCountryCode": "524" - }, - "NLD": { - "iso2CountryCode": "NL", - "countryName": "Netherlands", - "isoNumericCountryCode": "528" - }, - "ANT": { - "iso2CountryCode": "AN", - "countryName": "Netherlands Antilles", - "isoNumericCountryCode": "530" - }, - "NCL": { - "iso2CountryCode": "NC", - "countryName": "New Caledonia", - "isoNumericCountryCode": "540" - }, - "NZL": { - "iso2CountryCode": "NZ", - "countryName": "New Zealand", - "isoNumericCountryCode": "554" - }, - "NIC": { - "iso2CountryCode": "NI", - "countryName": "Nicaragua", - "isoNumericCountryCode": "558" - }, - "NER": { - "iso2CountryCode": "NE", - "countryName": "Niger", - "isoNumericCountryCode": "562" - }, - "NGA": { - "iso2CountryCode": "NG", - "countryName": "Nigeria", - "isoNumericCountryCode": "566" - }, - "NIU": { - "iso2CountryCode": "NU", - "countryName": "Niue", - "isoNumericCountryCode": "570" - }, - "NFK": { - "iso2CountryCode": "NF", - "countryName": "Norfolk Island", - "isoNumericCountryCode": "574" - }, - "MNP": { - "iso2CountryCode": "MP", - "countryName": "Northern Mariana Islands", - "isoNumericCountryCode": "580" - }, - "NOR": { - "iso2CountryCode": "NO", - "countryName": "Norway", - "isoNumericCountryCode": "578" - }, - "OMN": { - "iso2CountryCode": "OM", - "countryName": "Oman", - "isoNumericCountryCode": "512" - }, - "PAK": { - "iso2CountryCode": "PK", - "countryName": "Pakistan", - "isoNumericCountryCode": "586" - }, - "PLW": { - "iso2CountryCode": "PW", - "countryName": "Palau", - "isoNumericCountryCode": "585" - }, - "PSE": { - "iso2CountryCode": "PS", - "countryName": "Palestinian Territory, Occupied", - "isoNumericCountryCode": "275" - }, - "PAN": { - "iso2CountryCode": "PA", - "countryName": "Panama", - "isoNumericCountryCode": "591" - }, - "PNG": { - "iso2CountryCode": "PG", - "countryName": "Papua New Guinea", - "isoNumericCountryCode": "598" - }, - "PRY": { - "iso2CountryCode": "PY", - "countryName": "Paraguay", - "isoNumericCountryCode": "600" - }, - "PER": { - "iso2CountryCode": "PE", - "countryName": "Peru", - "isoNumericCountryCode": "604" - }, - "PHL": { - "iso2CountryCode": "PH", - "countryName": "Philippines", - "isoNumericCountryCode": "608" - }, - "PCN": { - "iso2CountryCode": "PN", - "countryName": "Pitcairn", - "isoNumericCountryCode": "612" - }, - "POL": { - "iso2CountryCode": "PL", - "countryName": "Poland", - "isoNumericCountryCode": "616" - }, - "PRT": { - "iso2CountryCode": "PT", - "countryName": "Portugal", - "isoNumericCountryCode": "620" - }, - "PRI": { - "iso2CountryCode": "PR", - "countryName": "Puerto Rico", - "isoNumericCountryCode": "630" - }, - "QAT": { - "iso2CountryCode": "QA", - "countryName": "Qatar", - "isoNumericCountryCode": "634" - }, - "REU": { - "iso2CountryCode": "RE", - "countryName": "Réunion", - "isoNumericCountryCode": "638" - }, - "ROU": { - "iso2CountryCode": "RO", - "countryName": "Romania", - "isoNumericCountryCode": "642" - }, - "RUS": { - "iso2CountryCode": "RU", - "countryName": "Russian Federation", - "isoNumericCountryCode": "643" - }, - "RWA": { - "iso2CountryCode": "RW", - "countryName": "Rwanda", - "isoNumericCountryCode": "646" - }, - "BLM": { - "iso2CountryCode": "BL", - "countryName": "Saint-Barthélemy", - "isoNumericCountryCode": "652" - }, - "SHN": { - "iso2CountryCode": "SH", - "countryName": "Saint Helena", - "isoNumericCountryCode": "654" - }, - "KNA": { - "iso2CountryCode": "KN", - "countryName": "Saint Kitts and Nevis", - "isoNumericCountryCode": "659" - }, - "LCA": { - "iso2CountryCode": "LC", - "countryName": "Saint Lucia", - "isoNumericCountryCode": "662" - }, - "MAF": { - "iso2CountryCode": "MF", - "countryName": "Saint-Martin (French part)", - "isoNumericCountryCode": "663" - }, - "SPM": { - "iso2CountryCode": "PM", - "countryName": "Saint Pierre and Miquelon", - "isoNumericCountryCode": "666" - }, - "VCT": { - "iso2CountryCode": "VC", - "countryName": "Saint Vincent and Grenadines", - "isoNumericCountryCode": "670" - }, - "WSM": { - "iso2CountryCode": "WS", - "countryName": "Samoa", - "isoNumericCountryCode": "882" - }, - "SMR": { - "iso2CountryCode": "SM", - "countryName": "San Marino", - "isoNumericCountryCode": "674" - }, - "STP": { - "iso2CountryCode": "ST", - "countryName": "Sao Tome and Principe", - "isoNumericCountryCode": "678" - }, - "SAU": { - "iso2CountryCode": "SA", - "countryName": "Saudi Arabia", - "isoNumericCountryCode": "682" - }, - "SEN": { - "iso2CountryCode": "SN", - "countryName": "Senegal", - "isoNumericCountryCode": "686" - }, - "SRB": { - "iso2CountryCode": "RS", - "countryName": "Serbia", - "isoNumericCountryCode": "688" - }, - "SYC": { - "iso2CountryCode": "SC", - "countryName": "Seychelles", - "isoNumericCountryCode": "690" - }, - "SLE": { - "iso2CountryCode": "SL", - "countryName": "Sierra Leone", - "isoNumericCountryCode": "694" - }, - "SGP": { - "iso2CountryCode": "SG", - "countryName": "Singapore", - "isoNumericCountryCode": "702" - }, - "SVK": { - "iso2CountryCode": "SK", - "countryName": "Slovakia", - "isoNumericCountryCode": "703" - }, - "SVN": { - "iso2CountryCode": "SI", - "countryName": "Slovenia", - "isoNumericCountryCode": "705" - }, - "SLB": { - "iso2CountryCode": "SB", - "countryName": "Solomon Islands", - "isoNumericCountryCode": "90" - }, - "SOM": { - "iso2CountryCode": "SO", - "countryName": "Somalia", - "isoNumericCountryCode": "706" - }, - "ZAF": { - "iso2CountryCode": "ZA", - "countryName": "South Africa", - "isoNumericCountryCode": "710" - }, - "SGS": { - "iso2CountryCode": "GS", - "countryName": "South Georgia and the South Sandwich Islands", - "isoNumericCountryCode": "239" - }, - "SSD": { - "iso2CountryCode": "SS", - "countryName": "South Sudan", - "isoNumericCountryCode": "728" - }, - "ESP": { - "iso2CountryCode": "ES", - "countryName": "Spain", - "isoNumericCountryCode": "724" - }, - "LKA": { - "iso2CountryCode": "LK", - "countryName": "Sri Lanka", - "isoNumericCountryCode": "144" - }, - "SDN": { - "iso2CountryCode": "SD", - "countryName": "Sudan", - "isoNumericCountryCode": "736" - }, - "SUR": { - "iso2CountryCode": "SR", - "countryName": "Suriname *", - "isoNumericCountryCode": "740" - }, - "SJM": { - "iso2CountryCode": "SJ", - "countryName": "Svalbard and Jan Mayen Islands", - "isoNumericCountryCode": "744" - }, - "SWZ": { - "iso2CountryCode": "SZ", - "countryName": "Swaziland", - "isoNumericCountryCode": "748" - }, - "SWE": { - "iso2CountryCode": "SE", - "countryName": "Sweden", - "isoNumericCountryCode": "752" - }, - "CHE": { - "iso2CountryCode": "CH", - "countryName": "Switzerland", - "isoNumericCountryCode": "756" - }, - "SYR": { - "iso2CountryCode": "SY", - "countryName": "Syrian Arab Republic (Syria)", - "isoNumericCountryCode": "760" - }, - "TWN": { - "iso2CountryCode": "TW", - "countryName": "Taiwan, Republic of China", - "isoNumericCountryCode": "158" - }, - "TJK": { - "iso2CountryCode": "TJ", - "countryName": "Tajikistan", - "isoNumericCountryCode": "762" - }, - "TZA": { - "iso2CountryCode": "TZ", - "countryName": "Tanzania *, United Republic of", - "isoNumericCountryCode": "834" - }, - "THA": { - "iso2CountryCode": "TH", - "countryName": "Thailand", - "isoNumericCountryCode": "764" - }, - "TLS": { - "iso2CountryCode": "TL", - "countryName": "Timor-Leste", - "isoNumericCountryCode": "626" - }, - "TGO": { - "iso2CountryCode": "TG", - "countryName": "Togo", - "isoNumericCountryCode": "768" - }, - "TKL": { - "iso2CountryCode": "TK", - "countryName": "Tokelau", - "isoNumericCountryCode": "772" - }, - "TON": { - "iso2CountryCode": "TO", - "countryName": "Tonga", - "isoNumericCountryCode": "776" - }, - "TTO": { - "iso2CountryCode": "TT", - "countryName": "Trinidad and Tobago", - "isoNumericCountryCode": "780" - }, - "TUN": { - "iso2CountryCode": "TN", - "countryName": "Tunisia", - "isoNumericCountryCode": "788" - }, - "TUR": { - "iso2CountryCode": "TR", - "countryName": "Turkey", - "isoNumericCountryCode": "792" - }, - "TKM": { - "iso2CountryCode": "TM", - "countryName": "Turkmenistan", - "isoNumericCountryCode": "795" - }, - "TCA": { - "iso2CountryCode": "TC", - "countryName": "Turks and Caicos Islands", - "isoNumericCountryCode": "796" - }, - "TUV": { - "iso2CountryCode": "TV", - "countryName": "Tuvalu", - "isoNumericCountryCode": "798" - }, - "UGA": { - "iso2CountryCode": "UG", - "countryName": "Uganda", - "isoNumericCountryCode": "800" - }, - "UKR": { - "iso2CountryCode": "UA", - "countryName": "Ukraine", - "isoNumericCountryCode": "804" - }, - "ARE": { - "iso2CountryCode": "AE", - "countryName": "United Arab Emirates", - "isoNumericCountryCode": "784" - }, - "GBR": { - "iso2CountryCode": "GB", - "countryName": "United Kingdom", - "isoNumericCountryCode": "826" - }, - "USA": { - "iso2CountryCode": "US", - "countryName": "United States of America", - "isoNumericCountryCode": "840" - }, - "UMI": { - "iso2CountryCode": "UM", - "countryName": "United States Minor Outlying Islands", - "isoNumericCountryCode": "581" - }, - "URY": { - "iso2CountryCode": "UY", - "countryName": "Uruguay", - "isoNumericCountryCode": "858" - }, - "UZB": { - "iso2CountryCode": "UZ", - "countryName": "Uzbekistan", - "isoNumericCountryCode": "860" - }, - "VUT": { - "iso2CountryCode": "VU", - "countryName": "Vanuatu", - "isoNumericCountryCode": "548" - }, - "VEN": { - "iso2CountryCode": "VE", - "countryName": "Venezuela (Bolivarian Republic of)", - "isoNumericCountryCode": "862" - }, - "VNM": { - "iso2CountryCode": "VN", - "countryName": "Viet Nam", - "isoNumericCountryCode": "704" - }, - "VIR": { - "iso2CountryCode": "VI", - "countryName": "Virgin Islands, US", - "isoNumericCountryCode": "850" - }, - "WLF": { - "iso2CountryCode": "WF", - "countryName": "Wallis and Futuna Islands", - "isoNumericCountryCode": "876" - }, - "ESH": { - "iso2CountryCode": "EH", - "countryName": "Western Sahara", - "isoNumericCountryCode": "732" - }, - "YEM": { - "iso2CountryCode": "YE", - "countryName": "Yemen", - "isoNumericCountryCode": "887" - }, - "ZMB": { - "iso2CountryCode": "ZM", - "countryName": "Zambia", - "isoNumericCountryCode": "894" - }, - "ZWE": { - "iso2CountryCode": "ZW", - "countryName": "Zimbabwe", - "isoNumericCountryCode": "716" - } -} \ No newline at end of file diff --git a/package.json b/package.json index bbda8a2..00c17b8 100644 --- a/package.json +++ b/package.json @@ -16,10 +16,6 @@ "url": "https://github.com/Cimpress-MCP/postal-codes-js/issues" }, "homepage": "https://github.com/Cimpress-MCP/postal-codes-js#readme", - "dependencies": { - "detect-node": "^2.0.4", - "path": "^0.12.7" - }, "devDependencies": { "chai": "^4.2.0", "coveralls": "^3.0.11", diff --git a/postal-codes.js b/postal-codes.js deleted file mode 100644 index a73eeb2..0000000 --- a/postal-codes.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -const byAlpha2 = require('./generated/postal-codes-alpha2.json'); -const byAlpha3 = require('./generated/postal-codes-alpha3.json'); -const isNode = require('detect-node'); - -var getFormat = null; -if ( isNode ) { - getFormat = require("./formats-node"); -} else { - getFormat = require("./formats-web"); -} - -module.exports.validate = function (countryCode, postalCode) { - - if ( !countryCode ) { - return "Missing country code."; - } - - if ( !postalCode ) { - return 'Missing postal code.'; - } - - var countryData = undefined; - var preparedCountryCode = countryCode.trim().toUpperCase(); - - // Is it alpha2 ? - if ( preparedCountryCode.length == 2 ) { - countryData = byAlpha2[preparedCountryCode]; - } - - // Is it alpha3 ? - if ( preparedCountryCode.length == 3 ) { - countryData = byAlpha3[preparedCountryCode]; - } - - if ( !countryData ) { - return 'Unknown alpha2/alpha3 country code: ' + preparedCountryCode; - } - - // If the country/region does not use postal codes - if ( !countryData.postalCodeFormat ) { - return true; - } - - var format = getFormat(countryData.postalCodeFormat); - if ( !format ) { - return 'Failed to load postal code format "' + countryData.postalCodeFormat + '".'; - } - - var preparedPostalCode = postalCode.toString().trim().slice(0); - for (var i = 0; i < format.RedundantCharacters.length; i++) { - preparedPostalCode = preparedPostalCode.replace(new RegExp(format.RedundantCharacters[i], 'g'), ''); - } - - var expression = format.ValidationRegex; - if ( expression instanceof Array ) { - expression = '^' + expression.join('|') + '$'; - } - - const regexp = new RegExp(expression, 'i'); - var result = regexp.exec(preparedPostalCode); - - if ( !result ) { - // Invalid postal code - return "Postal code " + preparedPostalCode + " is not valid for country " + preparedCountryCode; - } - - if ( result[0].toLowerCase() != preparedPostalCode.toLowerCase() ) { - // Found "sub" match - return "Postal code " + preparedPostalCode + " is not valid for country " + preparedCountryCode; - } - - return true; -}; diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..6585d75 --- /dev/null +++ b/src/index.js @@ -0,0 +1,33 @@ +const countries = require('../data/countries.json'); +const formats = require('../data/formats.json'); +const lookup = require('../data/lookup.json'); + +/** + * @param {string|number} countryCode + * @param {string} postalCode + * @return {boolean} + */ +module.exports.validate = function (countryCode, postalCode) { + const key = countryCode.trim().toUpperCase(); + const index = lookup[key]; + + if (index === undefined) { + throw new Error(`No data for [${countryCode}]`); + } + + const country = countries[index]; + + // Country does not have postal codes. + if (country.postalCodeFormat === false) { + return true; + } + + const format = formats[country.postalCodeFormat]; + const validationRegex = new RegExp(format.validationRegex, 'i'); + const redundantChars = new RegExp(`[${formats}]`, 'g'); + const preparedPostalCode = postalCode.toString().trim().replace(redundantChars, ''); + + return validationRegex.test(preparedPostalCode); +} + +module.exports.lookup = lookup; diff --git a/test-web/README.md b/test-web/README.md deleted file mode 100644 index 47ca774..0000000 --- a/test-web/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Web test - -Run webpack in directory before open the tests.html in browser - diff --git a/test-web/bundle-tests.js b/test-web/bundle-tests.js deleted file mode 100644 index 1c7691c..0000000 --- a/test-web/bundle-tests.js +++ /dev/null @@ -1,11577 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ i: moduleId, -/******/ l: false, -/******/ exports: {} -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.l = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // identity function for calling harmony imports with the correct context -/******/ __webpack_require__.i = function(value) { return value; }; -/******/ -/******/ // define getter function for harmony exports -/******/ __webpack_require__.d = function(exports, name, getter) { -/******/ if(!__webpack_require__.o(exports, name)) { -/******/ Object.defineProperty(exports, name, { -/******/ configurable: false, -/******/ enumerable: true, -/******/ get: getter -/******/ }); -/******/ } -/******/ }; -/******/ -/******/ // getDefaultExport function for compatibility with non-harmony modules -/******/ __webpack_require__.n = function(module) { -/******/ var getter = module && module.__esModule ? -/******/ function getDefault() { return module['default']; } : -/******/ function getModuleExports() { return module; }; -/******/ __webpack_require__.d(getter, 'a', getter); -/******/ return getter; -/******/ }; -/******/ -/******/ // Object.prototype.hasOwnProperty.call -/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 89); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var type = __webpack_require__(2); -var config = __webpack_require__(63); - -/** - * Check if given obj just a primitive type wrapper - * @param {Object} obj - * @returns {boolean} - * @private - */ -exports.isWrapperType = function(obj) { - return obj instanceof Number || obj instanceof String || obj instanceof Boolean; -}; - -exports.merge = function(a, b) { - if (a && b) { - for (var key in b) { - a[key] = b[key]; - } - } - return a; -}; - -var hasOwnProperty = Object.prototype.hasOwnProperty; - -exports.forEach = function forEach(obj, f, context) { - if (exports.isGeneratorFunction(obj)) { - return forEach(obj(), f, context); - } else if (exports.isGeneratorObject(obj)) { - var value = obj.next(); - while (!value.done) { - if (f.call(context, value.value, 'value', obj) === false) - return; - value = obj.next(); - } - } else { - for (var prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - if (f.call(context, obj[prop], prop, obj) === false) - return; - } - } - } -}; - -exports.some = function(obj, f, context) { - var res = false; - exports.forEach(obj, function(value, key) { - if (f.call(context, value, key, obj)) { - res = true; - return false; - } - }, context); - return res; -}; - -exports.isEmptyObject = function(obj) { - for (var prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - return false; - } - } - return true; -}; - -exports.isIndexable = function(obj) { - var t = type(obj); - return (t.type === type.OBJECT && t.cls === type.ARRAY) || - (t.type === type.OBJECT && t.cls === type.BUFFER) || - (t.type === type.OBJECT && t.cls === type.ARGUMENTS) || - (t.type === type.OBJECT && t.cls === type.ARRAY_BUFFER) || - (t.type === type.OBJECT && t.cls === type.TYPED_ARRAY) || - (t.type === type.OBJECT && t.cls === type.DATA_VIEW) || - (t.type === type.OBJECT && t.cls === type.STRING) || - (t.type === type.STRING); -}; - -exports.length = function(obj) { - var t = type(obj); - switch (t.type) { - case type.STRING: - return obj.length; - case type.OBJECT: - switch (t.cls) { - case type.ARRAY_BUFFER: - case type.TYPED_ARRAY: - case type.DATA_VIEW: - return obj.byteLength; - - case type.ARRAY: - case type.BUFFER: - case type.ARGUMENTS: - case type.FUNCTION: - return obj.length; - } - } -}; - -exports.convertPropertyName = function(name) { - if (typeof name == 'symbol') { - return name; - } else { - return String(name); - } -}; - -exports.isGeneratorObject = function(obj) { - if (!obj) return false; - - return typeof obj.next == 'function' && - typeof obj[Symbol.iterator] == 'function' && - obj[Symbol.iterator]() === obj; -}; - -//TODO find better way -exports.isGeneratorFunction = function(f) { - if (typeof f != 'function') return false; - - return /^function\s*\*\s*/.test(f.toString()); -}; - -exports.format = function(value, opts) { - return config.getFormatter(opts).format(value); -}; - -exports.functionName = __webpack_require__(62).Formatter.functionName; - -exports.formatProp = function(value) { - return config.getFormatter().formatPropertyName(String(value)); -}; - - -/***/ }), -/* 1 */ -/***/ (function(module, exports, __webpack_require__) { - -var getType = __webpack_require__(2); -var format = __webpack_require__(72); -var hasOwnProperty = Object.prototype.hasOwnProperty; - -function makeResult(r, path, reason, a, b) { - var o = {result: r}; - if(!r) { - o.path = path; - o.reason = reason; - o.a = a; - o.b = b; - } - return o; -} - -var EQUALS = makeResult(true); - -function typeToString(t) { - return t.type + (t.cls ? '(' + t.cls + (t.sub ? ' ' + t.sub : '') + ')' : ''); -} - - - -var REASON = { - PLUS_0_AND_MINUS_0: '+0 is not equal to -0', - DIFFERENT_TYPES: 'A has type %s and B has type %s', - NAN_NUMBER: 'NaN is not equal to any number', - EQUALITY: 'A is not equal to B', - EQUALITY_PROTOTYPE: 'A and B have different prototypes', - WRAPPED_VALUE: 'A wrapped value is not equal to B wrapped value', - FUNCTION_SOURCES: 'function A is not equal to B by source code value (via .toString call)', - MISSING_KEY: '%s has no key %s', - CIRCULAR_VALUES: 'A has circular reference that was visited not in the same time as B', - SET_MAP_MISSING_KEY: 'Set/Map missing key', - MAP_VALUE_EQUALITY: 'Values of the same key in A and B is not equal' -}; - - -function eqInternal(a, b, opts, stackA, stackB, path, fails) { - var r = EQUALS; - - function result(comparison, reason) { - if(arguments.length > 2) { - var args = Array.prototype.slice.call(arguments, 2); - reason = format.apply(null, [reason].concat(args)); - } - var res = makeResult(comparison, path, reason, a, b); - if(!comparison && opts.collectAllFails) { - fails.push(res); - } - return res; - } - - function checkPropertyEquality(property) { - return eqInternal(a[property], b[property], opts, stackA, stackB, path.concat([property]), fails); - } - - function checkAlso(a1, b1) { - return eqInternal(a1, b1, opts, stackA, stackB, path, fails); - } - - // equal a and b exit early - if(a === b) { - // check for +0 !== -0; - return result(a !== 0 || (1 / a == 1 / b) || opts.plusZeroAndMinusZeroEqual, REASON.PLUS_0_AND_MINUS_0); - } - - var l, p; - - var typeA = getType(a), - typeB = getType(b); - - var key; - - // if objects has different types they are not equal - var typeDifferent = typeA.type !== typeB.type || typeA.cls !== typeB.cls; - - if(typeDifferent || ((opts.checkSubType && typeA.sub !== typeB.sub) || !opts.checkSubType)) { - return result(false, REASON.DIFFERENT_TYPES, typeToString(typeA), typeToString(typeB)); - } - - //early checks for types - switch(typeA.type) { - case 'number': - // NaN !== NaN - return (a !== a) ? result(b !== b, REASON.NAN_NUMBER) - : result(a === b, REASON.EQUALITY); - - case 'symbol': - case 'boolean': - case 'string': - return result(a === b, REASON.EQUALITY); - - case 'function': - // functions are compared by their source code - r = checkAlso(a.toString(), b.toString()); - if(!r.result) { - r.reason = REASON.FUNCTION_SOURCES; - if(!opts.collectAllFails) return r; - } - - break;//check user properties - - case 'object': - // additional checks for object instances - switch(typeA.cls) { - // check regexp flags - // TODO add es6 flags - case 'regexp': - p = ['source', 'global', 'multiline', 'lastIndex', 'ignoreCase']; - while(p.length) { - r = checkPropertyEquality(p.shift()); - if(!r.result && !opts.collectAllFails) return r; - } - break;//check user properties - - //check by timestamp only (using .valueOf) - case 'date': - if(+a !== +b) { - r = result(false, REASON.EQUALITY); - if(!r.result && !opts.collectAllFails) return r; - } - break;//check user properties - - //primitive type wrappers - case 'number': - case 'boolean': - case 'string': - //check their internal value - r = checkAlso(a.valueOf(), b.valueOf()); - if(!r.result) { - r.reason = REASON.WRAPPED_VALUE; - if(!opts.collectAllFails) return r; - } - break;//check user properties - - //node buffer - case 'buffer': - //if length different it is obviously different - r = checkPropertyEquality('length'); - if(!r.result && !opts.collectAllFails) return r; - - l = a.length; - while(l--) { - r = checkPropertyEquality(l); - if(!r.result && !opts.collectAllFails) return r; - } - - //we do not check for user properties because - //node Buffer have some strange hidden properties - return EQUALS; - - case 'error': - //check defined properties - p = ['name', 'message']; - while(p.length) { - r = checkPropertyEquality(p.shift()); - if(!r.result && !opts.collectAllFails) return r; - } - - break;//check user properties - - case 'array': - case 'arguments': - case 'typed-array': - r = checkPropertyEquality('length'); - if(!r.result && !opts.collectAllFails) return r; - - break;//check user properties - - case 'array-buffer': - r = checkPropertyEquality('byteLength'); - if(!r.result && !opts.collectAllFails) return r; - - break;//check user properties - - case 'map': - case 'set': - r = checkPropertyEquality('size'); - if(!r.result && !opts.collectAllFails) return r; - - stackA.push(a); - stackB.push(b); - - var itA = a.entries(); - var nextA = itA.next(); - - while(!nextA.done) { - key = nextA.value[0]; - //first check for primitive key if we can do light check - //using .has and .get - if(getType(key).type != 'object') { - if(b.has(key)) { - if(typeA.cls == 'map') { - //for map we also check its value to be equal - var value = b.get(key); - r = checkAlso(nextA.value[1], value); - if(!r.result) { - r.a = nextA.value; - r.b = value; - r.reason = REASON.MAP_VALUE_EQUALITY; - - if(!opts.collectAllFails) break; - } - } - - } else { - r = result(false, REASON.SET_MAP_MISSING_KEY); - r.a = key; - r.b = key; - - if(!opts.collectAllFails) break; - } - } else { - //heavy check - //we search by iterator for key equality using equal - var itB = b.entries(); - var nextB = itB.next(); - - while(!nextB.done) { - //first check for keys - r = checkAlso(nextA.value[0], nextB.value[0]); - - if(!r.result) { - r.reason = REASON.SET_MAP_MISSING_KEY; - r.a = key; - r.b = key; - } else { - if(typeA.cls == 'map') { - r = checkAlso(nextA.value[1], nextB.value[1]); - - if(!r.result) { - r.a = nextA.value; - r.b = nextB.value; - r.reason = REASON.MAP_VALUE_EQUALITY; - } - } - - if(!opts.collectAllFails) break; - } - - nextB = itB.next(); - } - } - - if(!r.result && !opts.collectAllFails) break; - - nextA = itA.next(); - } - - stackA.pop(); - stackB.pop(); - - if(!r.result) { - r.reason = REASON.SET_MAP_MISSING_ENTRY; - if(!opts.collectAllFails) return r; - } - - break; //check user properties - } - } - - // compare deep objects and arrays - // stacks contain references only - // - - l = stackA.length; - while(l--) { - if(stackA[l] === a) { - return result(stackB[l] === b, REASON.CIRCULAR_VALUES); - } - } - - // add `a` and `b` to the stack of traversed objects - stackA.push(a); - stackB.push(b); - - for(key in b) { - if(hasOwnProperty.call(b, key)) { - r = result(hasOwnProperty.call(a, key), REASON.MISSING_KEY, 'A', key); - if(!r.result && !opts.collectAllFails) break; - - if(r.result) { - r = checkPropertyEquality(key); - if(!r.result && !opts.collectAllFails) break; - } - } - } - - if(r.result || opts.collectAllFails) { - // ensure both objects have the same number of properties - for(key in a) { - if(hasOwnProperty.call(a, key)) { - r = result(hasOwnProperty.call(b, key), REASON.MISSING_KEY, 'B', key); - if(!r.result && !opts.collectAllFails) return r; - } - } - } - - stackA.pop(); - stackB.pop(); - - if(!r.result && !opts.collectAllFails) return r; - - var prototypesEquals = false, canComparePrototypes = false; - - if(opts.checkProtoEql) { - if(Object.getPrototypeOf) {//TODO should i check prototypes for === or use eq? - prototypesEquals = Object.getPrototypeOf(a) === Object.getPrototypeOf(b); - canComparePrototypes = true; - } - - if(canComparePrototypes && !prototypesEquals) { - r = result(prototypesEquals, REASON.EQUALITY_PROTOTYPE); - r.showReason = true; - if(!r.result && !opts.collectAllFails) { - return r; - } - } - } - - return EQUALS; -} - -var defaultOptions = { - checkProtoEql: true, - checkSubType: true, - plusZeroAndMinusZeroEqual: false -}; - -function eq(a, b, opts) { - opts = opts || {}; - - var newOpts = { - checkProtoEql: typeof opts.checkProtoEql !== 'boolean' ? defaultOptions.checkProtoEql : opts.checkProtoEql, - checkSubType: typeof opts.checkSubType !== 'boolean' ? defaultOptions.checkSubType : opts.checkSubType, - plusZeroAndMinusZeroEqual: typeof opts.plusZeroAndMinusZeroEqual !== 'boolean' ? defaultOptions.plusZeroAndMinusZeroEqual : opts.plusZeroAndMinusZeroEqual, - }; - - var fails = []; - var r = eqInternal(a, b, newOpts, [], [], [], fails); - return opts.collectAllFails ? fails : r; -} - -module.exports = eq; - -eq.r = REASON; - - -/***/ }), -/* 2 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(Buffer) {var toString = Object.prototype.toString; - -var types = __webpack_require__(74); - -/** - * Simple data function to store type information - * @param {string} type Usually what is returned from typeof - * @param {string} cls Sanitized @Class via Object.prototype.toString - * @param {string} sub If type and cls the same, and need to specify somehow - * @private - * @example - * - * //for null - * new Type('null'); - * - * //for Date - * new Type('object', 'date'); - * - * //for Uint8Array - * - * new Type('object', 'typed-array', 'uint8'); - */ -function Type(type, cls, sub) { - this.type = type; - this.cls = cls; - this.sub = sub; -} - -/** - * Function to store type checks - * @private - */ -function TypeChecker() { - this.checks = []; -} - -TypeChecker.prototype = { - add: function(func) { - this.checks.push(func); - return this; - }, - - addTypeOf: function(type, res) { - return this.add(function(obj, tpeOf) { - if(tpeOf === type) { - return new Type(res); - } - }); - }, - - addClass: function(cls, res, sub) { - return this.add(function(obj, tpeOf, objCls) { - if(objCls === cls) { - return new Type(types.OBJECT, res, sub); - } - }); - }, - - getType: function(obj) { - var typeOf = typeof obj; - var cls = toString.call(obj); - - for(var i = 0, l = this.checks.length; i < l; i++) { - var res = this.checks[i].call(this, obj, typeOf, cls); - if(typeof res !== 'undefined') return res; - } - - } -}; - -var main = new TypeChecker(); - -//TODO add iterators - -main - .addTypeOf(types.NUMBER, types.NUMBER) - .addTypeOf(types.UNDEFINED, types.UNDEFINED) - .addTypeOf(types.STRING, types.STRING) - .addTypeOf(types.BOOLEAN, types.BOOLEAN) - .addTypeOf(types.FUNCTION, types.FUNCTION) - .addTypeOf(types.SYMBOL, types.SYMBOL) - .add(function(obj, tpeOf) { - if(obj === null) return new Type(types.NULL); - }) - .addClass('[object String]', types.STRING) - .addClass('[object Boolean]', types.BOOLEAN) - .addClass('[object Number]', types.NUMBER) - .addClass('[object Array]', types.ARRAY) - .addClass('[object RegExp]', types.REGEXP) - .addClass('[object Error]', types.ERROR) - .addClass('[object Date]', types.DATE) - .addClass('[object Arguments]', types.ARGUMENTS) - .addClass('[object Math]') - .addClass('[object JSON]') - .addClass('[object ArrayBuffer]', types.ARRAY_BUFFER) - .addClass('[object Int8Array]', types.TYPED_ARRAY, 'int8') - .addClass('[object Uint8Array]', types.TYPED_ARRAY, 'uint8') - .addClass('[object Uint8ClampedArray]', types.TYPED_ARRAY, 'uint8clamped') - .addClass('[object Int16Array]', types.TYPED_ARRAY, 'int16') - .addClass('[object Uint16Array]', types.TYPED_ARRAY, 'uint16') - .addClass('[object Int32Array]', types.TYPED_ARRAY, 'int32') - .addClass('[object Uint32Array]', types.TYPED_ARRAY, 'uint32') - .addClass('[object Float32Array]', types.TYPED_ARRAY, 'float32') - .addClass('[object Float64Array]', types.TYPED_ARRAY, 'float64') - .addClass('[object DataView]', types.DATA_VIEW) - .addClass('[object Map]', types.MAP) - .addClass('[object WeakMap]', types.WEAK_MAP) - .addClass('[object Set]', types.SET) - .addClass('[object WeakSet]', types.WEAK_SET) - .addClass('[object Promise]', types.PROMISE) - .addClass('[object Blob]', types.BLOB) - .addClass('[object File]', types.FILE) - .addClass('[object FileList]', types.FILE_LIST) - .addClass('[object XMLHttpRequest]', types.XHR) - .add(function(obj) { - if((typeof Promise === types.FUNCTION && obj instanceof Promise) || - (typeof obj.then === types.FUNCTION)) { - return new Type(types.OBJECT, types.PROMISE); - } - }) - .add(function(obj) { - if(typeof Buffer !== 'undefined' && obj instanceof Buffer) { - return new Type(types.OBJECT, types.BUFFER); - } - }) - .add(function(obj) { - if(typeof Node !== 'undefined' && obj instanceof Node) { - return new Type(types.OBJECT, types.HTML_ELEMENT, obj.nodeName); - } - }) - .add(function(obj) { - // probably at the begginging should be enough these checks - if(obj.Boolean === Boolean && obj.Number === Number && obj.String === String && obj.Date === Date) { - return new Type(types.OBJECT, types.HOST); - } - }) - .add(function() { - return new Type(types.OBJECT); - }); - -/** - * Get type information of anything - * - * @param {any} obj Anything that could require type information - * @return {Type} type info - */ -function getGlobalType(obj) { - return main.getType(obj); -} - -getGlobalType.checker = main; -getGlobalType.TypeChecker = TypeChecker; -getGlobalType.Type = Type; - -Object.keys(types).forEach(function(typeName) { - getGlobalType[typeName] = types[typeName]; -}); - -module.exports = getGlobalType; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(90).Buffer)) - -/***/ }), -/* 3 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var AssertionError = __webpack_require__(60); - -/** - * should Assertion - * @param {*} obj Given object for assertion - * @constructor - * @memberOf should - * @static - */ -function Assertion(obj) { - this.obj = obj; - - this.anyOne = false; - this.negate = false; - - this.params = {actual: obj}; -} - -Assertion.prototype = { - constructor: Assertion, - - /** - * Base method for assertions. - * - * Before calling this method need to fill Assertion#params object. This method usually called from other assertion methods. - * `Assertion#params` can contain such properties: - * * `operator` - required string containing description of this assertion - * * `obj` - optional replacement for this.obj, it usefull if you prepare more clear object then given - * * `message` - if this property filled with string any others will be ignored and this one used as assertion message - * * `expected` - any object used when you need to assert relation between given object and expected. Like given == expected (== is a relation) - * * `details` - additional string with details to generated message - * - * @memberOf Assertion - * @category assertion - * @param {*} expr Any expression that will be used as a condition for asserting. - * @example - * - * var a = new should.Assertion(42); - * - * a.params = { - * operator: 'to be magic number', - * } - * - * a.assert(false); - * //throws AssertionError: expected 42 to be magic number - */ - assert: function(expr) { - if (expr) { - return this; - } - - var params = this.params; - - if ('obj' in params && !('actual' in params)) { - params.actual = params.obj; - } else if (!('obj' in params) && !('actual' in params)) { - params.actual = this.obj; - } - - params.stackStartFunction = params.stackStartFunction || this.assert; - params.negate = this.negate; - - params.assertion = this; - - throw new AssertionError(params); - }, - - /** - * Shortcut for `Assertion#assert(false)`. - * - * @memberOf Assertion - * @category assertion - * @example - * - * var a = new should.Assertion(42); - * - * a.params = { - * operator: 'to be magic number', - * } - * - * a.fail(); - * //throws AssertionError: expected 42 to be magic number - */ - fail: function() { - return this.assert(false); - } -}; - - - -/** - * Assertion used to delegate calls of Assertion methods inside of Promise. - * It has almost all methods of Assertion.prototype - * - * @param {Promise} obj - */ -function PromisedAssertion(/* obj */) { - Assertion.apply(this, arguments); -} - -/** - * Make PromisedAssertion to look like promise. Delegate resolve and reject to given promise. - * - * @private - * @returns {Promise} - */ -PromisedAssertion.prototype.then = function(resolve, reject) { - return this.obj.then(resolve, reject); -}; - -/** - * Way to extend Assertion function. It uses some logic - * to define only positive assertions and itself rule with negative assertion. - * - * All actions happen in subcontext and this method take care about negation. - * Potentially we can add some more modifiers that does not depends from state of assertion. - * - * @memberOf Assertion - * @static - * @param {String} name Name of assertion. It will be used for defining method or getter on Assertion.prototype - * @param {Function} func Function that will be called on executing assertion - * @example - * - * Assertion.add('asset', function() { - * this.params = { operator: 'to be asset' } - * - * this.obj.should.have.property('id').which.is.a.Number() - * this.obj.should.have.property('path') - * }) - */ -Assertion.add = function(name, func) { - Object.defineProperty(Assertion.prototype, name, { - enumerable: true, - configurable: true, - value: function() { - var context = new Assertion(this.obj, this, name); - context.anyOne = this.anyOne; - - try { - func.apply(context, arguments); - } catch (e) { - // check for fail - if (e instanceof AssertionError) { - // negative fail - if (this.negate) { - this.obj = context.obj; - this.negate = false; - return this; - } - - if (context !== e.assertion) { - context.params.previous = e; - } - - // positive fail - context.negate = false; - context.fail(); - } - // throw if it is another exception - throw e; - } - - // negative pass - if (this.negate) { - context.negate = true; // because .fail will set negate - context.params.details = 'false negative fail'; - context.fail(); - } - - // positive pass - if (!this.params.operator) { - this.params = context.params; // shortcut - } - this.obj = context.obj; - this.negate = false; - return this; - } - }); - - Object.defineProperty(PromisedAssertion.prototype, name, { - enumerable: true, - configurable: true, - value: function() { - var args = arguments; - this.obj = this.obj.then(function(a) { - return a[name].apply(a, args); - }); - - return this; - } - }); -}; - -/** - * Add chaining getter to Assertion like .a, .which etc - * - * @memberOf Assertion - * @static - * @param {string} name name of getter - * @param {function} [onCall] optional function to call - */ -Assertion.addChain = function(name, onCall) { - onCall = onCall || function() {}; - Object.defineProperty(Assertion.prototype, name, { - get: function() { - onCall.call(this); - return this; - }, - enumerable: true - }); - - Object.defineProperty(PromisedAssertion.prototype, name, { - enumerable: true, - configurable: true, - get: function() { - this.obj = this.obj.then(function(a) { - return a[name]; - }); - - return this; - } - }); -}; - -/** - * Create alias for some `Assertion` property - * - * @memberOf Assertion - * @static - * @param {String} from Name of to map - * @param {String} to Name of alias - * @example - * - * Assertion.alias('true', 'True') - */ -Assertion.alias = function(from, to) { - var desc = Object.getOwnPropertyDescriptor(Assertion.prototype, from); - if (!desc) throw new Error('Alias ' + from + ' -> ' + to + ' could not be created as ' + from + ' not defined'); - Object.defineProperty(Assertion.prototype, to, desc); - - var desc2 = Object.getOwnPropertyDescriptor(PromisedAssertion.prototype, from); - if (desc2) { - Object.defineProperty(PromisedAssertion.prototype, to, desc2); - } -}; -/** - * Negation modifier. Current assertion chain become negated. Each call invert negation on current assertion. - * - * @name not - * @property - * @memberOf Assertion - * @category assertion - */ -Assertion.addChain('not', function() { - this.negate = !this.negate; -}); - -/** - * Any modifier - it affect on execution of sequenced assertion to do not `check all`, but `check any of`. - * - * @name any - * @property - * @memberOf Assertion - * @category assertion - */ -Assertion.addChain('any', function() { - this.anyOne = true; -}); - -module.exports = Assertion; -module.exports.PromisedAssertion = PromisedAssertion; - - -/***/ }), -/* 4 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "10-Digits - NNNNNNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{10}$", - "TestData": { - "Valid": [ - "1234567890", - "5678567833" - ], - "Invalid": [ - "12334545698", - "123s33s12", - "123456789" - ] - } -}; - -/***/ }), -/* 5 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "2-Digits - NN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{2}$", - "TestData": { - "Valid": [ - "12", - "56" - ], - "Invalid": [ - "012", - "1s", - "1", - "x3" - ] - } -}; - -/***/ }), -/* 6 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "3-Digits - NNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{3}$", - "TestData": { - "Valid": [ - "123", - "567" - ], - "Invalid": [ - "1234", - "13s", - "1x3" - ] - } -}; - -/***/ }), -/* 7 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "4-Digits - NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "5678" - ], - "Invalid": [ - "12345", - "123s", - "12x3" - ] - } -}; - -/***/ }), -/* 8 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "5-Digits - NNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{5}$", - "TestData": { - "Valid": [ - "12345", - "56785" - ], - "Invalid": [ - "123456", - "1233s", - "123x3" - ] - } -}; - -/***/ }), -/* 9 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "6-Digits - NNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{6}$", - "TestData": { - "Valid": [ - "123456", - "567856" - ], - "Invalid": [ - "1233456", - "123s3s", - "1s23x3" - ] - } -}; - -/***/ }), -/* 10 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "7-Digits - NNNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{7}$", - "TestData": { - "Valid": [ - "1234567", - "5678567" - ], - "Invalid": [ - "123345456", - "123s33s", - "1s23x3" - ] - } -}; - -/***/ }), -/* 11 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "8-Digits - NNNNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{8}$", - "TestData": { - "Valid": [ - "12345678", - "56785678" - ], - "Invalid": [ - "123345456", - "123s33s", - "1s23x3" - ] - } -}; - -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "AD : CCNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^AD[0-9]{3}$", - "TestData": { - "Valid": [ - "AD123", - "AD001" - ], - "Invalid": [ - "A1234", - "AD12", - "AD1234" - ] - } -}; - -/***/ }), -/* 13 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "AI : CC2640", - "RedundantCharacters": " -", - "ValidationRegex": "^AI2640$", - "TestData": { - "Valid": [ - "AI2640", - "AI-2640" - ], - "Invalid": [ - "A2640", - "AI02640", - "AI-02640" - ] - } -}; - -/***/ }), -/* 14 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "AQ : BIQQ 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^BIQQ1ZZ$", - "TestData": { - "Valid": [ - "BIQQ 1ZZ", - "BIQQ1ZZ" - ], - "Invalid": [ - "BIQQ1Z", - "BIQQ01ZZ" - ] - } -}; - -/***/ }), -/* 15 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "AX : NNNNN, CC-NNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(AX)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "AX-1234", - "AX1234" - ], - "Invalid": [ - "AX123", - "A1234", - "AX-12345" - ] - } -}; - -/***/ }), -/* 16 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "AZ : CCNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^AZ[0-9]{4}$", - "TestData": { - "Valid": [ - "AZ1234", - "AZ-1234" - ], - "Invalid": [ - "AZ123", - "A1234", - "AZ-12345" - ] - } -}; - -/***/ }), -/* 17 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "BB : CCNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(BB)?[0-9]{5}$", - "TestData": { - "Valid": [ - "BB12345", - "12345" - ], - "Invalid": [ - "x1231s", - "1231sd" - ] - } -}; - -/***/ }), -/* 18 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "BH : NNN, NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{3,4}$", - "TestData": { - "Valid": [ - "123", - "1234" - ], - "Invalid": [ - "12", - "12345" - ] - } -}; - -/***/ }), -/* 19 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "BL : 97133", - "RedundantCharacters": " -", - "ValidationRegex": "^97133$", - "TestData": { - "Valid": [ - "97133" - ], - "Invalid": [ - "971330", - "9713" - ] - } -}; - -/***/ }), -/* 20 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "BN : LLNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[a-zA-Z]{2}[0-9]{4}$", - "TestData": { - "Valid": [ - "AB1234", - "tK0987" - ], - "Invalid": [ - "abc123", - "a12345", - "at123", - "BH12345" - ] - } -}; - -/***/ }), -/* 21 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "CA : A0A 0A0", - "RedundantCharacters": " -", - "ValidationRegex": "^[A-Z][0-9][A-Z][0-9][A-Z][0-9]$", - "TestData": { - "Valid": [ - "A4B5X5", - "A4B5A5" - ], - "Invalid": [ - "123AAA", - "12A5AA" - ] - } -}; - -/***/ }), -/* 22 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "FK : FIQQ 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^FIQQ1ZZ$", - "TestData": { - "Valid": [ - "FIQQ 1ZZ", - "FIQQ1ZZ" - ], - "Invalid": [ - "FIQQ01ZZ", - "FIQQ1ZZZ" - ] - } -}; - -/***/ }), -/* 23 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "GB", - "RedundantCharacters": " -", - "ValidationRegex": "[A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]?[0-9][ABD-HJLN-UW-Z]{2}|GIR0AA", - "ValidationRegex.DOC": "http://regexlib.com/REDetails.aspx?regexp_id=260&AspxAutoDetectCookieSupport=1", - "TestData": { - "Valid": [ - "CW3 9SS", - "SE5 0EG", - "SE50EG", - "WC2H 7LT", - "se5 0eg", - "Z29ZZ", - "Z699ZZ", - "ZX99ZZ", - "ZC999ZZ", - "EC1A 1BB", - "W1A 0AX", - "M1 1AE", - "B33 8TH", - "CR2 6XH", - "DN55 1PT", - "GIR 0AA" - ], - "Invalid": [ - "WC2H 7LTa", - "WC2H" - ] - } -}; - -/***/ }), -/* 24 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "GF : 973NN", - "RedundantCharacters": " -", - "ValidationRegex": "^973[0-9]{2}$", - "TestData": { - "Valid": [ - "97300", - "97390" - ], - "Invalid": [ - "9732", - "973999", - "97290", - "097390" - ] - } -}; - -/***/ }), -/* 25 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "GI : GX11 1AA", - "RedundantCharacters": " -", - "ValidationRegex": "^GX111AA$", - "TestData": { - "Valid": [ - "GX111AA", - "GX11 1AA" - ], - "Invalid": [ - "GX1101AA", - "GX111AAA" - ] - } -}; - -/***/ }), -/* 26 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "GP : 971NN", - "RedundantCharacters": " -", - "ValidationRegex": "^971[0-9]{2}$", - "TestData": { - "Valid": [ - "97100", - "97190" - ], - "Invalid": [ - "9712", - "971999", - "97290", - "097190" - ] - } -}; - -/***/ }), -/* 27 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "GS : SIQQ 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^SIQQ1ZZ$", - "TestData": { - "Valid": [ - "SIQQ 1ZZ", - "SIqq 1zz", - "SIQQ1ZZ" - ], - "Invalid": [ - "SIQQ01ZZ", - "SIQQ1ZZZ" - ] - } -}; - -/***/ }), -/* 28 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "HN : CCNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(HN)?[0-9]{5}$", - "TestData": { - "Valid": [ - "HN12345", - "12345" - ], - "Invalid": [ - "123456", - "HN123456", - "HN1234" - ] - } -}; - -/***/ }), -/* 29 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "IO : BBND 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^BBND1ZZ$", - "TestData": { - "Valid": [ - "BBND 1ZZ", - "BBND1ZZ" - ], - "Invalid": [ - "BBND01ZZ", - "BBND1ZZZ" - ] - } -}; - -/***/ }), -/* 30 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "KY : CCN-NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^KY[0-9]{5}$", - "TestData": { - "Valid": [ - "KY1-1234", - "KY12345" - ], - "Invalid": [ - "KY1234", - "KY123456", - "K1-1234" - ] - } -}; - -/***/ }), -/* 31 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "LB : NNNNN, NNNN NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{4}(?:[0-9]{4})?$", - "TestData": { - "Valid": [ - "1234", - "1234 1234", - "12341234" - ], - "Invalid": [ - "123", - "1234567", - "123456789" - ] - } -}; - -/***/ }), -/* 32 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "LC : CCNN NNN", - "RedundantCharacters": " -", - "ValidationRegex": "^LC[0-9]{5}$", - "TestData": { - "Valid": [ - "LC12 345", - "LC12345" - ], - "Invalid": [ - "12345", - "x1231s", - "1231sd" - ] - } -}; - -/***/ }), -/* 33 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "LT : LT-NNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(LT)?[0-9]{5}$", - "TestData": { - "Valid": [ - "12345", - "LT12345", - "LT-12345" - ], - "Invalid": [ - "1234", - "123456", - "LT-1234" - ] - } -}; - -/***/ }), -/* 34 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "LV : NNNNN, CC-NNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(LV)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "LV-1234", - "LV1234" - ], - "Invalid": [ - "LV123", - "L1234", - "LV-12345" - ] - } -}; - -/***/ }), -/* 35 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "MD : CCNNNN, CC-NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(MD)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "MD1234", - "MD-1234" - ], - "Invalid": [ - "MD123", - "M1234", - "MD-12345" - ] - } -}; - -/***/ }), -/* 36 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "MF : 97150", - "RedundantCharacters": " -", - "ValidationRegex": "^97150$", - "TestData": { - "Valid": [ - "97150" - ], - "Invalid": [ - "971500", - "9715" - ] - } -}; - -/***/ }), -/* 37 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "MS : MSR NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(MSR)?[0-9]{4}$", - "TestData": { - "Valid": [ - "MSR 1110", - "MSR 1350", - "1350" - ], - "Invalid": [ - "MS1110", - "MSR01350", - "12345" - ] - } -}; - -/***/ }), -/* 38 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "MA : LLL NNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[A-Z]{3}[0-9]{4}$", - "TestData": { - "Valid": [ - "abc1234", - "ABC1234", - "SHD4783" - ], - "Invalid": [ - "ABCABC", - "123ABCD" - ] - } -}; - -/***/ }), -/* 39 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "NC : 988NN", - "RedundantCharacters": " -", - "ValidationRegex": "^988[0-9]{2}$", - "TestData": { - "Valid": [ - "98800", - "98890" - ], - "Invalid": [ - "9882", - "988999", - "98990", - "098890" - ] - } -}; - -/***/ }), -/* 40 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "NL : CC-NNNN LL", - "RedundantCharacters": " -", - "ValidationRegex": "^(NL)?[0-9]{4}([A-Z]{2})?$", - "TestData": { - "Valid": [ - "1235DF", - "5983DH", - "NL-1000 AP" - ], - "Invalid": [ - "1235D", - "12j4h", - "k3j51l" - ] - } -}; - -/***/ }), -/* 41 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "PF : 987NN", - "RedundantCharacters": " -", - "ValidationRegex": "^987[0-9]{2}$", - "TestData": { - "Valid": [ - "98700", - "98790" - ], - "Invalid": [ - "9872", - "987999", - "98690", - "098790" - ] - } -}; - -/***/ }), -/* 42 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "PL : 99-999", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{5}$", - "TestData": { - "Valid": [ - "44100", - "44-100" - ], - "Invalid": [ - "44f00", - "e4410", - "44-100d", - "c44-100", - "b44100", - "44100a" - ] - } -}; - -/***/ }), -/* 43 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "PM : 97500", - "RedundantCharacters": " -", - "ValidationRegex": "^97500$", - "TestData": { - "Valid": [ - "97500" - ], - "Invalid": [ - "975000", - "9750" - ] - } -}; - -/***/ }), -/* 44 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "PN : PCRN 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^PCRN1ZZ$", - "TestData": { - "Valid": [ - "PCRN 1ZZ", - "PCRN1ZZ" - ], - "Invalid": [ - "PCRN01ZZ", - "PCRN1ZZZ" - ] - } -}; - -/***/ }), -/* 45 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "PT : NNNN[ NNN]", - "RedundantCharacters": " -", - "ValidationRegex": "^([0-9]{4}-[0-9]{3})$", - "TestData": { - "Valid": [ - "1234-123" - ], - "Invalid": [ - "1255", - "1234567", - "1234 123", - "x1231s", - "1231sd", - "1010101010", - "1234 12" - ] - } -}; - -/***/ }), -/* 46 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "RE : 974NN", - "RedundantCharacters": " -", - "ValidationRegex": "^974[0-9]{2}$", - "TestData": { - "Valid": [ - "97400", - "97490" - ], - "Invalid": [ - "9742", - "974999", - "97390", - "097490" - ] - } -}; - -/***/ }), -/* 47 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "RU : NNN[-NNN]", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{3}([0-9]{3})?$", - "TestData": { - "Valid": [ - "125", - "123456" - ], - "Invalid": [ - "x1231s", - "1231sd", - "1010101010" - ] - } -}; - -/***/ }), -/* 48 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "SH : STHL 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^STHL1ZZ$", - "TestData": { - "Valid": [ - "STHL 1ZZ", - "STHL1ZZ" - ], - "Invalid": [ - "STHL01ZZ", - "STHL1ZZZ" - ] - } -}; - -/***/ }), -/* 49 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "SM : 4789N", - "RedundantCharacters": " -", - "ValidationRegex": "^4789[0-9]{1}$", - "TestData": { - "Valid": [ - "47890", - "47899" - ], - "Invalid": [ - "4789", - "478900", - "47889" - ] - } -}; - -/***/ }), -/* 50 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "SO : AA NNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[a-zA-Z]{2}[0-9]{5}$", - "TestData": { - "Valid": [ - "AW12345", - "BN47899" - ], - "Invalid": [ - "12345", - "A12345", - "SL123456" - ] - } -}; - -/***/ }), -/* 51 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "SZ : ANNN", - "RedundantCharacters": " -", - "ValidationRegex": "^[a-zA-Z]{1}[0-9]{3}$", - "TestData": { - "Valid": [ - "S123", - "a789" - ], - "Invalid": [ - "F1234", - "D12" - ] - } -}; - -/***/ }), -/* 52 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "TC : TKCA 1ZZ", - "RedundantCharacters": " -", - "ValidationRegex": "^TKCA1ZZ$", - "TestData": { - "Valid": [ - "TKCA1ZZ", - "TKCA 1ZZ" - ], - "Invalid": [ - "TKCA01ZZ", - "TKCA1ZZZ" - ] - } -}; - -/***/ }), -/* 53 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "US : NNNNN[-NNNN]", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{5}([0-9]{4})?$", - "TestData": { - "Valid": [ - "12345", - "12345-7689" - ], - "Invalid": [ - "x1231s", - "1231sd", - "1010101010" - ] - } -}; - -/***/ }), -/* 54 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "VA : 00120", - "RedundantCharacters": " -", - "ValidationRegex": "^00120$", - "TestData": { - "Valid": [ - "00120" - ], - "Invalid": [ - "0012", - "001200" - ] - } -}; - -/***/ }), -/* 55 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "VC : CCNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(VC)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "VC1234", - "VC-1234" - ], - "Invalid": [ - "VC123", - "V1234", - "VC-12345" - ] - } -}; - -/***/ }), -/* 56 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "VE : NNNN, NNNN-A", - "RedundantCharacters": " -", - "ValidationRegex": "^[0-9]{4}[a-zA-Z]?$", - "TestData": { - "Valid": [ - "1234", - "1234-A" - ], - "Invalid": [ - "123", - "1234AA" - ] - } -}; - -/***/ }), -/* 57 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "VG : CCNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(VG)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "VG1234", - "VG-1234" - ], - "Invalid": [ - "VG123", - "V1234", - "VG-12345" - ] - } -}; - -/***/ }), -/* 58 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "WF : 986NN", - "RedundantCharacters": " -", - "ValidationRegex": "^986[0-9]{2}$", - "TestData": { - "Valid": [ - "98600", - "98690" - ], - "Invalid": [ - "9862", - "986999", - "98990", - "098690" - ] - } -}; - -/***/ }), -/* 59 */ -/***/ (function(module, exports) { - -module.exports = { - "Description": "WS : CCNNNNN", - "RedundantCharacters": " -", - "ValidationRegex": "^(WS)?[0-9]{4}$", - "TestData": { - "Valid": [ - "1234", - "WS1234", - "WS-1234" - ], - "Invalid": [ - "WS123", - "V1234", - "WS-12345" - ] - } -}; - -/***/ }), -/* 60 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var util = __webpack_require__(0); - -/** - * should AssertionError - * @param {Object} options - * @constructor - * @memberOf should - * @static - */ -var AssertionError = function AssertionError(options) { - util.merge(this, options); - - if (!options.message) { - Object.defineProperty(this, 'message', { - get: function() { - if (!this._message) { - this._message = this.generateMessage(); - this.generatedMessage = true; - } - return this._message; - }, - configurable: true, - enumerable: false - } - ); - } - - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.stackStartFunction); - } else { - // non v8 browsers so we can have a stacktrace - var err = new Error(); - if (err.stack) { - var out = err.stack; - - if (this.stackStartFunction) { - // try to strip useless frames - var fn_name = util.functionName(this.stackStartFunction); - var idx = out.indexOf('\n' + fn_name); - if (idx >= 0) { - // once we have located the function frame - // we need to strip out everything before it (and its line) - var next_line = out.indexOf('\n', idx + 1); - out = out.substring(next_line + 1); - } - } - - this.stack = out; - } - } -}; - - -var indent = ' '; -function prependIndent(line) { - return indent + line; -} - -function indentLines(text) { - return text.split('\n').map(prependIndent).join('\n'); -} - - -// assert.AssertionError instanceof Error -AssertionError.prototype = Object.create(Error.prototype, { - name: { - value: 'AssertionError' - }, - - generateMessage: { - value: function() { - if (!this.operator && this.previous) { - return this.previous.message; - } - var actual = util.format(this.actual); - var expected = 'expected' in this ? ' ' + util.format(this.expected) : ''; - var details = 'details' in this && this.details ? ' (' + this.details + ')' : ''; - - var previous = this.previous ? '\n' + indentLines(this.previous.message) : ''; - - return 'expected ' + actual + (this.negate ? ' not ' : ' ') + this.operator + expected + details + previous; - } - } -}); - -module.exports = AssertionError; - - -/***/ }), -/* 61 */ -/***/ (function(module, exports) { - -module.exports = { - "AF": { - "countryName": "Afghanistan", - "postalCodeFormat": "4Digits.json", - "alpha2": "AF", - "alpha3": "AFG", - "numeric3": "4" - }, - "AX": { - "countryName": "Aland Islands", - "postalCodeFormat": "AX.json", - "alpha2": "AX", - "alpha3": "ALA", - "numeric3": "248" - }, - "AL": { - "countryName": "Albania", - "postalCodeFormat": "4Digits.json", - "alpha2": "AL", - "alpha3": "ALB", - "numeric3": "8" - }, - "DZ": { - "countryName": "Algeria", - "postalCodeFormat": "5Digits.json", - "alpha2": "DZ", - "alpha3": "DZA", - "numeric3": "12" - }, - "AS": { - "countryName": "American Samoa", - "postalCodeFormat": "5Digits.json", - "alpha2": "AS", - "alpha3": "ASM", - "numeric3": "16" - }, - "AD": { - "countryName": "Andorra", - "postalCodeFormat": "AD.json", - "alpha2": "AD", - "alpha3": "AND", - "numeric3": "20" - }, - "AO": { - "countryName": "Angola", - "alpha2": "AO", - "alpha3": "AGO", - "numeric3": "24" - }, - "AI": { - "countryName": "Anguilla", - "postalCodeFormat": "AI.json", - "alpha2": "AI", - "alpha3": "AIA", - "numeric3": "660" - }, - "AQ": { - "countryName": "Antarctica", - "postalCodeFormat": "AQ.json", - "alpha2": "AQ", - "alpha3": "ATA", - "numeric3": "10" - }, - "AG": { - "countryName": "Antigua and Barbuda", - "alpha2": "AG", - "alpha3": "ATG", - "numeric3": "28" - }, - "AR": { - "countryName": "Argentina", - "postalCodeFormat": "4Digits.json", - "alpha2": "AR", - "alpha3": "ARG", - "numeric3": "32" - }, - "AM": { - "countryName": "Armenia", - "postalCodeFormat": "4Digits.json", - "alpha2": "AM", - "alpha3": "ARM", - "numeric3": "51" - }, - "AW": { - "countryName": "Aruba", - "alpha2": "AW", - "alpha3": "ABW", - "numeric3": "533" - }, - "AU": { - "countryName": "Australia", - "postalCodeFormat": "4Digits.json", - "alpha2": "AU", - "alpha3": "AUS", - "numeric3": "36" - }, - "AT": { - "countryName": "Austria", - "postalCodeFormat": "4Digits.json", - "alpha2": "AT", - "alpha3": "AUT", - "numeric3": "40" - }, - "AZ": { - "countryName": "Azerbaijan", - "postalCodeFormat": "AZ.json", - "alpha2": "AZ", - "alpha3": "AZE", - "numeric3": "31" - }, - "BS": { - "countryName": "Bahamas", - "alpha2": "BS", - "alpha3": "BHS", - "numeric3": "44" - }, - "BH": { - "countryName": "Bahrain", - "postalCodeFormat": "BH.json", - "alpha2": "BH", - "alpha3": "BHR", - "numeric3": "48" - }, - "BD": { - "countryName": "Bangladesh", - "postalCodeFormat": "4Digits.json", - "alpha2": "BD", - "alpha3": "BGD", - "numeric3": "50" - }, - "BB": { - "countryName": "Barbados", - "postalCodeFormat": "BB.json", - "alpha2": "BB", - "alpha3": "BRB", - "numeric3": "52" - }, - "BY": { - "countryName": "Belarus", - "postalCodeFormat": "6Digits.json", - "alpha2": "BY", - "alpha3": "BLR", - "numeric3": "112" - }, - "BE": { - "countryName": "Belgium", - "postalCodeFormat": "4Digits.json", - "alpha2": "BE", - "alpha3": "BEL", - "numeric3": "56" - }, - "BZ": { - "countryName": "Belize", - "alpha2": "BZ", - "alpha3": "BLZ", - "numeric3": "84" - }, - "BJ": { - "countryName": "Benin", - "alpha2": "BJ", - "alpha3": "BEN", - "numeric3": "204" - }, - "BM": { - "countryName": "Bermuda", - "alpha2": "BM", - "alpha3": "BMU", - "numeric3": "60" - }, - "BT": { - "countryName": "Bhutan", - "postalCodeFormat": "5Digits.json", - "alpha2": "BT", - "alpha3": "BTN", - "numeric3": "64" - }, - "BO": { - "countryName": "Bolivia", - "postalCodeFormat": "4Digits.json", - "alpha2": "BO", - "alpha3": "BOL", - "numeric3": "68" - }, - "BA": { - "countryName": "Bosnia and Herzegovina", - "postalCodeFormat": "5Digits.json", - "alpha2": "BA", - "alpha3": "BIH", - "numeric3": "70" - }, - "BW": { - "countryName": "Botswana", - "alpha2": "BW", - "alpha3": "BWA", - "numeric3": "72" - }, - "BV": { - "countryName": "Bouvet Island", - "alpha2": "BV", - "alpha3": "BVT", - "numeric3": "74" - }, - "BR": { - "countryName": "Brazil", - "postalCodeFormat": "8Digits.json", - "alpha2": "BR", - "alpha3": "BRA", - "numeric3": "76" - }, - "VG": { - "countryName": "British Virgin Islands", - "postalCodeFormat": "VG.json", - "alpha2": "VG", - "alpha3": "VGB", - "numeric3": "92" - }, - "IO": { - "countryName": "British Indian Ocean Territory", - "postalCodeFormat": "IO.json", - "alpha2": "IO", - "alpha3": "IOT", - "numeric3": "86" - }, - "BN": { - "countryName": "Brunei Darussalam", - "postalCodeFormat": "BN.json", - "alpha2": "BN", - "alpha3": "BRN", - "numeric3": "96" - }, - "BG": { - "countryName": "Bulgaria", - "postalCodeFormat": "4Digits.json", - "alpha2": "BG", - "alpha3": "BGR", - "numeric3": "100" - }, - "BF": { - "countryName": "Burkina Faso", - "alpha2": "BF", - "alpha3": "BFA", - "numeric3": "854" - }, - "BI": { - "countryName": "Burundi", - "alpha2": "BI", - "alpha3": "BDI", - "numeric3": "108" - }, - "KH": { - "countryName": "Cambodia", - "postalCodeFormat": "5Digits.json", - "alpha2": "KH", - "alpha3": "KHM", - "numeric3": "116" - }, - "CM": { - "countryName": "Cameroon", - "alpha2": "CM", - "alpha3": "CMR", - "numeric3": "120" - }, - "CA": { - "countryName": "Canada", - "postalCodeFormat": "CA.json", - "alpha2": "CA", - "alpha3": "CAN", - "numeric3": "124" - }, - "CV": { - "countryName": "Cape Verde", - "postalCodeFormat": "4Digits.json", - "alpha2": "CV", - "alpha3": "CPV", - "numeric3": "132" - }, - "KY": { - "countryName": "Cayman Islands", - "postalCodeFormat": "KY.json", - "alpha2": "KY", - "alpha3": "CYM", - "numeric3": "136" - }, - "CF": { - "countryName": "Central African Republic", - "alpha2": "CF", - "alpha3": "CAF", - "numeric3": "140" - }, - "TD": { - "countryName": "Chad", - "postalCodeFormat": "5Digits.json", - "alpha2": "TD", - "alpha3": "TCD", - "numeric3": "148" - }, - "CL": { - "countryName": "Chile", - "postalCodeFormat": "7Digits.json", - "alpha2": "CL", - "alpha3": "CHL", - "numeric3": "152" - }, - "CN": { - "countryName": "China", - "postalCodeFormat": "6Digits.json", - "alpha2": "CN", - "alpha3": "CHN", - "numeric3": "156" - }, - "HK": { - "countryName": "Hong Kong, Special Administrative Region of China", - "alpha2": "HK", - "alpha3": "HKG", - "numeric3": "344" - }, - "MO": { - "countryName": "Macao, Special Administrative Region of China", - "alpha2": "MO", - "alpha3": "MAC", - "numeric3": "446" - }, - "CX": { - "countryName": "Christmas Island", - "postalCodeFormat": "4Digits.json", - "alpha2": "CX", - "alpha3": "CXR", - "numeric3": "162" - }, - "CC": { - "countryName": "Cocos (Keeling) Islands", - "postalCodeFormat": "4Digits.json", - "alpha2": "CC", - "alpha3": "CCK", - "numeric3": "166" - }, - "CO": { - "countryName": "Colombia", - "postalCodeFormat": "6Digits.json", - "alpha2": "CO", - "alpha3": "COL", - "numeric3": "170" - }, - "KM": { - "countryName": "Comoros", - "alpha2": "KM", - "alpha3": "COM", - "numeric3": "174" - }, - "CG": { - "countryName": "Congo (Brazzaville)", - "alpha2": "CG", - "alpha3": "COG", - "numeric3": "178" - }, - "CD": { - "countryName": "Congo, Democratic Republic of the", - "alpha2": "CD", - "alpha3": "COD", - "numeric3": "180" - }, - "CK": { - "countryName": "Cook Islands", - "alpha2": "CK", - "alpha3": "COK", - "numeric3": "184" - }, - "CR": { - "countryName": "Costa Rica", - "postalCodeFormat": "5Digits.json", - "alpha2": "CR", - "alpha3": "CRI", - "numeric3": "188" - }, - "CI": { - "countryName": "Côte d'Ivoire", - "alpha2": "CI", - "alpha3": "CIV", - "numeric3": "384" - }, - "HR": { - "countryName": "Croatia", - "postalCodeFormat": "5Digits.json", - "alpha2": "HR", - "alpha3": "HRV", - "numeric3": "191" - }, - "CU": { - "countryName": "Cuba", - "postalCodeFormat": "5Digits.json", - "alpha2": "CU", - "alpha3": "CUB", - "numeric3": "192" - }, - "CY": { - "countryName": "Cyprus", - "postalCodeFormat": "4Digits.json", - "alpha2": "CY", - "alpha3": "CYP", - "numeric3": "196" - }, - "CZ": { - "countryName": "Czech Republic", - "postalCodeFormat": "5Digits.json", - "alpha2": "CZ", - "alpha3": "CZE", - "numeric3": "203" - }, - "DK": { - "countryName": "Denmark", - "postalCodeFormat": "4Digits.json", - "alpha2": "DK", - "alpha3": "DNK", - "numeric3": "208" - }, - "DJ": { - "countryName": "Djibouti", - "alpha2": "DJ", - "alpha3": "DJI", - "numeric3": "262" - }, - "DM": { - "countryName": "Dominica", - "alpha2": "DM", - "alpha3": "DMA", - "numeric3": "212" - }, - "DO": { - "countryName": "Dominican Republic", - "postalCodeFormat": "5Digits.json", - "alpha2": "DO", - "alpha3": "DOM", - "numeric3": "214" - }, - "EC": { - "countryName": "Ecuador", - "postalCodeFormat": "6Digits.json", - "alpha2": "EC", - "alpha3": "ECU", - "numeric3": "218" - }, - "EG": { - "countryName": "Egypt", - "postalCodeFormat": "5Digits.json", - "alpha2": "EG", - "alpha3": "EGY", - "numeric3": "818" - }, - "SV": { - "countryName": "El Salvador", - "postalCodeFormat": "4Digits.json", - "alpha2": "SV", - "alpha3": "SLV", - "numeric3": "222" - }, - "GQ": { - "countryName": "Equatorial Guinea", - "alpha2": "GQ", - "alpha3": "GNQ", - "numeric3": "226" - }, - "ER": { - "countryName": "Eritrea", - "alpha2": "ER", - "alpha3": "ERI", - "numeric3": "232" - }, - "EE": { - "countryName": "Estonia", - "postalCodeFormat": "5Digits.json", - "alpha2": "EE", - "alpha3": "EST", - "numeric3": "233" - }, - "ET": { - "countryName": "Ethiopia", - "postalCodeFormat": "4Digits.json", - "alpha2": "ET", - "alpha3": "ETH", - "numeric3": "231" - }, - "FK": { - "countryName": "Falkland Islands (Malvinas)", - "postalCodeFormat": "FK.json", - "alpha2": "FK", - "alpha3": "FLK", - "numeric3": "238" - }, - "FO": { - "countryName": "Faroe Islands", - "postalCodeFormat": "3Digits.json", - "alpha2": "FO", - "alpha3": "FRO", - "numeric3": "234" - }, - "FJ": { - "countryName": "Fiji", - "alpha2": "FJ", - "alpha3": "FJI", - "numeric3": "242" - }, - "FI": { - "countryName": "Finland", - "postalCodeFormat": "5Digits.json", - "alpha2": "FI", - "alpha3": "FIN", - "numeric3": "246" - }, - "FR": { - "countryName": "France", - "postalCodeFormat": "5Digits.json", - "alpha2": "FR", - "alpha3": "FRA", - "numeric3": "250" - }, - "GF": { - "countryName": "French Guiana", - "postalCodeFormat": "GF.json", - "alpha2": "GF", - "alpha3": "GUF", - "numeric3": "254" - }, - "PF": { - "countryName": "French Polynesia", - "postalCodeFormat": "PF.json", - "alpha2": "PF", - "alpha3": "PYF", - "numeric3": "258" - }, - "TF": { - "countryName": "French Southern Territories", - "alpha2": "TF", - "alpha3": "ATF", - "numeric3": "260" - }, - "GA": { - "countryName": "Gabon", - "alpha2": "GA", - "alpha3": "GAB", - "numeric3": "266" - }, - "GM": { - "countryName": "Gambia", - "alpha2": "GM", - "alpha3": "GMB", - "numeric3": "270" - }, - "GE": { - "countryName": "Georgia", - "postalCodeFormat": "4Digits.json", - "alpha2": "GE", - "alpha3": "GEO", - "numeric3": "268" - }, - "DE": { - "countryName": "Germany", - "postalCodeFormat": "5Digits.json", - "alpha2": "DE", - "alpha3": "DEU", - "numeric3": "276" - }, - "GH": { - "countryName": "Ghana", - "alpha2": "GH", - "alpha3": "GHA", - "numeric3": "288" - }, - "GI": { - "countryName": "Gibraltar", - "postalCodeFormat": "GI.json", - "alpha2": "GI", - "alpha3": "GIB", - "numeric3": "292" - }, - "GR": { - "countryName": "Greece", - "postalCodeFormat": "5Digits.json", - "alpha2": "GR", - "alpha3": "GRC", - "numeric3": "300" - }, - "GL": { - "countryName": "Greenland", - "postalCodeFormat": "4Digits.json", - "alpha2": "GL", - "alpha3": "GRL", - "numeric3": "304" - }, - "GD": { - "countryName": "Grenada", - "alpha2": "GD", - "alpha3": "GRD", - "numeric3": "308" - }, - "GP": { - "countryName": "Guadeloupe", - "postalCodeFormat": "GP.json", - "alpha2": "GP", - "alpha3": "GLP", - "numeric3": "312" - }, - "GU": { - "countryName": "Guam", - "postalCodeFormat": "US.json", - "alpha2": "GU", - "alpha3": "GUM", - "numeric3": "316" - }, - "GT": { - "countryName": "Guatemala", - "postalCodeFormat": "5Digits.json", - "alpha2": "GT", - "alpha3": "GTM", - "numeric3": "320" - }, - "GG": { - "countryName": "Guernsey", - "postalCodeFormat": "GB.json", - "alpha2": "GG", - "alpha3": "GGY", - "numeric3": "831" - }, - "GN": { - "countryName": "Guinea", - "postalCodeFormat": "3Digits.json", - "alpha2": "GN", - "alpha3": "GIN", - "numeric3": "324" - }, - "GW": { - "countryName": "Guinea-Bissau", - "postalCodeFormat": "4Digits.json", - "alpha2": "GW", - "alpha3": "GNB", - "numeric3": "624" - }, - "GY": { - "countryName": "Guyana", - "alpha2": "GY", - "alpha3": "GUY", - "numeric3": "328" - }, - "HT": { - "countryName": "Haiti", - "postalCodeFormat": "4Digits.json", - "alpha2": "HT", - "alpha3": "HTI", - "numeric3": "332" - }, - "HM": { - "countryName": "Heard Island and Mcdonald Islands", - "postalCodeFormat": "4Digits.json", - "alpha2": "HM", - "alpha3": "HMD", - "numeric3": "334" - }, - "VA": { - "countryName": "Holy See (Vatican City State)", - "postalCodeFormat": "VA.json", - "alpha2": "VA", - "alpha3": "VAT", - "numeric3": "336" - }, - "HN": { - "countryName": "Honduras", - "postalCodeFormat": "HN.json", - "alpha2": "HN", - "alpha3": "HND", - "numeric3": "340" - }, - "HU": { - "countryName": "Hungary", - "postalCodeFormat": "4Digits.json", - "alpha2": "HU", - "alpha3": "HUN", - "numeric3": "348" - }, - "IS": { - "countryName": "Iceland", - "postalCodeFormat": "3Digits.json", - "alpha2": "IS", - "alpha3": "ISL", - "numeric3": "352" - }, - "IN": { - "countryName": "India", - "postalCodeFormat": "6Digits.json", - "alpha2": "IN", - "alpha3": "IND", - "numeric3": "356" - }, - "ID": { - "countryName": "Indonesia", - "postalCodeFormat": "5Digits.json", - "alpha2": "ID", - "alpha3": "IDN", - "numeric3": "360" - }, - "IR": { - "countryName": "Iran, Islamic Republic of", - "postalCodeFormat": "10Digits.json", - "alpha2": "IR", - "alpha3": "IRN", - "numeric3": "364" - }, - "IQ": { - "countryName": "Iraq", - "postalCodeFormat": "5Digits.json", - "alpha2": "IQ", - "alpha3": "IRQ", - "numeric3": "368" - }, - "IE": { - "countryName": "Ireland", - "alpha2": "IE", - "alpha3": "IRL", - "numeric3": "372" - }, - "IM": { - "countryName": "Isle of Man", - "postalCodeFormat": "GB.json", - "alpha2": "IM", - "alpha3": "IMN", - "numeric3": "833" - }, - "IL": { - "countryName": "Israel", - "postalCodeFormat": "7Digits.json", - "alpha2": "IL", - "alpha3": "ISR", - "numeric3": "376" - }, - "IT": { - "countryName": "Italy", - "postalCodeFormat": "5Digits.json", - "alpha2": "IT", - "alpha3": "ITA", - "numeric3": "380" - }, - "JM": { - "countryName": "Jamaica", - "postalCodeFormat": "2Digits.json", - "alpha2": "JM", - "alpha3": "JAM", - "numeric3": "388" - }, - "JP": { - "countryName": "Japan", - "postalCodeFormat": "7Digits.json", - "alpha2": "JP", - "alpha3": "JPN", - "numeric3": "392" - }, - "JE": { - "countryName": "Jersey", - "postalCodeFormat": "GB.json", - "alpha2": "JE", - "alpha3": "JEY", - "numeric3": "832" - }, - "JO": { - "countryName": "Jordan", - "postalCodeFormat": "5Digits.json", - "alpha2": "JO", - "alpha3": "JOR", - "numeric3": "400" - }, - "KZ": { - "countryName": "Kazakhstan", - "postalCodeFormat": "6Digits.json", - "alpha2": "KZ", - "alpha3": "KAZ", - "numeric3": "398" - }, - "KE": { - "countryName": "Kenya", - "postalCodeFormat": "5Digits.json", - "alpha2": "KE", - "alpha3": "KEN", - "numeric3": "404" - }, - "KI": { - "countryName": "Kiribati", - "alpha2": "KI", - "alpha3": "KIR", - "numeric3": "296" - }, - "KP": { - "countryName": "Korea, Democratic People's Republic of", - "alpha2": "KP", - "alpha3": "PRK", - "numeric3": "408" - }, - "KR": { - "countryName": "Korea, Republic of", - "postalCodeFormat": "5Digits.json", - "alpha2": "KR", - "alpha3": "KOR", - "numeric3": "410" - }, - "KW": { - "countryName": "Kuwait", - "postalCodeFormat": "5Digits.json", - "alpha2": "KW", - "alpha3": "KWT", - "numeric3": "414" - }, - "KG": { - "countryName": "Kyrgyzstan", - "postalCodeFormat": "6Digits.json", - "alpha2": "KG", - "alpha3": "KGZ", - "numeric3": "417" - }, - "LA": { - "countryName": "Lao PDR", - "postalCodeFormat": "5Digits.json", - "alpha2": "LA", - "alpha3": "LAO", - "numeric3": "418" - }, - "LV": { - "countryName": "Latvia", - "postalCodeFormat": "LV.json", - "alpha2": "LV", - "alpha3": "LVA", - "numeric3": "428" - }, - "LB": { - "countryName": "Lebanon", - "postalCodeFormat": "LB.json", - "alpha2": "LB", - "alpha3": "LBN", - "numeric3": "422" - }, - "LS": { - "countryName": "Lesotho", - "postalCodeFormat": "3Digits.json", - "alpha2": "LS", - "alpha3": "LSO", - "numeric3": "426" - }, - "LR": { - "countryName": "Liberia", - "postalCodeFormat": "4Digits.json", - "alpha2": "LR", - "alpha3": "LBR", - "numeric3": "430" - }, - "LY": { - "countryName": "Libya", - "postalCodeFormat": "5Digits.json", - "alpha2": "LY", - "alpha3": "LBY", - "numeric3": "434" - }, - "LI": { - "countryName": "Liechtenstein", - "postalCodeFormat": "4Digits.json", - "alpha2": "LI", - "alpha3": "LIE", - "numeric3": "438" - }, - "LT": { - "countryName": "Lithuania", - "postalCodeFormat": "LT.json", - "alpha2": "LT", - "alpha3": "LTU", - "numeric3": "440" - }, - "LU": { - "countryName": "Luxembourg", - "postalCodeFormat": "4Digits.json", - "alpha2": "LU", - "alpha3": "LUX", - "numeric3": "442" - }, - "MK": { - "countryName": "Macedonia, Republic of", - "postalCodeFormat": "4Digits.json", - "alpha2": "MK", - "alpha3": "MKD", - "numeric3": "807" - }, - "MG": { - "countryName": "Madagascar", - "postalCodeFormat": "3Digits.json", - "alpha2": "MG", - "alpha3": "MDG", - "numeric3": "450" - }, - "MW": { - "countryName": "Malawi", - "alpha2": "MW", - "alpha3": "MWI", - "numeric3": "454" - }, - "MY": { - "countryName": "Malaysia", - "postalCodeFormat": "5Digits.json", - "alpha2": "MY", - "alpha3": "MYS", - "numeric3": "458" - }, - "MV": { - "countryName": "Maldives", - "postalCodeFormat": "5Digits.json", - "alpha2": "MV", - "alpha3": "MDV", - "numeric3": "462" - }, - "ML": { - "countryName": "Mali", - "alpha2": "ML", - "alpha3": "MLI", - "numeric3": "466" - }, - "MT": { - "countryName": "Malta", - "postalCodeFormat": "MT.json", - "alpha2": "MT", - "alpha3": "MLT", - "numeric3": "470" - }, - "MH": { - "countryName": "Marshall Islands", - "postalCodeFormat": "US.json", - "alpha2": "MH", - "alpha3": "MHL", - "numeric3": "584" - }, - "MQ": { - "countryName": "Martinique", - "postalCodeFormat": "5Digits.json", - "alpha2": "MQ", - "alpha3": "MTQ", - "numeric3": "474" - }, - "MR": { - "countryName": "Mauritania", - "alpha2": "MR", - "alpha3": "MRT", - "numeric3": "478" - }, - "MU": { - "countryName": "Mauritius", - "postalCodeFormat": "5Digits.json", - "alpha2": "MU", - "alpha3": "MUS", - "numeric3": "480" - }, - "YT": { - "countryName": "Mayotte", - "postalCodeFormat": "5Digits.json", - "alpha2": "YT", - "alpha3": "MYT", - "numeric3": "175" - }, - "MX": { - "countryName": "Mexico", - "postalCodeFormat": "5Digits.json", - "alpha2": "MX", - "alpha3": "MEX", - "numeric3": "484" - }, - "FM": { - "countryName": "Micronesia, Federated States of", - "postalCodeFormat": "US.json", - "alpha2": "FM", - "alpha3": "FSM", - "numeric3": "583" - }, - "MD": { - "countryName": "Moldova", - "postalCodeFormat": "MD.json", - "alpha2": "MD", - "alpha3": "MDA", - "numeric3": "498" - }, - "MC": { - "countryName": "Monaco", - "postalCodeFormat": "5Digits.json", - "alpha2": "MC", - "alpha3": "MCO", - "numeric3": "492" - }, - "MN": { - "countryName": "Mongolia", - "postalCodeFormat": "5Digits.json", - "alpha2": "MN", - "alpha3": "MNG", - "numeric3": "496" - }, - "ME": { - "countryName": "Montenegro", - "postalCodeFormat": "5Digits.json", - "alpha2": "ME", - "alpha3": "MNE", - "numeric3": "499" - }, - "MS": { - "countryName": "Montserrat", - "postalCodeFormat": "MS.json", - "alpha2": "MS", - "alpha3": "MSR", - "numeric3": "500" - }, - "MA": { - "countryName": "Morocco", - "postalCodeFormat": "5Digits.json", - "alpha2": "MA", - "alpha3": "MAR", - "numeric3": "504" - }, - "MZ": { - "countryName": "Mozambique", - "postalCodeFormat": "4Digits.json", - "alpha2": "MZ", - "alpha3": "MOZ", - "numeric3": "508" - }, - "MM": { - "countryName": "Myanmar", - "postalCodeFormat": "5Digits.json", - "alpha2": "MM", - "alpha3": "MMR", - "numeric3": "104" - }, - "NA": { - "countryName": "Namibia", - "postalCodeFormat": "5Digits.json", - "alpha2": "NA", - "alpha3": "NAM", - "numeric3": "516" - }, - "NR": { - "countryName": "Nauru", - "alpha2": "NR", - "alpha3": "NRU", - "numeric3": "520" - }, - "NP": { - "countryName": "Nepal", - "postalCodeFormat": "5Digits.json", - "alpha2": "NP", - "alpha3": "NPL", - "numeric3": "524" - }, - "NL": { - "countryName": "Netherlands", - "postalCodeFormat": "NL.json", - "alpha2": "NL", - "alpha3": "NLD", - "numeric3": "528" - }, - "AN": { - "countryName": "Netherlands Antilles", - "alpha2": "AN", - "alpha3": "ANT", - "numeric3": "530" - }, - "NC": { - "countryName": "New Caledonia", - "postalCodeFormat": "NC.json", - "alpha2": "NC", - "alpha3": "NCL", - "numeric3": "540" - }, - "NZ": { - "countryName": "New Zealand", - "postalCodeFormat": "4Digits.json", - "alpha2": "NZ", - "alpha3": "NZL", - "numeric3": "554" - }, - "NI": { - "countryName": "Nicaragua", - "postalCodeFormat": "5Digits.json", - "alpha2": "NI", - "alpha3": "NIC", - "numeric3": "558" - }, - "NE": { - "countryName": "Niger", - "postalCodeFormat": "4Digits.json", - "alpha2": "NE", - "alpha3": "NER", - "numeric3": "562" - }, - "NG": { - "countryName": "Nigeria", - "postalCodeFormat": "6Digits.json", - "alpha2": "NG", - "alpha3": "NGA", - "numeric3": "566" - }, - "NU": { - "countryName": "Niue", - "alpha2": "NU", - "alpha3": "NIU", - "numeric3": "570" - }, - "NF": { - "countryName": "Norfolk Island", - "postalCodeFormat": "4Digits.json", - "alpha2": "NF", - "alpha3": "NFK", - "numeric3": "574" - }, - "MP": { - "countryName": "Northern Mariana Islands", - "postalCodeFormat": "US.json", - "alpha2": "MP", - "alpha3": "MNP", - "numeric3": "580" - }, - "NO": { - "countryName": "Norway", - "postalCodeFormat": "4Digits.json", - "alpha2": "NO", - "alpha3": "NOR", - "numeric3": "578" - }, - "OM": { - "countryName": "Oman", - "postalCodeFormat": "3Digits.json", - "alpha2": "OM", - "alpha3": "OMN", - "numeric3": "512" - }, - "PK": { - "countryName": "Pakistan", - "postalCodeFormat": "5Digits.json", - "alpha2": "PK", - "alpha3": "PAK", - "numeric3": "586" - }, - "PW": { - "countryName": "Palau", - "postalCodeFormat": "US.json", - "alpha2": "PW", - "alpha3": "PLW", - "numeric3": "585" - }, - "PS": { - "countryName": "Palestinian Territory, Occupied", - "postalCodeFormat": "3Digits.json", - "alpha2": "PS", - "alpha3": "PSE", - "numeric3": "275" - }, - "PA": { - "countryName": "Panama", - "postalCodeFormat": "6Digits.json", - "alpha2": "PA", - "alpha3": "PAN", - "numeric3": "591" - }, - "PG": { - "countryName": "Papua New Guinea", - "postalCodeFormat": "3Digits.json", - "alpha2": "PG", - "alpha3": "PNG", - "numeric3": "598" - }, - "PY": { - "countryName": "Paraguay", - "postalCodeFormat": "4Digits.json", - "alpha2": "PY", - "alpha3": "PRY", - "numeric3": "600" - }, - "PE": { - "countryName": "Peru", - "postalCodeFormat": "5Digits.json", - "alpha2": "PE", - "alpha3": "PER", - "numeric3": "604" - }, - "PH": { - "countryName": "Philippines", - "postalCodeFormat": "4Digits.json", - "alpha2": "PH", - "alpha3": "PHL", - "numeric3": "608" - }, - "PN": { - "countryName": "Pitcairn", - "postalCodeFormat": "PN.json", - "alpha2": "PN", - "alpha3": "PCN", - "numeric3": "612" - }, - "PL": { - "countryName": "Poland", - "postalCodeFormat": "PL.json", - "alpha2": "PL", - "alpha3": "POL", - "numeric3": "616" - }, - "PT": { - "countryName": "Portugal", - "postalCodeFormat": "PT.json", - "alpha2": "PT", - "alpha3": "PRT", - "numeric3": "620" - }, - "PR": { - "countryName": "Puerto Rico", - "postalCodeFormat": "US.json", - "alpha2": "PR", - "alpha3": "PRI", - "numeric3": "630" - }, - "QA": { - "countryName": "Qatar", - "alpha2": "QA", - "alpha3": "QAT", - "numeric3": "634" - }, - "RE": { - "countryName": "Réunion", - "postalCodeFormat": "RE.json", - "alpha2": "RE", - "alpha3": "REU", - "numeric3": "638" - }, - "RO": { - "countryName": "Romania", - "postalCodeFormat": "6Digits.json", - "alpha2": "RO", - "alpha3": "ROU", - "numeric3": "642" - }, - "RU": { - "countryName": "Russian Federation", - "postalCodeFormat": "RU.json", - "alpha2": "RU", - "alpha3": "RUS", - "numeric3": "643" - }, - "RW": { - "countryName": "Rwanda", - "alpha2": "RW", - "alpha3": "RWA", - "numeric3": "646" - }, - "BL": { - "countryName": "Saint-Barthélemy", - "postalCodeFormat": "BL.json", - "alpha2": "BL", - "alpha3": "BLM", - "numeric3": "652" - }, - "SH": { - "countryName": "Saint Helena", - "postalCodeFormat": "SH.json", - "alpha2": "SH", - "alpha3": "SHN", - "numeric3": "654" - }, - "KN": { - "countryName": "Saint Kitts and Nevis", - "alpha2": "KN", - "alpha3": "KNA", - "numeric3": "659" - }, - "LC": { - "countryName": "Saint Lucia", - "postalCodeFormat": "LC.json", - "alpha2": "LC", - "alpha3": "LCA", - "numeric3": "662" - }, - "MF": { - "countryName": "Saint-Martin (French part)", - "postalCodeFormat": "MF.json", - "alpha2": "MF", - "alpha3": "MAF", - "numeric3": "663" - }, - "PM": { - "countryName": "Saint Pierre and Miquelon", - "postalCodeFormat": "PM.json", - "alpha2": "PM", - "alpha3": "SPM", - "numeric3": "666" - }, - "VC": { - "countryName": "Saint Vincent and Grenadines", - "postalCodeFormat": "VC.json", - "alpha2": "VC", - "alpha3": "VCT", - "numeric3": "670" - }, - "WS": { - "countryName": "Samoa", - "postalCodeFormat": "WS.json", - "alpha2": "WS", - "alpha3": "WSM", - "numeric3": "882" - }, - "SM": { - "countryName": "San Marino", - "postalCodeFormat": "SM.json", - "alpha2": "SM", - "alpha3": "SMR", - "numeric3": "674" - }, - "ST": { - "countryName": "Sao Tome and Principe", - "alpha2": "ST", - "alpha3": "STP", - "numeric3": "678" - }, - "SA": { - "countryName": "Saudi Arabia", - "postalCodeFormat": "US.json", - "alpha2": "SA", - "alpha3": "SAU", - "numeric3": "682" - }, - "SN": { - "countryName": "Senegal", - "postalCodeFormat": "5Digits.json", - "alpha2": "SN", - "alpha3": "SEN", - "numeric3": "686" - }, - "RS": { - "countryName": "Serbia", - "postalCodeFormat": "5Digits.json", - "alpha2": "RS", - "alpha3": "SRB", - "numeric3": "688" - }, - "SC": { - "countryName": "Seychelles", - "alpha2": "SC", - "alpha3": "SYC", - "numeric3": "690" - }, - "SL": { - "countryName": "Sierra Leone", - "alpha2": "SL", - "alpha3": "SLE", - "numeric3": "694" - }, - "SG": { - "countryName": "Singapore", - "postalCodeFormat": "6Digits.json", - "alpha2": "SG", - "alpha3": "SGP", - "numeric3": "702" - }, - "SK": { - "countryName": "Slovakia", - "postalCodeFormat": "5Digits.json", - "alpha2": "SK", - "alpha3": "SVK", - "numeric3": "703" - }, - "SI": { - "countryName": "Slovenia", - "postalCodeFormat": "4Digits.json", - "alpha2": "SI", - "alpha3": "SVN", - "numeric3": "705" - }, - "SB": { - "countryName": "Solomon Islands", - "alpha2": "SB", - "alpha3": "SLB", - "numeric3": "90" - }, - "SO": { - "countryName": "Somalia", - "postalCodeFormat": "SO.json", - "alpha2": "SO", - "alpha3": "SOM", - "numeric3": "706" - }, - "ZA": { - "countryName": "South Africa", - "postalCodeFormat": "4Digits.json", - "alpha2": "ZA", - "alpha3": "ZAF", - "numeric3": "710" - }, - "GS": { - "countryName": "South Georgia and the South Sandwich Islands", - "postalCodeFormat": "GS.json", - "alpha2": "GS", - "alpha3": "SGS", - "numeric3": "239" - }, - "SS": { - "countryName": "South Sudan", - "alpha2": "SS", - "alpha3": "SSD", - "numeric3": "728" - }, - "ES": { - "countryName": "Spain", - "postalCodeFormat": "5Digits.json", - "alpha2": "ES", - "alpha3": "ESP", - "numeric3": "724" - }, - "LK": { - "countryName": "Sri Lanka", - "postalCodeFormat": "5Digits.json", - "alpha2": "LK", - "alpha3": "LKA", - "numeric3": "144" - }, - "SD": { - "countryName": "Sudan", - "postalCodeFormat": "5Digits.json", - "alpha2": "SD", - "alpha3": "SDN", - "numeric3": "736" - }, - "SR": { - "countryName": "Suriname *", - "alpha2": "SR", - "alpha3": "SUR", - "numeric3": "740" - }, - "SJ": { - "countryName": "Svalbard and Jan Mayen Islands", - "postalCodeFormat": "4Digits.json", - "alpha2": "SJ", - "alpha3": "SJM", - "numeric3": "744" - }, - "SZ": { - "countryName": "Swaziland", - "postalCodeFormat": "SZ.json", - "alpha2": "SZ", - "alpha3": "SWZ", - "numeric3": "748" - }, - "SE": { - "countryName": "Sweden", - "postalCodeFormat": "5Digits.json", - "alpha2": "SE", - "alpha3": "SWE", - "numeric3": "752" - }, - "CH": { - "countryName": "Switzerland", - "postalCodeFormat": "4Digits.json", - "alpha2": "CH", - "alpha3": "CHE", - "numeric3": "756" - }, - "SY": { - "countryName": "Syrian Arab Republic (Syria)", - "alpha2": "SY", - "alpha3": "SYR", - "numeric3": "760" - }, - "TW": { - "countryName": "Taiwan, Republic of China", - "postalCodeFormat": "5Digits.json", - "alpha2": "TW", - "alpha3": "TWN", - "numeric3": "158" - }, - "TJ": { - "countryName": "Tajikistan", - "postalCodeFormat": "6Digits.json", - "alpha2": "TJ", - "alpha3": "TJK", - "numeric3": "762" - }, - "TZ": { - "countryName": "Tanzania *, United Republic of", - "postalCodeFormat": "5Digits.json", - "alpha2": "TZ", - "alpha3": "TZA", - "numeric3": "834" - }, - "TH": { - "countryName": "Thailand", - "postalCodeFormat": "5Digits.json", - "alpha2": "TH", - "alpha3": "THA", - "numeric3": "764" - }, - "TL": { - "countryName": "Timor-Leste", - "alpha2": "TL", - "alpha3": "TLS", - "numeric3": "626" - }, - "TG": { - "countryName": "Togo", - "alpha2": "TG", - "alpha3": "TGO", - "numeric3": "768" - }, - "TK": { - "countryName": "Tokelau", - "alpha2": "TK", - "alpha3": "TKL", - "numeric3": "772" - }, - "TO": { - "countryName": "Tonga", - "alpha2": "TO", - "alpha3": "TON", - "numeric3": "776" - }, - "TT": { - "countryName": "Trinidad and Tobago", - "postalCodeFormat": "6Digits.json", - "alpha2": "TT", - "alpha3": "TTO", - "numeric3": "780" - }, - "TN": { - "countryName": "Tunisia", - "postalCodeFormat": "4Digits.json", - "alpha2": "TN", - "alpha3": "TUN", - "numeric3": "788" - }, - "TR": { - "countryName": "Turkey", - "postalCodeFormat": "5Digits.json", - "alpha2": "TR", - "alpha3": "TUR", - "numeric3": "792" - }, - "TM": { - "countryName": "Turkmenistan", - "postalCodeFormat": "6Digits.json", - "alpha2": "TM", - "alpha3": "TKM", - "numeric3": "795" - }, - "TC": { - "countryName": "Turks and Caicos Islands", - "postalCodeFormat": "TC.json", - "alpha2": "TC", - "alpha3": "TCA", - "numeric3": "796" - }, - "TV": { - "countryName": "Tuvalu", - "alpha2": "TV", - "alpha3": "TUV", - "numeric3": "798" - }, - "UG": { - "countryName": "Uganda", - "alpha2": "UG", - "alpha3": "UGA", - "numeric3": "800" - }, - "UA": { - "countryName": "Ukraine", - "postalCodeFormat": "5Digits.json", - "alpha2": "UA", - "alpha3": "UKR", - "numeric3": "804" - }, - "AE": { - "countryName": "United Arab Emirates", - "alpha2": "AE", - "alpha3": "ARE", - "numeric3": "784" - }, - "GB": { - "countryName": "United Kingdom", - "postalCodeFormat": "GB.json", - "alpha2": "GB", - "alpha3": "GBR", - "numeric3": "826" - }, - "US": { - "countryName": "United States of America", - "postalCodeFormat": "US.json", - "alpha2": "US", - "alpha3": "USA", - "numeric3": "840" - }, - "UM": { - "countryName": "United States Minor Outlying Islands", - "alpha2": "UM", - "alpha3": "UMI", - "numeric3": "581" - }, - "UY": { - "countryName": "Uruguay", - "postalCodeFormat": "5Digits.json", - "alpha2": "UY", - "alpha3": "URY", - "numeric3": "858" - }, - "UZ": { - "countryName": "Uzbekistan", - "postalCodeFormat": "6Digits.json", - "alpha2": "UZ", - "alpha3": "UZB", - "numeric3": "860" - }, - "VU": { - "countryName": "Vanuatu", - "alpha2": "VU", - "alpha3": "VUT", - "numeric3": "548" - }, - "VE": { - "countryName": "Venezuela (Bolivarian Republic of)", - "postalCodeFormat": "VE.json", - "alpha2": "VE", - "alpha3": "VEN", - "numeric3": "862" - }, - "VN": { - "countryName": "Viet Nam", - "postalCodeFormat": "6Digits.json", - "alpha2": "VN", - "alpha3": "VNM", - "numeric3": "704" - }, - "VI": { - "countryName": "Virgin Islands, US", - "postalCodeFormat": "US.json", - "alpha2": "VI", - "alpha3": "VIR", - "numeric3": "850" - }, - "WF": { - "countryName": "Wallis and Futuna Islands", - "postalCodeFormat": "WF.json", - "alpha2": "WF", - "alpha3": "WLF", - "numeric3": "876" - }, - "EH": { - "countryName": "Western Sahara", - "alpha2": "EH", - "alpha3": "ESH", - "numeric3": "732" - }, - "YE": { - "countryName": "Yemen", - "alpha2": "YE", - "alpha3": "YEM", - "numeric3": "887" - }, - "ZM": { - "countryName": "Zambia", - "postalCodeFormat": "5Digits.json", - "alpha2": "ZM", - "alpha3": "ZMB", - "numeric3": "894" - }, - "ZW": { - "countryName": "Zimbabwe", - "alpha2": "ZW", - "alpha3": "ZWE", - "numeric3": "716" - } -}; - -/***/ }), -/* 62 */ -/***/ (function(module, exports, __webpack_require__) { - -var getType = __webpack_require__(2); -var util = __webpack_require__(73); - -function genKeysFunc(f) { - return function(value) { - var k = f(value); - k.sort(); - return k; - }; -} - - -function Formatter(opts) { - opts = opts || {}; - - this.seen = []; - this.keys = genKeysFunc(opts.keys === false ? Object.getOwnPropertyNames : Object.keys); - - this.maxLineLength = typeof opts.maxLineLength === 'number' ? opts.maxLineLength : 60; - this.propSep = opts.propSep || ','; - - this.isUTCdate = !!opts.isUTCdate; -} - -Formatter.prototype = { - constructor: Formatter, - - format: function(value) { - var t = getType(value); - var name1 = t.type, name2 = t.type; - if(t.cls) { - name1 += '_' + t.cls; - name2 += '_' + t.cls; - } - if(t.sub) { - name2 += '_' + t.sub; - } - var f = this['_format_' + name2] || this['_format_' + name1] || this['_format_' + t.type] || this.defaultFormat; - return f.call(this, value).trim(); - }, - - _formatObject: function(value, opts) { - opts = opts || {}; - var mainKeys = opts.keys || this.keys(value); - - var len = 0; - - var formatPropertyValue = opts.formatPropertyValue || this.formatPropertyValue; - var formatPropertyName = opts.formatPropertyName || this.formatPropertyName; - var keyValueSep = opts.keyValueSep || ': '; - var keyFilter = opts.keyFilter || function() { return true; }; - - this.seen.push(value); - var keys = []; - - mainKeys.forEach(function(key) { - if(!keyFilter(key)) return; - - var fName = formatPropertyName.call(this, key); - - var f = (fName ? fName + keyValueSep : '') + formatPropertyValue.call(this, value, key); - len += f.length; - keys.push(f); - }, this); - this.seen.pop(); - - (opts.additionalProperties || []).forEach(function(keyValue) { - var f = keyValue[0] + keyValueSep + this.format(keyValue[1]); - len += f.length; - keys.push(f); - }, this); - - var prefix = opts.prefix || Formatter.constructorName(value) || ''; - if(prefix.length > 0) prefix += ' '; - - var lbracket, rbracket; - if(Array.isArray(opts.brackets)) { - lbracket = opts.brackets && opts.brackets[0]; - rbracket = opts.brackets && opts.brackets[1]; - } else { - lbracket = '{'; - rbracket = '}'; - } - - var rootValue = opts.value || ''; - - if(keys.length === 0) - return rootValue || (prefix + lbracket + rbracket); - - if(len <= this.maxLineLength) { - return prefix + lbracket + ' ' + (rootValue ? rootValue + ' ' : '') + keys.join(this.propSep + ' ') + ' ' + rbracket; - } else { - return prefix + lbracket + '\n' + (rootValue ? ' ' + rootValue + '\n' : '') + keys.map(util.addSpaces).join(this.propSep + '\n') + '\n' + rbracket; - } - }, - - formatObject: function(value, prefix, props) { - props = props || this.keys(value); - - var len = 0; - - this.seen.push(value); - props = props.map(function(prop) { - var f = this.formatProperty(value, prop); - len += f.length; - return f; - }, this); - this.seen.pop(); - - if(props.length === 0) return '{}'; - - if(len <= this.maxLineLength) { - return '{ ' + (prefix ? prefix + ' ' : '') + props.join(this.propSep + ' ') + ' }'; - } else { - return '{' + '\n' + (prefix ? ' ' + prefix + '\n' : '') + props.map(util.addSpaces).join(this.propSep + '\n') + '\n' + '}'; - } - }, - - formatPropertyName: function(name) { - return name.match(/^[a-zA-Z_$][a-zA-Z_$0-9]*$/) ? name : this.format(name); - }, - - formatProperty: function(value, prop) { - var desc = Formatter.getPropertyDescriptor(value, prop); - - var propName = this.formatPropertyName(prop); - - var propValue = desc.get && desc.set ? - '[Getter/Setter]' : desc.get ? - '[Getter]' : desc.set ? - '[Setter]' : this.seen.indexOf(desc.value) >= 0 ? - '[Circular]' : - this.format(desc.value); - - return propName + ': ' + propValue; - }, - - formatPropertyValue: function(value, prop) { - var desc = Formatter.getPropertyDescriptor(value, prop); - - var propValue = desc.get && desc.set ? - '[Getter/Setter]' : desc.get ? - '[Getter]' : desc.set ? - '[Setter]' : this.seen.indexOf(desc.value) >= 0 ? - '[Circular]' : - this.format(desc.value); - - return propValue; - } -}; - -Formatter.add = function add(type, cls, sub, f) { - var args = Array.prototype.slice.call(arguments); - f = args.pop(); - Formatter.prototype['_format_' + args.join('_')] = f; -}; - -Formatter.formatObjectWithPrefix = function formatObjectWithPrefix(f) { - return function(value) { - var prefix = f.call(this, value); - var props = this.keys(value); - if(props.length == 0) return prefix; - else return this.formatObject(value, prefix, props); - }; -}; - -var functionNameRE = /^\s*function\s*(\S*)\s*\(/; - -Formatter.functionName = function functionName(f) { - if(f.name) { - return f.name; - } - var matches = f.toString().match(functionNameRE); - if (matches === null) { - // `functionNameRE` doesn't match arrow functions. - return ''; - } - var name = matches[1]; - return name; -}; - -Formatter.constructorName = function(obj) { - while (obj) { - var descriptor = Object.getOwnPropertyDescriptor(obj, 'constructor'); - if (descriptor !== undefined && - typeof descriptor.value === 'function') { - - var name = Formatter.functionName(descriptor.value); - if(name !== '') { - return name; - } - } - - obj = Object.getPrototypeOf(obj); - } -}; - -Formatter.getPropertyDescriptor = function(obj, value) { - var desc; - try { - desc = Object.getOwnPropertyDescriptor(obj, value) || {value: obj[value]}; - } catch(e) { - desc = {value: e}; - } - return desc; -}; - -Formatter.generateFunctionForIndexedArray = function generateFunctionForIndexedArray(lengthProp, name, padding) { - return function(value) { - var max = this.byteArrayMaxLength || 50; - var length = value[lengthProp]; - var formattedValues = []; - var len = 0; - for(var i = 0; i < max && i < length; i++) { - var b = value[i] || 0; - var v = util.pad0(b.toString(16), padding); - len += v.length; - formattedValues.push(v); - } - var prefix = value.constructor.name || name || ''; - if(prefix) prefix += ' '; - - if(formattedValues.length === 0) - return prefix + '[]'; - - if(len <= this.maxLineLength) { - return prefix + '[ ' + formattedValues.join(this.propSep + ' ') + ' ' + ']'; - } else { - return prefix + '[\n' + formattedValues.map(util.addSpaces).join(this.propSep + '\n') + '\n' + ']'; - } - }; -}; - -Formatter.add('undefined', function() { return 'undefined' }); -Formatter.add('null', function() { return 'null' }); -Formatter.add('boolean', function(value) { return value ? 'true': 'false' }); -Formatter.add('symbol', function(value) { return value.toString() }); - -['number', 'boolean'].forEach(function(name) { - Formatter.add('object', name, function(value) { - return this._formatObject(value, { - additionalProperties: [['[[PrimitiveValue]]', value.valueOf()]] - }); - }); -}); - -Formatter.add('object', 'string', function(value) { - var realValue = value.valueOf(); - - return this._formatObject(value, { - keyFilter: function(key) { - //skip useless indexed properties - return !(key.match(/\d+/) && parseInt(key, 10) < realValue.length); - }, - additionalProperties: [['[[PrimitiveValue]]', realValue]] - }); -}); - -Formatter.add('object', 'regexp', function(value) { - return this._formatObject(value, { - value: String(value) - }); -}); - -Formatter.add('number', function(value) { - if(value === 0 && 1 / value < 0) return '-0'; - return String(value); -}); - -Formatter.add('string', function(value) { - return '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; -}); - -Formatter.add('object', function(value) { - return this._formatObject(value); -}); - -Formatter.add('object', 'arguments', function(value) { - return this._formatObject(value, { - prefix: 'Arguments', - formatPropertyName: function(key) { - if(!key.match(/\d+/)) { - return this.formatPropertyName(key); - } - }, - brackets: ['[', ']'] - }); -}); - -Formatter.add('object', 'array', function(value) { - return this._formatObject(value, { - formatPropertyName: function(key) { - if(!key.match(/\d+/)) { - return this.formatPropertyName(key); - } - }, - brackets: ['[', ']'] - }); -}); - - -function formatDate(value, isUTC) { - var prefix = isUTC ? 'UTC' : ''; - - var date = value['get' + prefix + 'FullYear']() + - '-' + - util.pad0(value['get' + prefix + 'Month']() + 1, 2) + - '-' + - util.pad0(value['get' + prefix + 'Date'](), 2); - - var time = util.pad0(value['get' + prefix + 'Hours'](), 2) + - ':' + - util.pad0(value['get' + prefix + 'Minutes'](), 2) + - ':' + - util.pad0(value['get' + prefix + 'Seconds'](), 2) + - '.' + - util.pad0(value['get' + prefix + 'Milliseconds'](), 3); - - var to = value.getTimezoneOffset(); - var absTo = Math.abs(to); - var hours = Math.floor(absTo / 60); - var minutes = absTo - hours * 60; - var tzFormat = (to < 0 ? '+' : '-') + util.pad0(hours, 2) + util.pad0(minutes, 2); - - return date + ' ' + time + (isUTC ? '' : ' ' + tzFormat); -} - -Formatter.add('object', 'date', function(value) { - return this._formatObject(value, { value: formatDate(value, this.isUTCdate) }); -}); - -Formatter.add('function', function(value) { - return this._formatObject(value, { - additionalProperties: [['name', Formatter.functionName(value)]] - }); -}); - -Formatter.add('object', 'error', function(value) { - return this._formatObject(value, { - prefix: value.name, - additionalProperties: [['message', value.message]] - }); -}); - -Formatter.add('object', 'buffer', Formatter.generateFunctionForIndexedArray('length', 'Buffer', 2)); - -Formatter.add('object', 'array-buffer', Formatter.generateFunctionForIndexedArray('byteLength', 'ArrayBuffer', 2)); - -Formatter.add('object', 'typed-array', 'int8', Formatter.generateFunctionForIndexedArray('length', 'Int8Array', 2)); -Formatter.add('object', 'typed-array', 'uint8', Formatter.generateFunctionForIndexedArray('length', 'Uint8Array', 2)); -Formatter.add('object', 'typed-array', 'uint8clamped', Formatter.generateFunctionForIndexedArray('length', 'Uint8ClampedArray', 2)); - -Formatter.add('object', 'typed-array', 'int16', Formatter.generateFunctionForIndexedArray('length', 'Int16Array', 4)); -Formatter.add('object', 'typed-array', 'uint16', Formatter.generateFunctionForIndexedArray('length', 'Uint16Array', 4)); - -Formatter.add('object', 'typed-array', 'int32', Formatter.generateFunctionForIndexedArray('length', 'Int32Array', 8)); -Formatter.add('object', 'typed-array', 'uint32', Formatter.generateFunctionForIndexedArray('length', 'Uint32Array', 8)); - -//TODO add float32 and float64 - -Formatter.add('object', 'promise', function() { - return '[Promise]';//TODO it could be nice to inspect its state and value -}); - -Formatter.add('object', 'xhr', function() { - return '[XMLHttpRequest]';//TODO it could be nice to inspect its state -}); - -Formatter.add('object', 'html-element', function(value) { - return value.outerHTML; -}); - -Formatter.add('object', 'html-element', '#text', function(value) { - return value.nodeValue; -}); - -Formatter.add('object', 'html-element', '#document', function(value) { - return value.documentElement.outerHTML; -}); - -Formatter.add('object', 'host', function() { - return '[Host]'; -}); - -Formatter.add('object', 'set', function(value) { - var iter = value.values(); - var len = 0; - - this.seen.push(value); - - var props = []; - - var next = iter.next(); - while(!next.done) { - var val = next.value; - var f = this.format(val); - len += f.length; - props.push(f); - - next = iter.next(); - } - - this.seen.pop(); - - if(props.length === 0) return 'Set {}'; - - if(len <= this.maxLineLength) { - return 'Set { ' + props.join(this.propSep + ' ') + ' }'; - } else { - return 'Set {\n' + props.map(util.addSpaces).join(this.propSep + '\n') + '\n' + '}'; - } -}); - -Formatter.add('object', 'map', function(value) { - var iter = value.entries(); - var len = 0; - - this.seen.push(value); - - var props = []; - - var next = iter.next(); - while(!next.done) { - var val = next.value; - var fK = this.format(val[0]); - var fV = this.format(val[1]); - - var f; - if((fK.length + fV.length + 4) <= this.maxLineLength) { - f = fK + ' => ' + fV; - } else { - f = fK + ' =>\n' + fV; - } - - len += fK.length + fV.length + 4; - props.push(f); - - next = iter.next(); - } - - this.seen.pop(); - - if(props.length === 0) return 'Map {}'; - - if(len <= this.maxLineLength) { - return 'Map { ' + props.join(this.propSep + ' ') + ' }'; - } else { - return 'Map {\n' + props.map(util.addSpaces).join(this.propSep + '\n') + '\n' + '}'; - } -}); - -Formatter.prototype.defaultFormat = Formatter.prototype._format_object; - -function defaultFormat(value, opts) { - return new Formatter(opts).format(value); -} - -defaultFormat.Formatter = Formatter; -module.exports = defaultFormat; - - -/***/ }), -/* 63 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var Formatter = __webpack_require__(62).Formatter; - -var config = { - checkProtoEql: false, - - getFormatter: function(opts) { - return new Formatter(opts || config); - } -}; - -module.exports = config; - - -/***/ }), -/* 64 */ -/***/ (function(module, exports) { - -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; - - -/***/ }), -/* 65 */ -/***/ (function(module, exports, __webpack_require__) { - -var map = { - "./10Digits": 4, - "./10Digits.json": 4, - "./2Digits": 5, - "./2Digits.json": 5, - "./3Digits": 6, - "./3Digits.json": 6, - "./4Digits": 7, - "./4Digits.json": 7, - "./5Digits": 8, - "./5Digits.json": 8, - "./6Digits": 9, - "./6Digits.json": 9, - "./7Digits": 10, - "./7Digits.json": 10, - "./8Digits": 11, - "./8Digits.json": 11, - "./AD": 12, - "./AD.json": 12, - "./AI": 13, - "./AI.json": 13, - "./AQ": 14, - "./AQ.json": 14, - "./AX": 15, - "./AX.json": 15, - "./AZ": 16, - "./AZ.json": 16, - "./BB": 17, - "./BB.json": 17, - "./BH": 18, - "./BH.json": 18, - "./BL": 19, - "./BL.json": 19, - "./BN": 20, - "./BN.json": 20, - "./CA": 21, - "./CA.json": 21, - "./FK": 22, - "./FK.json": 22, - "./GB": 23, - "./GB.json": 23, - "./GF": 24, - "./GF.json": 24, - "./GI": 25, - "./GI.json": 25, - "./GP": 26, - "./GP.json": 26, - "./GS": 27, - "./GS.json": 27, - "./HN": 28, - "./HN.json": 28, - "./IO": 29, - "./IO.json": 29, - "./KY": 30, - "./KY.json": 30, - "./LB": 31, - "./LB.json": 31, - "./LC": 32, - "./LC.json": 32, - "./LT": 33, - "./LT.json": 33, - "./LV": 34, - "./LV.json": 34, - "./MD": 35, - "./MD.json": 35, - "./MF": 36, - "./MF.json": 36, - "./MS": 37, - "./MS.json": 37, - "./MT": 38, - "./MT.json": 38, - "./NC": 39, - "./NC.json": 39, - "./NL": 40, - "./NL.json": 40, - "./PF": 41, - "./PF.json": 41, - "./PL": 42, - "./PL.json": 42, - "./PM": 43, - "./PM.json": 43, - "./PN": 44, - "./PN.json": 44, - "./PT": 45, - "./PT.json": 45, - "./RE": 46, - "./RE.json": 46, - "./RU": 47, - "./RU.json": 47, - "./SH": 48, - "./SH.json": 48, - "./SM": 49, - "./SM.json": 49, - "./SO": 50, - "./SO.json": 50, - "./SZ": 51, - "./SZ.json": 51, - "./TC": 52, - "./TC.json": 52, - "./US": 53, - "./US.json": 53, - "./VA": 54, - "./VA.json": 54, - "./VC": 55, - "./VC.json": 55, - "./VE": 56, - "./VE.json": 56, - "./VG": 57, - "./VG.json": 57, - "./WF": 58, - "./WF.json": 58, - "./WS": 59, - "./WS.json": 59 -}; -function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); -}; -function webpackContextResolve(req) { - var id = map[req]; - if(!(id + 1)) // check for number or string - throw new Error("Cannot find module '" + req + "'."); - return id; -}; -webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); -}; -webpackContext.resolve = webpackContextResolve; -module.exports = webpackContext; -webpackContext.id = 65; - -/***/ }), -/* 66 */ -/***/ (function(module, exports, __webpack_require__) { - -var should = __webpack_require__(88); - -var defaultProto = Object.prototype; -var defaultProperty = 'should'; - -//Expose api via `Object#should`. -try { - var prevShould = should.extend(defaultProperty, defaultProto); - should._prevShould = prevShould; -} catch(e) { - //ignore errors -} - -module.exports = should; - - -/***/ }), -/* 67 */ -/***/ (function(module, exports, __webpack_require__) { - -var byAlpha2 = __webpack_require__(61); -var byAlpha3 = __webpack_require__(70); -var isNode = __webpack_require__(71); -var getFormat = null; -if (isNode) { - getFormat = __webpack_require__(68) ; -} else { - getFormat = __webpack_require__(69) ; -} - -module.exports.validate = function (countryCode, postalCode, callback) { - - if (callback) { - return validatePostalCodeInternal(countryCode, postalCode, callback); - } - - var result; - validatePostalCodeInternal(countryCode, postalCode, function (err, isValid) { - result = isValid; - }); - - return result; -}; - -function validatePostalCodeInternal(countryCode, postalCode, callback) { - if (!countryCode) { - callback('Invalid country code.'); - return; - } - - if (!postalCode) { - callback('Invalid postal code.'); - return; - } - - var countryData = undefined; - countryCode = countryCode.trim(); - - // Is it alpha2 ? - if (countryCode.length == 2) { - countryData = byAlpha2[countryCode.toUpperCase()]; - } - - // Is it alpha3 ? - if (countryCode.length == 3) { - countryData = byAlpha3[countryCode.toUpperCase()]; - } - - if (!countryData) { - callback('Unknown alpha2/alpha3 country code: ' + countryCode); - return; - } - - var format = getFormat(countryData.postalCodeFormat); - if (!format) { - callback('Failed to load postal code format "' + countryData.postalCodeFormat + '".'); - return; - } - - postalCode = postalCode.toString().trim(); - var preparedPostalCode = postalCode.slice(0); - for(var i=0; i -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the 'Software'), to -// deal in the Software without restriction, including without limitation the -// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -// sell copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -// when used in node, this will actually load the util module we depend on -// versus loading the builtin util module as happens otherwise -// this is a bug in node module loading as far as I am concerned -var Assertion = __webpack_require__(3); - -var _deepEqual = __webpack_require__(1); - -var pSlice = Array.prototype.slice; - -// 1. The assert module provides functions that throw -// AssertionError's when particular conditions are not met. The -// assert module must conform to the following interface. - -var assert = module.exports = ok; - -// 3. All of the following functions must throw an AssertionError -// when a corresponding condition is not met, with a message that -// may be undefined if not provided. All assertion methods provide -// both the actual and expected values to the assertion error for -// display purposes. -/** - * Node.js standard [`assert.fail`](http://nodejs.org/api/assert.html#assert_assert_fail_actual_expected_message_operator). - * @static - * @memberOf should - * @category assertion assert - * @param {*} actual Actual object - * @param {*} expected Expected object - * @param {string} message Message for assertion - * @param {string} operator Operator text - */ -function fail(actual, expected, message, operator, stackStartFunction) { - var a = new Assertion(actual); - a.params = { - operator: operator, - expected: expected, - message: message, - stackStartFunction: stackStartFunction || fail - }; - - a.fail(); -} - -// EXTENSION! allows for well behaved errors defined elsewhere. -assert.fail = fail; - -// 4. Pure assertion tests whether a value is truthy, as determined -// by !!guard. -// assert.ok(guard, message_opt); -// This statement is equivalent to assert.equal(true, !!guard, -// message_opt);. To test strictly for the value true, use -// assert.strictEqual(true, guard, message_opt);. -/** - * Node.js standard [`assert.ok`](http://nodejs.org/api/assert.html#assert_assert_value_message_assert_ok_value_message). - * @static - * @memberOf should - * @category assertion assert - * @param {*} value - * @param {string} [message] - */ -function ok(value, message) { - if (!value) fail(value, true, message, '==', assert.ok); -} -assert.ok = ok; - -// 5. The equality assertion tests shallow, coercive equality with -// ==. -// assert.equal(actual, expected, message_opt); - -/** - * Node.js standard [`assert.equal`](http://nodejs.org/api/assert.html#assert_assert_equal_actual_expected_message). - * @static - * @memberOf should - * @category assertion assert - * @param {*} actual - * @param {*} expected - * @param {string} [message] - */ -assert.equal = function equal(actual, expected, message) { - if (actual != expected) fail(actual, expected, message, '==', assert.equal); -}; - -// 6. The non-equality assertion tests for whether two objects are not equal -// with != assert.notEqual(actual, expected, message_opt); -/** - * Node.js standard [`assert.notEqual`](http://nodejs.org/api/assert.html#assert_assert_notequal_actual_expected_message). - * @static - * @memberOf should - * @category assertion assert - * @param {*} actual - * @param {*} expected - * @param {string} [message] - */ -assert.notEqual = function notEqual(actual, expected, message) { - if (actual == expected) { - fail(actual, expected, message, '!=', assert.notEqual); - } -}; - -// 7. The equivalence assertion tests a deep equality relation. -// assert.deepEqual(actual, expected, message_opt); -/** - * Node.js standard [`assert.deepEqual`](http://nodejs.org/api/assert.html#assert_assert_deepequal_actual_expected_message). - * But uses should.js .eql implementation instead of Node.js own deepEqual. - * - * @static - * @memberOf should - * @category assertion assert - * @param {*} actual - * @param {*} expected - * @param {string} [message] - */ -assert.deepEqual = function deepEqual(actual, expected, message) { - if (!_deepEqual(actual, expected).result) { - fail(actual, expected, message, 'deepEqual', assert.deepEqual); - } -}; - - -// 8. The non-equivalence assertion tests for any deep inequality. -// assert.notDeepEqual(actual, expected, message_opt); -/** - * Node.js standard [`assert.notDeepEqual`](http://nodejs.org/api/assert.html#assert_assert_notdeepequal_actual_expected_message). - * But uses should.js .eql implementation instead of Node.js own deepEqual. - * - * @static - * @memberOf should - * @category assertion assert - * @param {*} actual - * @param {*} expected - * @param {string} [message] - */ -assert.notDeepEqual = function notDeepEqual(actual, expected, message) { - if (_deepEqual(actual, expected).result) { - fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual); - } -}; - -// 9. The strict equality assertion tests strict equality, as determined by ===. -// assert.strictEqual(actual, expected, message_opt); -/** - * Node.js standard [`assert.strictEqual`](http://nodejs.org/api/assert.html#assert_assert_strictequal_actual_expected_message). - * @static - * @memberOf should - * @category assertion assert - * @param {*} actual - * @param {*} expected - * @param {string} [message] - */ -assert.strictEqual = function strictEqual(actual, expected, message) { - if (actual !== expected) { - fail(actual, expected, message, '===', assert.strictEqual); - } -}; - -// 10. The strict non-equality assertion tests for strict inequality, as -// determined by !==. assert.notStrictEqual(actual, expected, message_opt); -/** - * Node.js standard [`assert.notStrictEqual`](http://nodejs.org/api/assert.html#assert_assert_notstrictequal_actual_expected_message). - * @static - * @memberOf should - * @category assertion assert - * @param {*} actual - * @param {*} expected - * @param {string} [message] - */ -assert.notStrictEqual = function notStrictEqual(actual, expected, message) { - if (actual === expected) { - fail(actual, expected, message, '!==', assert.notStrictEqual); - } -}; - -function expectedException(actual, expected) { - if (!actual || !expected) { - return false; - } - - if (Object.prototype.toString.call(expected) == '[object RegExp]') { - return expected.test(actual); - } else if (actual instanceof expected) { - return true; - } else if (expected.call({}, actual) === true) { - return true; - } - - return false; -} - -function _throws(shouldThrow, block, expected, message) { - var actual; - - if (typeof expected == 'string') { - message = expected; - expected = null; - } - - try { - block(); - } catch (e) { - actual = e; - } - - message = (expected && expected.name ? ' (' + expected.name + ')' : '.') + - (message ? ' ' + message : '.'); - - if (shouldThrow && !actual) { - fail(actual, expected, 'Missing expected exception' + message); - } - - if (!shouldThrow && expectedException(actual, expected)) { - fail(actual, expected, 'Got unwanted exception' + message); - } - - if ((shouldThrow && actual && expected && !expectedException(actual, expected)) || (!shouldThrow && actual)) { - throw actual; - } -} - -// 11. Expected to throw an error: -// assert.throws(block, Error_opt, message_opt); -/** - * Node.js standard [`assert.throws`](http://nodejs.org/api/assert.html#assert_assert_throws_block_error_message). - * @static - * @memberOf should - * @category assertion assert - * @param {Function} block - * @param {Function} [error] - * @param {String} [message] - */ -assert.throws = function(/*block, error, message*/) { - _throws.apply(this, [true].concat(pSlice.call(arguments))); -}; - -// EXTENSION! This is annoying to write outside this module. -/** - * Node.js standard [`assert.doesNotThrow`](http://nodejs.org/api/assert.html#assert_assert_doesnotthrow_block_message). - * @static - * @memberOf should - * @category assertion assert - * @param {Function} block - * @param {String} [message] - */ -assert.doesNotThrow = function(/*block, message*/) { - _throws.apply(this, [false].concat(pSlice.call(arguments))); -}; - -/** - * Node.js standard [`assert.ifError`](http://nodejs.org/api/assert.html#assert_assert_iferror_value). - * @static - * @memberOf should - * @category assertion assert - * @param {Error} err - */ -assert.ifError = function(err) { - if (err) { - throw err; - } -}; - - -/***/ }), -/* 76 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var util = __webpack_require__(0); -var assert = __webpack_require__(75); -var AssertionError = __webpack_require__(60); - -module.exports = function(should) { - var i = should.format; - - /* - * Expose assert to should - * - * This allows you to do things like below - * without require()ing the assert module. - * - * should.equal(foo.bar, undefined); - * - */ - util.merge(should, assert); - - /** - * Assert _obj_ exists, with optional message. - * - * @static - * @memberOf should - * @category assertion assert - * @alias should.exists - * @param {*} obj - * @param {String} [msg] - * @example - * - * should.exist(1); - * should.exist(new Date()); - */ - should.exist = should.exists = function(obj, msg) { - if (null == obj) { - throw new AssertionError({ - message: msg || ('expected ' + i(obj) + ' to exist'), stackStartFunction: should.exist - }); - } - }; - - should.not = {}; - /** - * Asserts _obj_ does not exist, with optional message. - * - * @name not.exist - * @static - * @memberOf should - * @category assertion assert - * @alias should.not.exists - * @param {*} obj - * @param {String} [msg] - * @example - * - * should.not.exist(null); - * should.not.exist(void 0); - */ - should.not.exist = should.not.exists = function(obj, msg) { - if (null != obj) { - throw new AssertionError({ - message: msg || ('expected ' + i(obj) + ' to not exist'), stackStartFunction: should.not.exist - }); - } - }; -}; - - -/***/ }), -/* 77 */ -/***/ (function(module, exports) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -module.exports = function(should, Assertion) { - /** - * Assert given object is exactly `true`. - * - * @name true - * @memberOf Assertion - * @category assertion bool - * @alias Assertion#True - * @param {string} [message] Optional message - * @example - * - * (true).should.be.true(); - * false.should.not.be.true(); - * - * ({ a: 10}).should.not.be.true(); - */ - Assertion.add('true', function(message) { - this.is.exactly(true, message); - }); - - Assertion.alias('true', 'True'); - - /** - * Assert given object is exactly `false`. - * - * @name false - * @memberOf Assertion - * @category assertion bool - * @alias Assertion#False - * @param {string} [message] Optional message - * @example - * - * (true).should.not.be.false(); - * false.should.be.false(); - */ - Assertion.add('false', function(message) { - this.is.exactly(false, message); - }); - - Assertion.alias('false', 'False'); - - /** - * Assert given object is thuthy according javascript type conversions. - * - * @name ok - * @memberOf Assertion - * @category assertion bool - * @example - * - * (true).should.be.ok(); - * ''.should.not.be.ok(); - * should(null).not.be.ok(); - * should(void 0).not.be.ok(); - * - * (10).should.be.ok(); - * (0).should.not.be.ok(); - */ - Assertion.add('ok', function() { - this.params = { operator: 'to be truthy' }; - - this.assert(this.obj); - }); -}; - - -/***/ }), -/* 78 */ -/***/ (function(module, exports) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -module.exports = function(should, Assertion) { - /** - * Simple chaining. It actually do nothing. - * - * @memberOf Assertion - * @name be - * @property {should.Assertion} be - * @alias Assertion#an - * @alias Assertion#of - * @alias Assertion#a - * @alias Assertion#and - * @alias Assertion#have - * @alias Assertion#has - * @alias Assertion#with - * @alias Assertion#is - * @alias Assertion#which - * @alias Assertion#the - * @alias Assertion#it - * @category assertion chaining - */ - ['an', 'of', 'a', 'and', 'be', 'has', 'have', 'with', 'is', 'which', 'the', 'it'].forEach(function(name) { - Assertion.addChain(name); - }); -}; - - -/***/ }), -/* 79 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var util = __webpack_require__(0); -var eql = __webpack_require__(1); - -module.exports = function(should, Assertion) { - var i = should.format; - - /** - * Assert that given object contain something that equal to `other`. It uses `should-equal` for equality checks. - * If given object is array it search that one of elements was equal to `other`. - * If given object is string it checks if `other` is a substring - expected that `other` is a string. - * If given object is Object it checks that `other` is a subobject - expected that `other` is a object. - * - * @name containEql - * @memberOf Assertion - * @category assertion contain - * @param {*} other Nested object - * @example - * - * [1, 2, 3].should.containEql(1); - * [{ a: 1 }, 'a', 10].should.containEql({ a: 1 }); - * - * 'abc'.should.containEql('b'); - * 'ab1c'.should.containEql(1); - * - * ({ a: 10, c: { d: 10 }}).should.containEql({ a: 10 }); - * ({ a: 10, c: { d: 10 }}).should.containEql({ c: { d: 10 }}); - * ({ a: 10, c: { d: 10 }}).should.containEql({ b: 10 }); - * // throws AssertionError: expected { a: 10, c: { d: 10 } } to contain { b: 10 } - * // expected { a: 10, c: { d: 10 } } to have property b - */ - Assertion.add('containEql', function(other) { - this.params = {operator: 'to contain ' + i(other)}; - - this.is.not.null().and.not.undefined(); - - var obj = this.obj; - - if (typeof obj == 'string') { - this.assert(obj.indexOf(String(other)) >= 0); - } else if (util.isIndexable(obj)) { - this.assert(util.some(obj, function(v) { - return eql(v, other).result; - })); - } else { - this.have.properties(other); - } - }); - - /** - * Assert that given object is contain equally structured object on the same depth level. - * If given object is an array and `other` is an array it checks that the eql elements is going in the same sequence in given array (recursive) - * If given object is an object it checks that the same keys contain deep equal values (recursive) - * On other cases it try to check with `.eql` - * - * @name containDeepOrdered - * @memberOf Assertion - * @category assertion contain - * @param {*} other Nested object - * @example - * - * [ 1, 2, 3].should.containDeepOrdered([1, 2]); - * [ 1, 2, [ 1, 2, 3 ]].should.containDeepOrdered([ 1, [ 2, 3 ]]); - * - * ({ a: 10, b: { c: 10, d: [1, 2, 3] }}).should.containDeepOrdered({a: 10}); - * ({ a: 10, b: { c: 10, d: [1, 2, 3] }}).should.containDeepOrdered({b: {c: 10}}); - * ({ a: 10, b: { c: 10, d: [1, 2, 3] }}).should.containDeepOrdered({b: {d: [1, 3]}}); - */ - Assertion.add('containDeepOrdered', function(other) { - this.params = {operator: 'to contain ' + i(other)}; - - var obj = this.obj; - if (typeof obj == 'string') {// expect other to be string - this.is.equal(String(other)); - } else if (util.isIndexable(obj) && util.isIndexable(other)) { - for (var objIdx = 0, otherIdx = 0, objLength = util.length(obj), otherLength = util.length(other); objIdx < objLength && otherIdx < otherLength; objIdx++) { - try { - should(obj[objIdx]).containDeepOrdered(other[otherIdx]); - otherIdx++; - } catch (e) { - if (e instanceof should.AssertionError) { - continue; - } - throw e; - } - } - - this.assert(otherIdx === otherLength); - } else if (obj != null && other != null && typeof obj == 'object' && typeof other == 'object') {// object contains object case - util.forEach(other, function(value, key) { - should(obj[key]).containDeepOrdered(value); - }); - - // if both objects is empty means we finish traversing - and we need to compare for hidden values - if (util.isEmptyObject(other)) { - this.eql(other); - } - } else { - this.eql(other); - } - }); - - /** - * The same like `Assertion#containDeepOrdered` but all checks on arrays without order. - * - * @name containDeep - * @memberOf Assertion - * @category assertion contain - * @param {*} other Nested object - * @example - * - * [ 1, 2, 3].should.containDeep([2, 1]); - * [ 1, 2, [ 1, 2, 3 ]].should.containDeep([ 1, [ 3, 1 ]]); - */ - Assertion.add('containDeep', function(other) { - this.params = {operator: 'to contain ' + i(other)}; - - var obj = this.obj; - if (typeof obj == 'string') {// expect other to be string - this.is.equal(String(other)); - } else if (util.isIndexable(obj) && util.isIndexable(other)) { - var usedKeys = {}; - util.forEach(other, function(otherItem) { - this.assert(util.some(obj, function(item, index) { - if (index in usedKeys) return false; - - try { - should(item).containDeep(otherItem); - usedKeys[index] = true; - return true; - } catch (e) { - if (e instanceof should.AssertionError) { - return false; - } - throw e; - } - })); - }, this); - } else if (obj != null && other != null && typeof obj == 'object' && typeof other == 'object') {// object contains object case - util.forEach(other, function(value, key) { - should(obj[key]).containDeep(value); - }); - - // if both objects is empty means we finish traversing - and we need to compare for hidden values - if (util.isEmptyObject(other)) { - this.eql(other); - } - } else { - this.eql(other); - } - }); - -}; - - -/***/ }), -/* 80 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var eql = __webpack_require__(1); -var type = __webpack_require__(2); -var util = __webpack_require__(0); - -function formatEqlResult(r, a, b) { - return ((r.path.length > 0 ? 'at ' + r.path.map(util.formatProp).join(' -> ') : '') + - (r.a === a ? '' : ', A has ' + util.format(r.a)) + - (r.b === b ? '' : ' and B has ' + util.format(r.b)) + - (r.showReason ? ' because ' + r.reason : '')).trim(); -} - -module.exports = function(should, Assertion) { - - /** - * Deep object equality comparison. For full spec see [`should-equal tests`](https://github.com/shouldjs/equal/blob/master/test.js). - * - * @name eql - * @memberOf Assertion - * @category assertion equality - * @alias Assertion#deepEqual - * @param {*} val Expected value - * @param {string} [description] Optional message - * @example - * - * (10).should.be.eql(10); - * ('10').should.not.be.eql(10); - * (-0).should.not.be.eql(+0); - * - * NaN.should.be.eql(NaN); - * - * ({ a: 10}).should.be.eql({ a: 10 }); - * [ 'a' ].should.not.be.eql({ '0': 'a' }); - */ - Assertion.add('eql', function(val, description) { - this.params = {operator: 'to equal', expected: val, message: description}; - - var result = eql(this.obj, val, should.config); - this.params.details = result.result ? '' : formatEqlResult(result, this.obj, val); - - this.params.showDiff = eql(type(this.obj), type(val)).result; - - this.assert(result.result); - }); - - /** - * Exact comparison using ===. - * - * @name equal - * @memberOf Assertion - * @category assertion equality - * @alias Assertion#exactly - * @param {*} val Expected value - * @param {string} [description] Optional message - * @example - * - * 10.should.be.equal(10); - * 'a'.should.be.exactly('a'); - * - * should(null).be.exactly(null); - */ - Assertion.add('equal', function(val, description) { - this.params = {operator: 'to be', expected: val, message: description}; - - this.params.showDiff = eql(type(this.obj), type(val)).result; - - this.assert(val === this.obj); - }); - - Assertion.alias('equal', 'exactly'); - Assertion.alias('eql', 'deepEqual'); - - function addOneOf(name, message, method) { - Assertion.add(name, function(vals) { - if (arguments.length !== 1) { - vals = Array.prototype.slice.call(arguments); - } else { - should(vals).be.Array(); - } - - this.params = {operator: message, expected: vals}; - - var obj = this.obj; - var found = false; - - util.forEach(vals, function(val) { - try { - should(val)[method](obj); - found = true; - return false; - } catch (e) { - if (e instanceof should.AssertionError) { - return;//do nothing - } - throw e; - } - }); - - this.assert(found); - }); - } - - /** - * Exact comparison using === to be one of supplied objects. - * - * @name equalOneOf - * @memberOf Assertion - * @category assertion equality - * @param {Array|*} vals Expected values - * @example - * - * 'ab'.should.be.equalOneOf('a', 10, 'ab'); - * 'ab'.should.be.equalOneOf(['a', 10, 'ab']); - */ - addOneOf('equalOneOf', 'to be equals one of', 'equal'); - - /** - * Exact comparison using .eql to be one of supplied objects. - * - * @name oneOf - * @memberOf Assertion - * @category assertion equality - * @param {Array|*} vals Expected values - * @example - * - * ({a: 10}).should.be.oneOf('a', 10, 'ab', {a: 10}); - * ({a: 10}).should.be.oneOf(['a', 10, 'ab', {a: 10}]); - */ - addOneOf('oneOf', 'to be one of', 'eql'); - -}; - - -/***/ }), -/* 81 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ -var util = __webpack_require__(0); - -module.exports = function(should, Assertion) { - var i = should.format; - - /** - * Assert given function throws error with such message. - * - * @name throw - * @memberOf Assertion - * @category assertion errors - * @alias Assertion#throwError - * @param {string|RegExp|Function|Object|GeneratorFunction|GeneratorObject} [message] Message to match or properties - * @param {Object} [properties] Optional properties that will be matched to thrown error - * @example - * - * (function(){ throw new Error('fail') }).should.throw(); - * (function(){ throw new Error('fail') }).should.throw('fail'); - * (function(){ throw new Error('fail') }).should.throw(/fail/); - * - * (function(){ throw new Error('fail') }).should.throw(Error); - * var error = new Error(); - * error.a = 10; - * (function(){ throw error; }).should.throw(Error, { a: 10 }); - * (function(){ throw error; }).should.throw({ a: 10 }); - * (function*() { - * yield throwError(); - * }).should.throw(); - */ - Assertion.add('throw', function(message, properties) { - var fn = this.obj; - var err = {}; - var errorInfo = ''; - var thrown = false; - - if (util.isGeneratorFunction(fn)) { - return should(fn()).throw(message, properties); - } else if (util.isGeneratorObject(fn)) { - return should(fn.next.bind(fn)).throw(message, properties); - } - - this.is.a.Function(); - - var errorMatched = true; - - try { - fn(); - } catch (e) { - thrown = true; - err = e; - } - - if (thrown) { - if (message) { - if ('string' == typeof message) { - errorMatched = message == err.message; - } else if (message instanceof RegExp) { - errorMatched = message.test(err.message); - } else if ('function' == typeof message) { - errorMatched = err instanceof message; - } else if (null != message) { - try { - should(err).match(message); - } catch (e) { - if (e instanceof should.AssertionError) { - errorInfo = ": " + e.message; - errorMatched = false; - } else { - throw e; - } - } - } - - if (!errorMatched) { - if ('string' == typeof message || message instanceof RegExp) { - errorInfo = " with a message matching " + i(message) + ", but got '" + err.message + "'"; - } else if ('function' == typeof message) { - errorInfo = " of type " + util.functionName(message) + ", but got " + util.functionName(err.constructor); - } - } else if ('function' == typeof message && properties) { - try { - should(err).match(properties); - } catch (e) { - if (e instanceof should.AssertionError) { - errorInfo = ": " + e.message; - errorMatched = false; - } else { - throw e; - } - } - } - } else { - errorInfo = " (got " + i(err) + ")"; - } - } - - this.params = { operator: 'to throw exception' + errorInfo }; - - this.assert(thrown); - this.assert(errorMatched); - }); - - Assertion.alias('throw', 'throwError'); -}; - - -/***/ }), -/* 82 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var util = __webpack_require__(0); -var eql = __webpack_require__(1); - -module.exports = function(should, Assertion) { - var i = should.format; - - /** - * Asserts if given object match `other` object, using some assumptions: - * First object matched if they are equal, - * If `other` is a regexp and given object is a string check on matching with regexp - * If `other` is a regexp and given object is an array check if all elements matched regexp - * If `other` is a regexp and given object is an object check values on matching regexp - * If `other` is a function check if this function throws AssertionError on given object or return false - it will be assumed as not matched - * If `other` is an object check if the same keys matched with above rules - * All other cases failed. - * - * Usually it is right idea to add pre type assertions, like `.String()` or `.Object()` to be sure assertions will do what you are expecting. - * Object iteration happen by keys (properties with enumerable: true), thus some objects can cause small pain. Typical example is js - * Error - it by default has 2 properties `name` and `message`, but they both non-enumerable. In this case make sure you specify checking props (see examples). - * - * @name match - * @memberOf Assertion - * @category assertion matching - * @param {*} other Object to match - * @param {string} [description] Optional message - * @example - * 'foobar'.should.match(/^foo/); - * 'foobar'.should.not.match(/^bar/); - * - * ({ a: 'foo', c: 'barfoo' }).should.match(/foo$/); - * - * ['a', 'b', 'c'].should.match(/[a-z]/); - * - * (5).should.not.match(function(n) { - * return n < 0; - * }); - * (5).should.not.match(function(it) { - * it.should.be.an.Array(); - * }); - * ({ a: 10, b: 'abc', c: { d: 10 }, d: 0 }).should - * .match({ a: 10, b: /c$/, c: function(it) { - * return it.should.have.property('d', 10); - * }}); - * - * [10, 'abc', { d: 10 }, 0].should - * .match({ '0': 10, '1': /c$/, '2': function(it) { - * return it.should.have.property('d', 10); - * }}); - * - * var myString = 'abc'; - * - * myString.should.be.a.String().and.match(/abc/); - * - * myString = {}; - * - * myString.should.match(/abc/); //yes this will pass - * //better to do - * myString.should.be.an.Object().and.not.empty().and.match(/abc/);//fixed - * - * (new Error('boom')).should.match(/abc/);//passed because no keys - * (new Error('boom')).should.not.match({ message: /abc/ });//check specified property - */ - Assertion.add('match', function(other, description) { - this.params = {operator: 'to match ' + i(other), message: description}; - - if (!eql(this.obj, other).result) { - if (other instanceof RegExp) { // something - regex - - if (typeof this.obj == 'string') { - - this.assert(other.exec(this.obj)); - } else if (util.isIndexable(this.obj)) { - util.forEach(this.obj, function(item) { - this.assert(other.exec(item));// should we try to convert to String and exec? - }, this); - } else if (null != this.obj && typeof this.obj == 'object') { - - var notMatchedProps = [], matchedProps = []; - util.forEach(this.obj, function(value, name) { - if (other.exec(value)) matchedProps.push(util.formatProp(name)); - else notMatchedProps.push(util.formatProp(name) + ' (' + i(value) + ')'); - }, this); - - if (notMatchedProps.length) - this.params.operator += '\n not matched properties: ' + notMatchedProps.join(', '); - if (matchedProps.length) - this.params.operator += '\n matched properties: ' + matchedProps.join(', '); - - this.assert(notMatchedProps.length === 0); - } // should we try to convert to String and exec? - } else if (typeof other == 'function') { - var res; - - res = other(this.obj); - - //if(res instanceof Assertion) { - // this.params.operator += '\n ' + res.getMessage(); - //} - - //if we throw exception ok - it is used .should inside - if (typeof res == 'boolean') { - this.assert(res); // if it is just boolean function assert on it - } - } else if (other != null && this.obj != null && typeof other == 'object' && typeof this.obj == 'object') { // try to match properties (for Object and Array) - notMatchedProps = []; - matchedProps = []; - - util.forEach(other, function(value, key) { - try { - should(this.obj).have.property(key).which.match(value); - matchedProps.push(util.formatProp(key)); - } catch (e) { - if (e instanceof should.AssertionError) { - notMatchedProps.push(util.formatProp(key) + ' (' + i(this.obj[key]) + ')'); - } else { - throw e; - } - } - }, this); - - if (notMatchedProps.length) - this.params.operator += '\n not matched properties: ' + notMatchedProps.join(', '); - if (matchedProps.length) - this.params.operator += '\n matched properties: ' + matchedProps.join(', '); - - this.assert(notMatchedProps.length === 0); - } else { - this.assert(false); - } - } - }); - - /** - * Asserts if given object values or array elements all match `other` object, using some assumptions: - * First object matched if they are equal, - * If `other` is a regexp - matching with regexp - * If `other` is a function check if this function throws AssertionError on given object or return false - it will be assumed as not matched - * All other cases check if this `other` equal to each element - * - * @name matchEach - * @memberOf Assertion - * @category assertion matching - * @alias Assertion#matchEvery - * @param {*} other Object to match - * @param {string} [description] Optional message - * @example - * [ 'a', 'b', 'c'].should.matchEach(/\w+/); - * [ 'a', 'a', 'a'].should.matchEach('a'); - * - * [ 'a', 'a', 'a'].should.matchEach(function(value) { value.should.be.eql('a') }); - * - * { a: 'a', b: 'a', c: 'a' }.should.matchEach(function(value) { value.should.be.eql('a') }); - */ - Assertion.add('matchEach', function(other, description) { - this.params = {operator: 'to match each ' + i(other), message: description}; - - util.forEach(this.obj, function(value) { - should(value).match(other); - }, this); - }); - - /** - * Asserts if any of given object values or array elements match `other` object, using some assumptions: - * First object matched if they are equal, - * If `other` is a regexp - matching with regexp - * If `other` is a function check if this function throws AssertionError on given object or return false - it will be assumed as not matched - * All other cases check if this `other` equal to each element - * - * @name matchAny - * @memberOf Assertion - * @category assertion matching - * @param {*} other Object to match - * @alias Assertion#matchSome - * @param {string} [description] Optional message - * @example - * [ 'a', 'b', 'c'].should.matchAny(/\w+/); - * [ 'a', 'b', 'c'].should.matchAny('a'); - * - * [ 'a', 'b', 'c'].should.matchAny(function(value) { value.should.be.eql('a') }); - * - * { a: 'a', b: 'b', c: 'c' }.should.matchAny(function(value) { value.should.be.eql('a') }); - */ - Assertion.add('matchAny', function(other, description) { - this.params = {operator: 'to match any ' + i(other), message: description}; - - this.assert(util.some(this.obj, function(value) { - try { - should(value).match(other); - return true; - } catch (e) { - if (e instanceof should.AssertionError) { - // Caught an AssertionError, return false to the iterator - return false; - } - throw e; - } - })); - }); - - Assertion.alias('matchAny', 'matchSome'); - Assertion.alias('matchEach', 'matchEvery'); -}; - - -/***/ }), -/* 83 */ -/***/ (function(module, exports) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -module.exports = function(should, Assertion) { - - /** - * Assert given object is NaN - * @name NaN - * @memberOf Assertion - * @category assertion numbers - * @example - * - * (10).should.not.be.NaN(); - * NaN.should.be.NaN(); - */ - Assertion.add('NaN', function() { - this.params = { operator: 'to be NaN' }; - - this.assert(this.obj !== this.obj); - }); - - /** - * Assert given object is not finite (positive or negative) - * - * @name Infinity - * @memberOf Assertion - * @category assertion numbers - * @example - * - * (10).should.not.be.Infinity(); - * NaN.should.not.be.Infinity(); - */ - Assertion.add('Infinity', function() { - this.params = { operator: 'to be Infinity' }; - - this.is.a.Number() - .and.not.a.NaN() - .and.assert(!isFinite(this.obj)); - }); - - /** - * Assert given number between `start` and `finish` or equal one of them. - * - * @name within - * @memberOf Assertion - * @category assertion numbers - * @param {number} start Start number - * @param {number} finish Finish number - * @param {string} [description] Optional message - * @example - * - * (10).should.be.within(0, 20); - */ - Assertion.add('within', function(start, finish, description) { - this.params = { operator: 'to be within ' + start + '..' + finish, message: description }; - - this.assert(this.obj >= start && this.obj <= finish); - }); - - /** - * Assert given number near some other `value` within `delta` - * - * @name approximately - * @memberOf Assertion - * @category assertion numbers - * @param {number} value Center number - * @param {number} delta Radius - * @param {string} [description] Optional message - * @example - * - * (9.99).should.be.approximately(10, 0.1); - */ - Assertion.add('approximately', function(value, delta, description) { - this.params = { operator: 'to be approximately ' + value + ' ±' + delta, message: description }; - - this.assert(Math.abs(this.obj - value) <= delta); - }); - - /** - * Assert given number above `n`. - * - * @name above - * @alias Assertion#greaterThan - * @memberOf Assertion - * @category assertion numbers - * @param {number} n Margin number - * @param {string} [description] Optional message - * @example - * - * (10).should.be.above(0); - */ - Assertion.add('above', function(n, description) { - this.params = { operator: 'to be above ' + n, message: description }; - - this.assert(this.obj > n); - }); - - /** - * Assert given number below `n`. - * - * @name below - * @alias Assertion#lessThan - * @memberOf Assertion - * @category assertion numbers - * @param {number} n Margin number - * @param {string} [description] Optional message - * @example - * - * (0).should.be.below(10); - */ - Assertion.add('below', function(n, description) { - this.params = { operator: 'to be below ' + n, message: description }; - - this.assert(this.obj < n); - }); - - Assertion.alias('above', 'greaterThan'); - Assertion.alias('below', 'lessThan'); - - /** - * Assert given number above `n`. - * - * @name aboveOrEqual - * @alias Assertion#greaterThanOrEqual - * @memberOf Assertion - * @category assertion numbers - * @param {number} n Margin number - * @param {string} [description] Optional message - * @example - * - * (10).should.be.aboveOrEqual(0); - * (10).should.be.aboveOrEqual(10); - */ - Assertion.add('aboveOrEqual', function(n, description) { - this.params = { operator: 'to be above or equal' + n, message: description }; - - this.assert(this.obj >= n); - }); - - /** - * Assert given number below `n`. - * - * @name belowOrEqual - * @alias Assertion#lessThanOrEqual - * @memberOf Assertion - * @category assertion numbers - * @param {number} n Margin number - * @param {string} [description] Optional message - * @example - * - * (0).should.be.belowOrEqual(10); - * (0).should.be.belowOrEqual(0); - */ - Assertion.add('belowOrEqual', function(n, description) { - this.params = { operator: 'to be below or equal' + n, message: description }; - - this.assert(this.obj <= n); - }); - - Assertion.alias('aboveOrEqual', 'greaterThanOrEqual'); - Assertion.alias('belowOrEqual', 'lessThanOrEqual'); - -}; - - -/***/ }), -/* 84 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var util = __webpack_require__(0); -var PromisedAssertion = __webpack_require__(3).PromisedAssertion; -var Assertion = __webpack_require__(3); - -module.exports = function(should) { - /** - * Assert given object is a Promise - * - * @name Promise - * @memberOf Assertion - * @category assertion promises - * @example - * - * promise.should.be.Promise() - * (new Promise(function(resolve, reject) { resolve(10); })).should.be.a.Promise() - * (10).should.not.be.a.Promise() - */ - Assertion.add('Promise', function() { - this.params = {operator: 'to be promise'}; - - var obj = this.obj; - - should(obj).have.property('then') - .which.is.a.Function(); - }); - - /** - * Assert given promise will be fulfilled. Result of assertion is still .thenable and should be handled accordingly. - * - * @name fulfilled - * @memberOf Assertion - * @returns {Promise} - * @category assertion promises - * @example - * - * // don't forget to handle async nature - * (new Promise(function(resolve, reject) { resolve(10); })).should.be.fulfilled(); - * - * // test example with mocha it is possible to return promise - * it('is async', () => { - * return new Promise(resolve => resolve(10)) - * .should.be.fulfilled(); - * }); - */ - Assertion.prototype.fulfilled = function Assertion$fulfilled() { - this.params = {operator: 'to be fulfilled'}; - - should(this.obj).be.a.Promise(); - - var that = this; - return this.obj.then(function next$onResolve(value) { - if (that.negate) { - that.fail(); - } - return value; - }, function next$onReject(err) { - if (!that.negate) { - that.params.operator += ', but it was rejected with ' + should.format(err); - that.fail(); - } - return err; - }); - }; - - /** - * Assert given promise will be rejected. Result of assertion is still .thenable and should be handled accordingly. - * - * @name rejected - * @memberOf Assertion - * @category assertion promises - * @returns {Promise} - * @example - * - * // don't forget to handle async nature - * (new Promise(function(resolve, reject) { resolve(10); })) - * .should.not.be.rejected(); - * - * // test example with mocha it is possible to return promise - * it('is async', () => { - * return new Promise((resolve, reject) => reject(new Error('boom'))) - * .should.be.rejected(); - * }); - */ - Assertion.prototype.rejected = function() { - this.params = {operator: 'to be rejected'}; - - should(this.obj).be.a.Promise(); - - var that = this; - return this.obj.then(function(value) { - if (!that.negate) { - that.params.operator += ', but it was fulfilled'; - if (arguments.length != 0) { - that.params.operator += ' with ' + should.format(value); - } - that.fail(); - } - return value; - }, function next$onError(err) { - if (that.negate) { - that.fail(); - } - return err; - }); - }; - - /** - * Assert given promise will be fulfilled with some expected value (value compared using .eql). - * Result of assertion is still .thenable and should be handled accordingly. - * - * @name fulfilledWith - * @memberOf Assertion - * @category assertion promises - * @returns {Promise} - * @example - * - * // don't forget to handle async nature - * (new Promise(function(resolve, reject) { resolve(10); })) - * .should.be.fulfilledWith(10); - * - * // test example with mocha it is possible to return promise - * it('is async', () => { - * return new Promise((resolve, reject) => resolve(10)) - * .should.be.fulfilledWith(10); - * }); - */ - Assertion.prototype.fulfilledWith = function(expectedValue) { - this.params = {operator: 'to be fulfilled with ' + should.format(expectedValue)}; - - should(this.obj).be.a.Promise(); - - var that = this; - return this.obj.then(function(value) { - if (that.negate) { - that.fail(); - } - should(value).eql(expectedValue); - return value; - }, function next$onError(err) { - if (!that.negate) { - that.params.operator += ', but it was rejected with ' + should.format(err); - that.fail(); - } - return err; - }); - }; - - /** - * Assert given promise will be rejected with some sort of error. Arguments is the same for Assertion#throw. - * Result of assertion is still .thenable and should be handled accordingly. - * - * @name rejectedWith - * @memberOf Assertion - * @category assertion promises - * @returns {Promise} - * @example - * - * function failedPromise() { - * return new Promise(function(resolve, reject) { - * reject(new Error('boom')) - * }) - * } - * failedPromise().should.be.rejectedWith(Error); - * failedPromise().should.be.rejectedWith('boom'); - * failedPromise().should.be.rejectedWith(/boom/); - * failedPromise().should.be.rejectedWith(Error, { message: 'boom' }); - * failedPromise().should.be.rejectedWith({ message: 'boom' }); - * - * // test example with mocha it is possible to return promise - * it('is async', () => { - * return failedPromise().should.be.rejectedWith({ message: 'boom' }); - * }); - */ - Assertion.prototype.rejectedWith = function(message, properties) { - this.params = {operator: 'to be rejected'}; - - should(this.obj).be.a.Promise(); - - var that = this; - return this.obj.then(function(value) { - if (!that.negate) { - that.fail(); - } - return value; - }, function next$onError(err) { - if (that.negate) { - that.fail(); - } - - var errorMatched = true; - var errorInfo = ''; - - if ('string' === typeof message) { - errorMatched = message === err.message; - } else if (message instanceof RegExp) { - errorMatched = message.test(err.message); - } else if ('function' === typeof message) { - errorMatched = err instanceof message; - } else if (message !== null && typeof message === 'object') { - try { - should(err).match(message); - } catch (e) { - if (e instanceof should.AssertionError) { - errorInfo = ': ' + e.message; - errorMatched = false; - } else { - throw e; - } - } - } - - if (!errorMatched) { - if ( typeof message === 'string' || message instanceof RegExp) { - errorInfo = ' with a message matching ' + should.format(message) + ", but got '" + err.message + "'"; - } else if ('function' === typeof message) { - errorInfo = ' of type ' + util.functionName(message) + ', but got ' + util.functionName(err.constructor); - } - } else if ('function' === typeof message && properties) { - try { - should(err).match(properties); - } catch (e) { - if (e instanceof should.AssertionError) { - errorInfo = ': ' + e.message; - errorMatched = false; - } else { - throw e; - } - } - } - - that.params.operator += errorInfo; - - that.assert(errorMatched); - - return err; - }); - }; - - /** - * Assert given object is promise and wrap it in PromisedAssertion, which has all properties of Assertion. - * That means you can chain as with usual Assertion. - * Result of assertion is still .thenable and should be handled accordingly. - * - * @name finally - * @memberOf Assertion - * @alias Assertion#eventually - * @category assertion promises - * @returns {PromisedAssertion} Like Assertion, but .then this.obj in Assertion - * @example - * - * (new Promise(function(resolve, reject) { resolve(10); })) - * .should.be.eventually.equal(10); - * - * // test example with mocha it is possible to return promise - * it('is async', () => { - * return new Promise(resolve => resolve(10)) - * .should.be.finally.equal(10); - * }); - */ - Object.defineProperty(Assertion.prototype, 'finally', { - get: function() { - should(this.obj).be.a.Promise(); - - var that = this; - - return new PromisedAssertion(this.obj.then(function(obj) { - var a = should(obj); - - a.negate = that.negate; - a.anyOne = that.anyOne; - - return a; - })); - } - }); - - Assertion.alias('finally', 'eventually'); -}; - - -/***/ }), -/* 85 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var util = __webpack_require__(0); -var eql = __webpack_require__(1); - -var aSlice = Array.prototype.slice; - -module.exports = function(should, Assertion) { - var i = should.format; - /** - * Asserts given object has some descriptor. **On success it change given object to be value of property**. - * - * @name propertyWithDescriptor - * @memberOf Assertion - * @category assertion property - * @param {string} name Name of property - * @param {Object} desc Descriptor like used in Object.defineProperty (not required to add all properties) - * @example - * - * ({ a: 10 }).should.have.propertyWithDescriptor('a', { enumerable: true }); - */ - Assertion.add('propertyWithDescriptor', function(name, desc) { - this.params = {actual: this.obj, operator: 'to have own property with descriptor ' + i(desc)}; - var obj = this.obj; - this.have.ownProperty(name); - should(Object.getOwnPropertyDescriptor(Object(obj), name)).have.properties(desc); - }); - - function processPropsArgs() { - var args = {}; - if (arguments.length > 1) { - args.names = aSlice.call(arguments); - } else { - var arg = arguments[0]; - if (typeof arg === 'string') { - args.names = [arg]; - } else if (util.isIndexable(arg)) { - args.names = arg; - } else { - args.names = Object.keys(arg); - args.values = arg; - } - } - return args; - } - - - /** - * Asserts given object has enumerable property with optionally value. **On success it change given object to be value of property**. - * - * @name enumerable - * @memberOf Assertion - * @category assertion property - * @param {string} name Name of property - * @param {*} [val] Optional property value to check - * @example - * - * ({ a: 10 }).should.have.enumerable('a'); - */ - Assertion.add('enumerable', function(name, val) { - name = util.convertPropertyName(name); - - this.params = { - operator: "to have enumerable property " + util.formatProp(name) + (arguments.length > 1 ? " equal to " + i(val): "") - }; - - var desc = { enumerable: true }; - if (arguments.length > 1) desc.value = val; - this.have.propertyWithDescriptor(name, desc); - }); - - /** - * Asserts given object has enumerable properties - * - * @name enumerables - * @memberOf Assertion - * @category assertion property - * @param {Array|...string|Object} names Names of property - * @example - * - * ({ a: 10, b: 10 }).should.have.enumerables('a'); - */ - Assertion.add('enumerables', function(/*names*/) { - var args = processPropsArgs.apply(null, arguments); - - this.params = { - operator: "to have enumerables " + args.names.map(util.formatProp) - }; - - var obj = this.obj; - args.names.forEach(function(name) { - should(obj).have.enumerable(name); - }); - }); - - /** - * Asserts given object has property with optionally value. **On success it change given object to be value of property**. - * - * @name property - * @memberOf Assertion - * @category assertion property - * @param {string} name Name of property - * @param {*} [val] Optional property value to check - * @example - * - * ({ a: 10 }).should.have.property('a'); - */ - Assertion.add('property', function(name, val) { - name = util.convertPropertyName(name); - if (arguments.length > 1) { - var p = {}; - p[name] = val; - this.have.properties(p); - } else { - this.have.properties(name); - } - this.obj = this.obj[name]; - }); - - /** - * Asserts given object has properties. On this method affect .any modifier, which allow to check not all properties. - * - * @name properties - * @memberOf Assertion - * @category assertion property - * @param {Array|...string|Object} names Names of property - * @example - * - * ({ a: 10 }).should.have.properties('a'); - * ({ a: 10, b: 20 }).should.have.properties([ 'a' ]); - * ({ a: 10, b: 20 }).should.have.properties({ b: 20 }); - */ - Assertion.add('properties', function(names) { - var values = {}; - if (arguments.length > 1) { - names = aSlice.call(arguments); - } else if (!Array.isArray(names)) { - if (typeof names == 'string' || typeof names == 'symbol') { - names = [names]; - } else { - values = names; - names = Object.keys(names); - } - } - - var obj = Object(this.obj), missingProperties = []; - - //just enumerate properties and check if they all present - names.forEach(function(name) { - if (!(name in obj)) missingProperties.push(util.formatProp(name)); - }); - - var props = missingProperties; - if (props.length === 0) { - props = names.map(util.formatProp); - } else if (this.anyOne) { - props = names.filter(function(name) { - return missingProperties.indexOf(util.formatProp(name)) < 0; - }).map(util.formatProp); - } - - var operator = (props.length === 1 ? - 'to have property ' : 'to have ' + (this.anyOne ? 'any of ' : '') + 'properties ') + props.join(', '); - - this.params = {obj: this.obj, operator: operator}; - - //check that all properties presented - //or if we request one of them that at least one them presented - this.assert(missingProperties.length === 0 || (this.anyOne && missingProperties.length != names.length)); - - // check if values in object matched expected - var valueCheckNames = Object.keys(values); - if (valueCheckNames.length) { - var wrongValues = []; - props = []; - - // now check values, as there we have all properties - valueCheckNames.forEach(function(name) { - var value = values[name]; - if (!eql(obj[name], value).result) { - wrongValues.push(util.formatProp(name) + ' of ' + i(value) + ' (got ' + i(obj[name]) + ')'); - } else { - props.push(util.formatProp(name) + ' of ' + i(value)); - } - }); - - if ((wrongValues.length !== 0 && !this.anyOne) || (this.anyOne && props.length === 0)) { - props = wrongValues; - } - - operator = (props.length === 1 ? - 'to have property ' : 'to have ' + (this.anyOne ? 'any of ' : '') + 'properties ') + props.join(', '); - - this.params = {obj: this.obj, operator: operator}; - - //if there is no not matched values - //or there is at least one matched - this.assert(wrongValues.length === 0 || (this.anyOne && wrongValues.length != valueCheckNames.length)); - } - }); - - /** - * Asserts given object has property `length` with given value `n` - * - * @name length - * @alias Assertion#lengthOf - * @memberOf Assertion - * @category assertion property - * @param {number} n Expected length - * @param {string} [description] Optional message - * @example - * - * [1, 2].should.have.length(2); - */ - Assertion.add('length', function(n, description) { - this.have.property('length', n, description); - }); - - Assertion.alias('length', 'lengthOf'); - - var hasOwnProperty = Object.prototype.hasOwnProperty; - - /** - * Asserts given object has own property. **On success it change given object to be value of property**. - * - * @name ownProperty - * @alias Assertion#hasOwnProperty - * @memberOf Assertion - * @category assertion property - * @param {string} name Name of property - * @param {string} [description] Optional message - * @example - * - * ({ a: 10 }).should.have.ownProperty('a'); - */ - Assertion.add('ownProperty', function(name, description) { - name = util.convertPropertyName(name); - this.params = { - actual: this.obj, - operator: 'to have own property ' + util.formatProp(name), - message: description - }; - - this.assert(hasOwnProperty.call(this.obj, name)); - - this.obj = this.obj[name]; - }); - - Assertion.alias('ownProperty', 'hasOwnProperty'); - - /** - * Asserts given object is empty. For strings, arrays and arguments it checks .length property, for objects it checks keys. - * - * @name empty - * @memberOf Assertion - * @category assertion property - * @example - * - * ''.should.be.empty(); - * [].should.be.empty(); - * ({}).should.be.empty(); - */ - Assertion.add('empty', function() { - this.params = {operator: 'to be empty'}; - - if (util.length(this.obj) !== void 0) { - should(this.obj).have.property('length', 0); - } else { - var obj = Object(this.obj); // wrap to reference for booleans and numbers - for (var prop in obj) { - should(this.obj).not.have.ownProperty(prop); - } - } - }, true); - - /** - * Asserts given object has exact keys. Compared to `properties`, `keys` does not accept Object as a argument. - * - * @name keys - * @alias Assertion#key - * @memberOf Assertion - * @category assertion property - * @param {Array|...string} [keys] Keys to check - * @example - * - * ({ a: 10 }).should.have.keys('a'); - * ({ a: 10, b: 20 }).should.have.keys('a', 'b'); - * ({ a: 10, b: 20 }).should.have.keys([ 'a', 'b' ]); - * ({}).should.have.keys(); - */ - Assertion.add('keys', function(keys) { - if (arguments.length > 1) keys = aSlice.call(arguments); - else if (arguments.length === 1 && typeof keys === 'string') keys = [keys]; - else if (arguments.length === 0) keys = []; - - keys = keys.map(String); - - var obj = Object(this.obj); - - // first check if some keys are missing - var missingKeys = []; - keys.forEach(function(key) { - if (!hasOwnProperty.call(this.obj, key)) - missingKeys.push(util.formatProp(key)); - }, this); - - // second check for extra keys - var extraKeys = []; - Object.keys(obj).forEach(function(key) { - if (keys.indexOf(key) < 0) { - extraKeys.push(util.formatProp(key)); - } - }); - - var verb = keys.length === 0 ? 'to be empty' : - 'to have ' + (keys.length === 1 ? 'key ' : 'keys '); - - this.params = {operator: verb + keys.map(util.formatProp).join(', ')}; - - if (missingKeys.length > 0) - this.params.operator += '\n\tmissing keys: ' + missingKeys.join(', '); - - if (extraKeys.length > 0) - this.params.operator += '\n\textra keys: ' + extraKeys.join(', '); - - this.assert(missingKeys.length === 0 && extraKeys.length === 0); - }); - - Assertion.alias("keys", "key"); - - /** - * Asserts given object has nested property in depth by path. **On success it change given object to be value of final property**. - * - * @name propertyByPath - * @memberOf Assertion - * @category assertion property - * @param {Array|...string} properties Properties path to search - * @example - * - * ({ a: {b: 10}}).should.have.propertyByPath('a', 'b').eql(10); - */ - Assertion.add('propertyByPath', function(properties) { - if (arguments.length > 1) properties = aSlice.call(arguments); - else if (arguments.length === 1 && typeof properties == 'string') properties = [properties]; - else if (arguments.length === 0) properties = []; - - var allProps = properties.map(util.formatProp); - - properties = properties.map(String); - - var obj = should(Object(this.obj)); - - var foundProperties = []; - - var currentProperty; - while (properties.length) { - currentProperty = properties.shift(); - this.params = {operator: 'to have property by path ' + allProps.join(', ') + ' - failed on ' + util.formatProp(currentProperty)}; - obj = obj.have.property(currentProperty); - foundProperties.push(currentProperty); - } - - this.params = {obj: this.obj, operator: 'to have property by path ' + allProps.join(', ')}; - - this.obj = obj.obj; - }); -}; - - -/***/ }), -/* 86 */ -/***/ (function(module, exports) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -module.exports = function(should, Assertion) { - /** - * Assert given string starts with prefix - * @name startWith - * @memberOf Assertion - * @category assertion strings - * @param {string} str Prefix - * @param {string} [description] Optional message - * @example - * - * 'abc'.should.startWith('a'); - */ - Assertion.add('startWith', function(str, description) { - this.params = { operator: 'to start with ' + should.format(str), message: description }; - - this.assert(0 === this.obj.indexOf(str)); - }); - - /** - * Assert given string ends with prefix - * @name endWith - * @memberOf Assertion - * @category assertion strings - * @param {string} str Prefix - * @param {string} [description] Optional message - * @example - * - * 'abca'.should.endWith('a'); - */ - Assertion.add('endWith', function(str, description) { - this.params = { operator: 'to end with ' + should.format(str), message: description }; - - this.assert(this.obj.indexOf(str, this.obj.length - str.length) >= 0); - }); -}; - - -/***/ }), -/* 87 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - -var util = __webpack_require__(0); - -module.exports = function(should, Assertion) { - /** - * Assert given object is number - * @name Number - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('Number', function() { - this.params = {operator: 'to be a number'}; - - this.have.type('number'); - }); - - /** - * Assert given object is arguments - * @name arguments - * @alias Assertion#Arguments - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('arguments', function() { - this.params = {operator: 'to be arguments'}; - - this.have.class('Arguments'); - }); - - Assertion.alias('arguments', 'Arguments'); - - /** - * Assert given object has some type using `typeof` - * @name type - * @memberOf Assertion - * @param {string} type Type name - * @param {string} [description] Optional message - * @category assertion types - */ - Assertion.add('type', function(type, description) { - this.params = {operator: 'to have type ' + type, message: description}; - - should(typeof this.obj).be.exactly(type); - }); - - /** - * Assert given object is instance of `constructor` - * @name instanceof - * @alias Assertion#instanceOf - * @memberOf Assertion - * @param {Function} constructor Constructor function - * @param {string} [description] Optional message - * @category assertion types - */ - Assertion.add('instanceof', function(constructor, description) { - this.params = {operator: 'to be an instance of ' + util.functionName(constructor), message: description}; - - this.assert(Object(this.obj) instanceof constructor); - }); - - Assertion.alias('instanceof', 'instanceOf'); - - /** - * Assert given object is function - * @name Function - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('Function', function() { - this.params = {operator: 'to be a function'}; - - this.have.type('function'); - }); - - /** - * Assert given object is object - * @name Object - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('Object', function() { - this.params = {operator: 'to be an object'}; - - this.is.not.null().and.have.type('object'); - }); - - /** - * Assert given object is string - * @name String - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('String', function() { - this.params = {operator: 'to be a string'}; - - this.have.type('string'); - }); - - /** - * Assert given object is array - * @name Array - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('Array', function() { - this.params = {operator: 'to be an array'}; - - this.have.class('Array'); - }); - - /** - * Assert given object is boolean - * @name Boolean - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('Boolean', function() { - this.params = {operator: 'to be a boolean'}; - - this.have.type('boolean'); - }); - - /** - * Assert given object is error - * @name Error - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('Error', function() { - this.params = {operator: 'to be an error'}; - - this.have.instanceOf(Error); - }); - - /** - * Assert given object is a date - * @name Date - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('Date', function() { - this.params = {operator: 'to be a date'}; - - this.have.instanceOf(Date); - }); - - /** - * Assert given object is null - * @name null - * @alias Assertion#Null - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('null', function() { - this.params = {operator: 'to be null'}; - - this.assert(this.obj === null); - }); - - Assertion.alias('null', 'Null'); - - /** - * Assert given object has some internal [[Class]], via Object.prototype.toString call - * @name class - * @alias Assertion#Class - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('class', function(cls) { - this.params = {operator: 'to have [[Class]] ' + cls}; - - this.assert(Object.prototype.toString.call(this.obj) === '[object ' + cls + ']'); - }); - - Assertion.alias('class', 'Class'); - - /** - * Assert given object is undefined - * @name undefined - * @alias Assertion#Undefined - * @memberOf Assertion - * @category assertion types - */ - Assertion.add('undefined', function() { - this.params = {operator: 'to be undefined'}; - - this.assert(this.obj === void 0); - }); - - Assertion.alias('undefined', 'Undefined'); - - /** - * Assert given object supports es6 iterable protocol (just check - * that object has property Symbol.iterator, which is a function) - * @name iterable - * @memberOf Assertion - * @category assertion es6 - */ - Assertion.add('iterable', function() { - this.params = {operator: 'to be iterable'}; - - should(this.obj).have.property(Symbol.iterator).which.is.a.Function(); - }); - - /** - * Assert given object supports es6 iterator protocol (just check - * that object has property next, which is a function) - * @name iterator - * @memberOf Assertion - * @category assertion es6 - */ - Assertion.add('iterator', function() { - this.params = {operator: 'to be iterator'}; - - should(this.obj).have.property('next').which.is.a.Function(); - }); - - /** - * Assert given object is a generator object - * @name generator - * @memberOf Assertion - * @category assertion es6 - */ - Assertion.add('generator', function() { - this.params = {operator: 'to be generator'}; - - should(this.obj).be.iterable - .and.iterator - .and.it.is.equal(this.obj[Symbol.iterator]()); - }); -}; - - -/***/ }), -/* 88 */ -/***/ (function(module, exports, __webpack_require__) { - -/* - * should.js - assertion library - * Copyright(c) 2010-2013 TJ Holowaychuk - * Copyright(c) 2013-2016 Denis Bardadym - * MIT Licensed - */ - - -var util = __webpack_require__(0); - -/** - * Our function should - * - * @param {*} obj Object to assert - * @returns {should.Assertion} Returns new Assertion for beginning assertion chain - * @example - * - * var should = require('should'); - * should('abc').be.a.String(); - */ -function should(obj) { - return (new should.Assertion(obj)); -} - -should.AssertionError = __webpack_require__(60); -should.Assertion = __webpack_require__(3); - -should.format = util.format; -should.type = __webpack_require__(2); -should.util = util; - -/** - * Object with configuration. - * It contains such properties: - * * `checkProtoEql` boolean - Affect if `.eql` will check objects prototypes - * * `plusZeroAndMinusZeroEqual` boolean - Affect if `.eql` will treat +0 and -0 as equal - * Also it can contain options for should-format. - * - * @type {Object} - * @memberOf should - * @static - * @example - * - * var a = { a: 10 }, b = Object.create(null); - * b.a = 10; - * - * a.should.be.eql(b); - * //not throws - * - * should.config.checkProtoEql = true; - * a.should.be.eql(b); - * //throws AssertionError: expected { a: 10 } to equal { a: 10 } (because A and B have different prototypes) - */ -should.config = __webpack_require__(63); - -// Expose should to external world. -exports = module.exports = should; - -/** - * Allow to extend given prototype with should property using given name. This getter will **unwrap** all standard wrappers like `Number`, `Boolean`, `String`. - * Using `should(obj)` is the equivalent of using `obj.should` with known issues (like nulls and method calls etc). - * - * To add new assertions, need to use Assertion.add method. - * - * @param {string} [propertyName] Name of property to add. Default is `'should'`. - * @param {Object} [proto] Prototype to extend with. Default is `Object.prototype`. - * @memberOf should - * @returns {{ name: string, descriptor: Object, proto: Object }} Descriptor enough to return all back - * @static - * @example - * - * var prev = should.extend('must', Object.prototype); - * - * 'abc'.must.startWith('a'); - * - * var should = should.noConflict(prev); - * should.not.exist(Object.prototype.must); - */ -should.extend = function(propertyName, proto) { - propertyName = propertyName || 'should'; - proto = proto || Object.prototype; - - var prevDescriptor = Object.getOwnPropertyDescriptor(proto, propertyName); - - Object.defineProperty(proto, propertyName, { - set: function() { - }, - get: function() { - return should(util.isWrapperType(this) ? this.valueOf() : this); - }, - configurable: true - }); - - return { name: propertyName, descriptor: prevDescriptor, proto: proto }; -}; - -/** - * Delete previous extension. If `desc` missing it will remove default extension. - * - * @param {{ name: string, descriptor: Object, proto: Object }} [desc] Returned from `should.extend` object - * @memberOf should - * @returns {Function} Returns should function - * @static - * @example - * - * var should = require('should').noConflict(); - * - * should(Object.prototype).not.have.property('should'); - * - * var prev = should.extend('must', Object.prototype); - * 'abc'.must.startWith('a'); - * should.noConflict(prev); - * - * should(Object.prototype).not.have.property('must'); - */ -should.noConflict = function(desc) { - desc = desc || should._prevShould; - - if (desc) { - delete desc.proto[desc.name]; - - if (desc.descriptor) { - Object.defineProperty(desc.proto, desc.name, desc.descriptor); - } - } - return should; -}; - -/** - * Simple utility function for a bit more easier should assertion extension - * @param {Function} f So called plugin function. It should accept 2 arguments: `should` function and `Assertion` constructor - * @memberOf should - * @returns {Function} Returns `should` function - * @static - * @example - * - * should.use(function(should, Assertion) { - * Assertion.add('asset', function() { - * this.params = { operator: 'to be asset' }; - * - * this.obj.should.have.property('id').which.is.a.Number(); - * this.obj.should.have.property('path'); - * }) - * }) - */ -should.use = function(f) { - f(should, should.Assertion); - return this; -}; - -should - .use(__webpack_require__(76)) - .use(__webpack_require__(78)) - .use(__webpack_require__(77)) - .use(__webpack_require__(83)) - .use(__webpack_require__(80)) - .use(__webpack_require__(87)) - .use(__webpack_require__(86)) - .use(__webpack_require__(85)) - .use(__webpack_require__(81)) - .use(__webpack_require__(82)) - .use(__webpack_require__(79)) - .use(__webpack_require__(84)); - - -/***/ }), -/* 89 */ -/***/ (function(module, exports, __webpack_require__) { - -var should = __webpack_require__(66); -var postalCodes = __webpack_require__(67) - -describe('Postal codes validation: ', function () { - - var countriesData = __webpack_require__(61); - Object.keys(countriesData).map(function (alpha2Code) { - - var formatFileName = countriesData[alpha2Code].postalCodeFormat; - if (!formatFileName) { - console.log('Cannot find format file for ' + alpha2Code); - return; - } - - var format = __webpack_require__(65)("./" + formatFileName); - format.TestData.Valid.map(function (validPostalCode) { - it(alpha2Code + ' / ' + validPostalCode + ' is valid', function () { - postalCodes.validate(alpha2Code, validPostalCode).should.eql(true); - }) - }); - - format.TestData.Invalid.map(function (invalidPostalCode) { - it(alpha2Code + ' / ' + invalidPostalCode + ' is NOT valid', function () { - postalCodes.validate(alpha2Code, invalidPostalCode).should.eql(false); - }) - }); - }); -}); - -describe('Postal codes border cases: ', function() { - var testCases = [ - { - countryCode: null, - postalCode: 1234, - description: 'should return error when country code is null', - expectedResult: undefined, - expectedError: 'Invalid country code.', - }, - { - countryCode: undefined, - postalCode: 1234, - description: 'should return error when country code is undefined', - expectedResult: undefined, - expectedError: 'Invalid country code.', - }, - { - countryCode: 'us', - postalCode: null, - description: 'should return error when postal code is null', - expectedResult: undefined, - expectedError: 'Invalid postal code.', - }, - { - countryCode: 'gb', - postalCode: undefined, - description: 'should return error when postal code is undefined', - expectedResult: undefined, - expectedError: 'Invalid postal code.', - }, - { - countryCode: 'chf', - postalCode: 8001, - description: 'should return false when country code is unknown', - expectedResult: undefined, - expectedError: 'Unknown alpha2/alpha3 country code: chf', - }, - { - countryCode: 'ch', - postalCode: '80010', - description: 'should return false when postal code is invalid', - expectedResult: false, - expectedError: null, - }, - { - countryCode: 'ch', - postalCode: '8001', - description: 'should return true when postal code is valid string', - expectedResult: true, - expectedError: null, - }, - { - countryCode: 'ch', - postalCode: 8001, - description: 'should return true when postal code is valid number', - expectedResult: true, - expectedError: null, - }, - { - countryCode: ' us ', - postalCode: ' 98001 ', - description: 'should trim white spaces in input', - expectedResult: true, - expectedError: null, - } - ]; - - testCases.forEach(function(test) { - it(`${test.description}`, function(done) { - postalCodes.validate(test.countryCode, test.postalCode, function(error, result) { - should(result).be.eql(test.expectedResult); - should(error).be.eql(test.expectedError); - done(); - }); - }); - }); -}); - -/***/ }), -/* 90 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/* WEBPACK VAR INJECTION */(function(global) {/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -/* eslint-disable no-proto */ - - - -var base64 = __webpack_require__(91) -var ieee754 = __webpack_require__(92) -var isArray = __webpack_require__(93) - -exports.Buffer = Buffer -exports.SlowBuffer = SlowBuffer -exports.INSPECT_MAX_BYTES = 50 - -/** - * If `Buffer.TYPED_ARRAY_SUPPORT`: - * === true Use Uint8Array implementation (fastest) - * === false Use Object implementation (most compatible, even IE6) - * - * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, - * Opera 11.6+, iOS 4.2+. - * - * Due to various browser bugs, sometimes the Object implementation will be used even - * when the browser supports typed arrays. - * - * Note: - * - * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, - * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. - * - * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. - * - * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of - * incorrect length in some situations. - - * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they - * get the Object implementation, which is slower but behaves correctly. - */ -Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined - ? global.TYPED_ARRAY_SUPPORT - : typedArraySupport() - -/* - * Export kMaxLength after typed array support is determined. - */ -exports.kMaxLength = kMaxLength() - -function typedArraySupport () { - try { - var arr = new Uint8Array(1) - arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} - return arr.foo() === 42 && // typed array instances can be augmented - typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` - arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` - } catch (e) { - return false - } -} - -function kMaxLength () { - return Buffer.TYPED_ARRAY_SUPPORT - ? 0x7fffffff - : 0x3fffffff -} - -function createBuffer (that, length) { - if (kMaxLength() < length) { - throw new RangeError('Invalid typed array length') - } - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = new Uint8Array(length) - that.__proto__ = Buffer.prototype - } else { - // Fallback: Return an object instance of the Buffer class - if (that === null) { - that = new Buffer(length) - } - that.length = length - } - - return that -} - -/** - * The Buffer constructor returns instances of `Uint8Array` that have their - * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of - * `Uint8Array`, so the returned instances will have all the node `Buffer` methods - * and the `Uint8Array` methods. Square bracket notation works as expected -- it - * returns a single octet. - * - * The `Uint8Array` prototype remains unmodified. - */ - -function Buffer (arg, encodingOrOffset, length) { - if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { - return new Buffer(arg, encodingOrOffset, length) - } - - // Common case. - if (typeof arg === 'number') { - if (typeof encodingOrOffset === 'string') { - throw new Error( - 'If encoding is specified then the first argument must be a string' - ) - } - return allocUnsafe(this, arg) - } - return from(this, arg, encodingOrOffset, length) -} - -Buffer.poolSize = 8192 // not used by this implementation - -// TODO: Legacy, not needed anymore. Remove in next major version. -Buffer._augment = function (arr) { - arr.__proto__ = Buffer.prototype - return arr -} - -function from (that, value, encodingOrOffset, length) { - if (typeof value === 'number') { - throw new TypeError('"value" argument must not be a number') - } - - if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { - return fromArrayBuffer(that, value, encodingOrOffset, length) - } - - if (typeof value === 'string') { - return fromString(that, value, encodingOrOffset) - } - - return fromObject(that, value) -} - -/** - * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError - * if value is a number. - * Buffer.from(str[, encoding]) - * Buffer.from(array) - * Buffer.from(buffer) - * Buffer.from(arrayBuffer[, byteOffset[, length]]) - **/ -Buffer.from = function (value, encodingOrOffset, length) { - return from(null, value, encodingOrOffset, length) -} - -if (Buffer.TYPED_ARRAY_SUPPORT) { - Buffer.prototype.__proto__ = Uint8Array.prototype - Buffer.__proto__ = Uint8Array - if (typeof Symbol !== 'undefined' && Symbol.species && - Buffer[Symbol.species] === Buffer) { - // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 - Object.defineProperty(Buffer, Symbol.species, { - value: null, - configurable: true - }) - } -} - -function assertSize (size) { - if (typeof size !== 'number') { - throw new TypeError('"size" argument must be a number') - } else if (size < 0) { - throw new RangeError('"size" argument must not be negative') - } -} - -function alloc (that, size, fill, encoding) { - assertSize(size) - if (size <= 0) { - return createBuffer(that, size) - } - if (fill !== undefined) { - // Only pay attention to encoding if it's a string. This - // prevents accidentally sending in a number that would - // be interpretted as a start offset. - return typeof encoding === 'string' - ? createBuffer(that, size).fill(fill, encoding) - : createBuffer(that, size).fill(fill) - } - return createBuffer(that, size) -} - -/** - * Creates a new filled Buffer instance. - * alloc(size[, fill[, encoding]]) - **/ -Buffer.alloc = function (size, fill, encoding) { - return alloc(null, size, fill, encoding) -} - -function allocUnsafe (that, size) { - assertSize(size) - that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) { - for (var i = 0; i < size; ++i) { - that[i] = 0 - } - } - return that -} - -/** - * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. - * */ -Buffer.allocUnsafe = function (size) { - return allocUnsafe(null, size) -} -/** - * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. - */ -Buffer.allocUnsafeSlow = function (size) { - return allocUnsafe(null, size) -} - -function fromString (that, string, encoding) { - if (typeof encoding !== 'string' || encoding === '') { - encoding = 'utf8' - } - - if (!Buffer.isEncoding(encoding)) { - throw new TypeError('"encoding" must be a valid string encoding') - } - - var length = byteLength(string, encoding) | 0 - that = createBuffer(that, length) - - var actual = that.write(string, encoding) - - if (actual !== length) { - // Writing a hex string, for example, that contains invalid characters will - // cause everything after the first invalid character to be ignored. (e.g. - // 'abxxcd' will be treated as 'ab') - that = that.slice(0, actual) - } - - return that -} - -function fromArrayLike (that, array) { - var length = array.length < 0 ? 0 : checked(array.length) | 0 - that = createBuffer(that, length) - for (var i = 0; i < length; i += 1) { - that[i] = array[i] & 255 - } - return that -} - -function fromArrayBuffer (that, array, byteOffset, length) { - array.byteLength // this throws if `array` is not a valid ArrayBuffer - - if (byteOffset < 0 || array.byteLength < byteOffset) { - throw new RangeError('\'offset\' is out of bounds') - } - - if (array.byteLength < byteOffset + (length || 0)) { - throw new RangeError('\'length\' is out of bounds') - } - - if (byteOffset === undefined && length === undefined) { - array = new Uint8Array(array) - } else if (length === undefined) { - array = new Uint8Array(array, byteOffset) - } else { - array = new Uint8Array(array, byteOffset, length) - } - - if (Buffer.TYPED_ARRAY_SUPPORT) { - // Return an augmented `Uint8Array` instance, for best performance - that = array - that.__proto__ = Buffer.prototype - } else { - // Fallback: Return an object instance of the Buffer class - that = fromArrayLike(that, array) - } - return that -} - -function fromObject (that, obj) { - if (Buffer.isBuffer(obj)) { - var len = checked(obj.length) | 0 - that = createBuffer(that, len) - - if (that.length === 0) { - return that - } - - obj.copy(that, 0, 0, len) - return that - } - - if (obj) { - if ((typeof ArrayBuffer !== 'undefined' && - obj.buffer instanceof ArrayBuffer) || 'length' in obj) { - if (typeof obj.length !== 'number' || isnan(obj.length)) { - return createBuffer(that, 0) - } - return fromArrayLike(that, obj) - } - - if (obj.type === 'Buffer' && isArray(obj.data)) { - return fromArrayLike(that, obj.data) - } - } - - throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') -} - -function checked (length) { - // Note: cannot use `length < kMaxLength()` here because that fails when - // length is NaN (which is otherwise coerced to zero.) - if (length >= kMaxLength()) { - throw new RangeError('Attempt to allocate Buffer larger than maximum ' + - 'size: 0x' + kMaxLength().toString(16) + ' bytes') - } - return length | 0 -} - -function SlowBuffer (length) { - if (+length != length) { // eslint-disable-line eqeqeq - length = 0 - } - return Buffer.alloc(+length) -} - -Buffer.isBuffer = function isBuffer (b) { - return !!(b != null && b._isBuffer) -} - -Buffer.compare = function compare (a, b) { - if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { - throw new TypeError('Arguments must be Buffers') - } - - if (a === b) return 0 - - var x = a.length - var y = b.length - - for (var i = 0, len = Math.min(x, y); i < len; ++i) { - if (a[i] !== b[i]) { - x = a[i] - y = b[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -Buffer.isEncoding = function isEncoding (encoding) { - switch (String(encoding).toLowerCase()) { - case 'hex': - case 'utf8': - case 'utf-8': - case 'ascii': - case 'latin1': - case 'binary': - case 'base64': - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return true - default: - return false - } -} - -Buffer.concat = function concat (list, length) { - if (!isArray(list)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - - if (list.length === 0) { - return Buffer.alloc(0) - } - - var i - if (length === undefined) { - length = 0 - for (i = 0; i < list.length; ++i) { - length += list[i].length - } - } - - var buffer = Buffer.allocUnsafe(length) - var pos = 0 - for (i = 0; i < list.length; ++i) { - var buf = list[i] - if (!Buffer.isBuffer(buf)) { - throw new TypeError('"list" argument must be an Array of Buffers') - } - buf.copy(buffer, pos) - pos += buf.length - } - return buffer -} - -function byteLength (string, encoding) { - if (Buffer.isBuffer(string)) { - return string.length - } - if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && - (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { - return string.byteLength - } - if (typeof string !== 'string') { - string = '' + string - } - - var len = string.length - if (len === 0) return 0 - - // Use a for loop to avoid recursion - var loweredCase = false - for (;;) { - switch (encoding) { - case 'ascii': - case 'latin1': - case 'binary': - return len - case 'utf8': - case 'utf-8': - case undefined: - return utf8ToBytes(string).length - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return len * 2 - case 'hex': - return len >>> 1 - case 'base64': - return base64ToBytes(string).length - default: - if (loweredCase) return utf8ToBytes(string).length // assume utf8 - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} -Buffer.byteLength = byteLength - -function slowToString (encoding, start, end) { - var loweredCase = false - - // No need to verify that "this.length <= MAX_UINT32" since it's a read-only - // property of a typed array. - - // This behaves neither like String nor Uint8Array in that we set start/end - // to their upper/lower bounds if the value passed is out of range. - // undefined is handled specially as per ECMA-262 6th Edition, - // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. - if (start === undefined || start < 0) { - start = 0 - } - // Return early if start > this.length. Done here to prevent potential uint32 - // coercion fail below. - if (start > this.length) { - return '' - } - - if (end === undefined || end > this.length) { - end = this.length - } - - if (end <= 0) { - return '' - } - - // Force coersion to uint32. This will also coerce falsey/NaN values to 0. - end >>>= 0 - start >>>= 0 - - if (end <= start) { - return '' - } - - if (!encoding) encoding = 'utf8' - - while (true) { - switch (encoding) { - case 'hex': - return hexSlice(this, start, end) - - case 'utf8': - case 'utf-8': - return utf8Slice(this, start, end) - - case 'ascii': - return asciiSlice(this, start, end) - - case 'latin1': - case 'binary': - return latin1Slice(this, start, end) - - case 'base64': - return base64Slice(this, start, end) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return utf16leSlice(this, start, end) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = (encoding + '').toLowerCase() - loweredCase = true - } - } -} - -// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect -// Buffer instances. -Buffer.prototype._isBuffer = true - -function swap (b, n, m) { - var i = b[n] - b[n] = b[m] - b[m] = i -} - -Buffer.prototype.swap16 = function swap16 () { - var len = this.length - if (len % 2 !== 0) { - throw new RangeError('Buffer size must be a multiple of 16-bits') - } - for (var i = 0; i < len; i += 2) { - swap(this, i, i + 1) - } - return this -} - -Buffer.prototype.swap32 = function swap32 () { - var len = this.length - if (len % 4 !== 0) { - throw new RangeError('Buffer size must be a multiple of 32-bits') - } - for (var i = 0; i < len; i += 4) { - swap(this, i, i + 3) - swap(this, i + 1, i + 2) - } - return this -} - -Buffer.prototype.swap64 = function swap64 () { - var len = this.length - if (len % 8 !== 0) { - throw new RangeError('Buffer size must be a multiple of 64-bits') - } - for (var i = 0; i < len; i += 8) { - swap(this, i, i + 7) - swap(this, i + 1, i + 6) - swap(this, i + 2, i + 5) - swap(this, i + 3, i + 4) - } - return this -} - -Buffer.prototype.toString = function toString () { - var length = this.length | 0 - if (length === 0) return '' - if (arguments.length === 0) return utf8Slice(this, 0, length) - return slowToString.apply(this, arguments) -} - -Buffer.prototype.equals = function equals (b) { - if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') - if (this === b) return true - return Buffer.compare(this, b) === 0 -} - -Buffer.prototype.inspect = function inspect () { - var str = '' - var max = exports.INSPECT_MAX_BYTES - if (this.length > 0) { - str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') - if (this.length > max) str += ' ... ' - } - return '' -} - -Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { - if (!Buffer.isBuffer(target)) { - throw new TypeError('Argument must be a Buffer') - } - - if (start === undefined) { - start = 0 - } - if (end === undefined) { - end = target ? target.length : 0 - } - if (thisStart === undefined) { - thisStart = 0 - } - if (thisEnd === undefined) { - thisEnd = this.length - } - - if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { - throw new RangeError('out of range index') - } - - if (thisStart >= thisEnd && start >= end) { - return 0 - } - if (thisStart >= thisEnd) { - return -1 - } - if (start >= end) { - return 1 - } - - start >>>= 0 - end >>>= 0 - thisStart >>>= 0 - thisEnd >>>= 0 - - if (this === target) return 0 - - var x = thisEnd - thisStart - var y = end - start - var len = Math.min(x, y) - - var thisCopy = this.slice(thisStart, thisEnd) - var targetCopy = target.slice(start, end) - - for (var i = 0; i < len; ++i) { - if (thisCopy[i] !== targetCopy[i]) { - x = thisCopy[i] - y = targetCopy[i] - break - } - } - - if (x < y) return -1 - if (y < x) return 1 - return 0 -} - -// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, -// OR the last index of `val` in `buffer` at offset <= `byteOffset`. -// -// Arguments: -// - buffer - a Buffer to search -// - val - a string, Buffer, or number -// - byteOffset - an index into `buffer`; will be clamped to an int32 -// - encoding - an optional encoding, relevant is val is a string -// - dir - true for indexOf, false for lastIndexOf -function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { - // Empty buffer means no match - if (buffer.length === 0) return -1 - - // Normalize byteOffset - if (typeof byteOffset === 'string') { - encoding = byteOffset - byteOffset = 0 - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000 - } - byteOffset = +byteOffset // Coerce to Number. - if (isNaN(byteOffset)) { - // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer - byteOffset = dir ? 0 : (buffer.length - 1) - } - - // Normalize byteOffset: negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = buffer.length + byteOffset - if (byteOffset >= buffer.length) { - if (dir) return -1 - else byteOffset = buffer.length - 1 - } else if (byteOffset < 0) { - if (dir) byteOffset = 0 - else return -1 - } - - // Normalize val - if (typeof val === 'string') { - val = Buffer.from(val, encoding) - } - - // Finally, search either indexOf (if dir is true) or lastIndexOf - if (Buffer.isBuffer(val)) { - // Special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(buffer, val, byteOffset, encoding, dir) - } else if (typeof val === 'number') { - val = val & 0xFF // Search for a byte value [0-255] - if (Buffer.TYPED_ARRAY_SUPPORT && - typeof Uint8Array.prototype.indexOf === 'function') { - if (dir) { - return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) - } else { - return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) - } - } - return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) - } - - throw new TypeError('val must be string, number or Buffer') -} - -function arrayIndexOf (arr, val, byteOffset, encoding, dir) { - var indexSize = 1 - var arrLength = arr.length - var valLength = val.length - - if (encoding !== undefined) { - encoding = String(encoding).toLowerCase() - if (encoding === 'ucs2' || encoding === 'ucs-2' || - encoding === 'utf16le' || encoding === 'utf-16le') { - if (arr.length < 2 || val.length < 2) { - return -1 - } - indexSize = 2 - arrLength /= 2 - valLength /= 2 - byteOffset /= 2 - } - } - - function read (buf, i) { - if (indexSize === 1) { - return buf[i] - } else { - return buf.readUInt16BE(i * indexSize) - } - } - - var i - if (dir) { - var foundIndex = -1 - for (i = byteOffset; i < arrLength; i++) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex - foundIndex = -1 - } - } - } else { - if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength - for (i = byteOffset; i >= 0; i--) { - var found = true - for (var j = 0; j < valLength; j++) { - if (read(arr, i + j) !== read(val, j)) { - found = false - break - } - } - if (found) return i - } - } - - return -1 -} - -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 -} - -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, true) -} - -Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { - return bidirectionalIndexOf(this, val, byteOffset, encoding, false) -} - -function hexWrite (buf, string, offset, length) { - offset = Number(offset) || 0 - var remaining = buf.length - offset - if (!length) { - length = remaining - } else { - length = Number(length) - if (length > remaining) { - length = remaining - } - } - - // must be an even number of digits - var strLen = string.length - if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') - - if (length > strLen / 2) { - length = strLen / 2 - } - for (var i = 0; i < length; ++i) { - var parsed = parseInt(string.substr(i * 2, 2), 16) - if (isNaN(parsed)) return i - buf[offset + i] = parsed - } - return i -} - -function utf8Write (buf, string, offset, length) { - return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) -} - -function asciiWrite (buf, string, offset, length) { - return blitBuffer(asciiToBytes(string), buf, offset, length) -} - -function latin1Write (buf, string, offset, length) { - return asciiWrite(buf, string, offset, length) -} - -function base64Write (buf, string, offset, length) { - return blitBuffer(base64ToBytes(string), buf, offset, length) -} - -function ucs2Write (buf, string, offset, length) { - return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) -} - -Buffer.prototype.write = function write (string, offset, length, encoding) { - // Buffer#write(string) - if (offset === undefined) { - encoding = 'utf8' - length = this.length - offset = 0 - // Buffer#write(string, encoding) - } else if (length === undefined && typeof offset === 'string') { - encoding = offset - length = this.length - offset = 0 - // Buffer#write(string, offset[, length][, encoding]) - } else if (isFinite(offset)) { - offset = offset | 0 - if (isFinite(length)) { - length = length | 0 - if (encoding === undefined) encoding = 'utf8' - } else { - encoding = length - length = undefined - } - // legacy write(string, encoding, offset, length) - remove in v0.13 - } else { - throw new Error( - 'Buffer.write(string, encoding, offset[, length]) is no longer supported' - ) - } - - var remaining = this.length - offset - if (length === undefined || length > remaining) length = remaining - - if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { - throw new RangeError('Attempt to write outside buffer bounds') - } - - if (!encoding) encoding = 'utf8' - - var loweredCase = false - for (;;) { - switch (encoding) { - case 'hex': - return hexWrite(this, string, offset, length) - - case 'utf8': - case 'utf-8': - return utf8Write(this, string, offset, length) - - case 'ascii': - return asciiWrite(this, string, offset, length) - - case 'latin1': - case 'binary': - return latin1Write(this, string, offset, length) - - case 'base64': - // Warning: maxLength not taken into account in base64Write - return base64Write(this, string, offset, length) - - case 'ucs2': - case 'ucs-2': - case 'utf16le': - case 'utf-16le': - return ucs2Write(this, string, offset, length) - - default: - if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) - encoding = ('' + encoding).toLowerCase() - loweredCase = true - } - } -} - -Buffer.prototype.toJSON = function toJSON () { - return { - type: 'Buffer', - data: Array.prototype.slice.call(this._arr || this, 0) - } -} - -function base64Slice (buf, start, end) { - if (start === 0 && end === buf.length) { - return base64.fromByteArray(buf) - } else { - return base64.fromByteArray(buf.slice(start, end)) - } -} - -function utf8Slice (buf, start, end) { - end = Math.min(buf.length, end) - var res = [] - - var i = start - while (i < end) { - var firstByte = buf[i] - var codePoint = null - var bytesPerSequence = (firstByte > 0xEF) ? 4 - : (firstByte > 0xDF) ? 3 - : (firstByte > 0xBF) ? 2 - : 1 - - if (i + bytesPerSequence <= end) { - var secondByte, thirdByte, fourthByte, tempCodePoint - - switch (bytesPerSequence) { - case 1: - if (firstByte < 0x80) { - codePoint = firstByte - } - break - case 2: - secondByte = buf[i + 1] - if ((secondByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) - if (tempCodePoint > 0x7F) { - codePoint = tempCodePoint - } - } - break - case 3: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) - if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { - codePoint = tempCodePoint - } - } - break - case 4: - secondByte = buf[i + 1] - thirdByte = buf[i + 2] - fourthByte = buf[i + 3] - if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { - tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) - if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { - codePoint = tempCodePoint - } - } - } - } - - if (codePoint === null) { - // we did not generate a valid codePoint so insert a - // replacement char (U+FFFD) and advance only 1 byte - codePoint = 0xFFFD - bytesPerSequence = 1 - } else if (codePoint > 0xFFFF) { - // encode to utf16 (surrogate pair dance) - codePoint -= 0x10000 - res.push(codePoint >>> 10 & 0x3FF | 0xD800) - codePoint = 0xDC00 | codePoint & 0x3FF - } - - res.push(codePoint) - i += bytesPerSequence - } - - return decodeCodePointsArray(res) -} - -// Based on http://stackoverflow.com/a/22747272/680742, the browser with -// the lowest limit is Chrome, with 0x10000 args. -// We go 1 magnitude less, for safety -var MAX_ARGUMENTS_LENGTH = 0x1000 - -function decodeCodePointsArray (codePoints) { - var len = codePoints.length - if (len <= MAX_ARGUMENTS_LENGTH) { - return String.fromCharCode.apply(String, codePoints) // avoid extra slice() - } - - // Decode in chunks to avoid "call stack size exceeded". - var res = '' - var i = 0 - while (i < len) { - res += String.fromCharCode.apply( - String, - codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) - ) - } - return res -} - -function asciiSlice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i] & 0x7F) - } - return ret -} - -function latin1Slice (buf, start, end) { - var ret = '' - end = Math.min(buf.length, end) - - for (var i = start; i < end; ++i) { - ret += String.fromCharCode(buf[i]) - } - return ret -} - -function hexSlice (buf, start, end) { - var len = buf.length - - if (!start || start < 0) start = 0 - if (!end || end < 0 || end > len) end = len - - var out = '' - for (var i = start; i < end; ++i) { - out += toHex(buf[i]) - } - return out -} - -function utf16leSlice (buf, start, end) { - var bytes = buf.slice(start, end) - var res = '' - for (var i = 0; i < bytes.length; i += 2) { - res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) - } - return res -} - -Buffer.prototype.slice = function slice (start, end) { - var len = this.length - start = ~~start - end = end === undefined ? len : ~~end - - if (start < 0) { - start += len - if (start < 0) start = 0 - } else if (start > len) { - start = len - } - - if (end < 0) { - end += len - if (end < 0) end = 0 - } else if (end > len) { - end = len - } - - if (end < start) end = start - - var newBuf - if (Buffer.TYPED_ARRAY_SUPPORT) { - newBuf = this.subarray(start, end) - newBuf.__proto__ = Buffer.prototype - } else { - var sliceLen = end - start - newBuf = new Buffer(sliceLen, undefined) - for (var i = 0; i < sliceLen; ++i) { - newBuf[i] = this[i + start] - } - } - - return newBuf -} - -/* - * Need to make sure that buffer isn't trying to write out of bounds. - */ -function checkOffset (offset, ext, length) { - if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') - if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') -} - -Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - - return val -} - -Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - checkOffset(offset, byteLength, this.length) - } - - var val = this[offset + --byteLength] - var mul = 1 - while (byteLength > 0 && (mul *= 0x100)) { - val += this[offset + --byteLength] * mul - } - - return val -} - -Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - return this[offset] -} - -Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return this[offset] | (this[offset + 1] << 8) -} - -Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - return (this[offset] << 8) | this[offset + 1] -} - -Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return ((this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16)) + - (this[offset + 3] * 0x1000000) -} - -Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] * 0x1000000) + - ((this[offset + 1] << 16) | - (this[offset + 2] << 8) | - this[offset + 3]) -} - -Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var val = this[offset] - var mul = 1 - var i = 0 - while (++i < byteLength && (mul *= 0x100)) { - val += this[offset + i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) checkOffset(offset, byteLength, this.length) - - var i = byteLength - var mul = 1 - var val = this[offset + --i] - while (i > 0 && (mul *= 0x100)) { - val += this[offset + --i] * mul - } - mul *= 0x80 - - if (val >= mul) val -= Math.pow(2, 8 * byteLength) - - return val -} - -Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { - if (!noAssert) checkOffset(offset, 1, this.length) - if (!(this[offset] & 0x80)) return (this[offset]) - return ((0xff - this[offset] + 1) * -1) -} - -Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset] | (this[offset + 1] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 2, this.length) - var val = this[offset + 1] | (this[offset] << 8) - return (val & 0x8000) ? val | 0xFFFF0000 : val -} - -Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset]) | - (this[offset + 1] << 8) | - (this[offset + 2] << 16) | - (this[offset + 3] << 24) -} - -Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - - return (this[offset] << 24) | - (this[offset + 1] << 16) | - (this[offset + 2] << 8) | - (this[offset + 3]) -} - -Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, true, 23, 4) -} - -Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 4, this.length) - return ieee754.read(this, offset, false, 23, 4) -} - -Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, true, 52, 8) -} - -Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { - if (!noAssert) checkOffset(offset, 8, this.length) - return ieee754.read(this, offset, false, 52, 8) -} - -function checkInt (buf, value, offset, ext, max, min) { - if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') - if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') - if (offset + ext > buf.length) throw new RangeError('Index out of range') -} - -Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var mul = 1 - var i = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - byteLength = byteLength | 0 - if (!noAssert) { - var maxBytes = Math.pow(2, 8 * byteLength) - 1 - checkInt(this, value, offset, byteLength, maxBytes, 0) - } - - var i = byteLength - 1 - var mul = 1 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - this[offset + i] = (value / mul) & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - this[offset] = (value & 0xff) - return offset + 1 -} - -function objectWriteUInt16 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { - buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> - (littleEndian ? i : 1 - i) * 8 - } -} - -Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) - } - return offset + 2 -} - -Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} - -function objectWriteUInt32 (buf, value, offset, littleEndian) { - if (value < 0) value = 0xffffffff + value + 1 - for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { - buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff - } -} - -Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset + 3] = (value >>> 24) - this[offset + 2] = (value >>> 16) - this[offset + 1] = (value >>> 8) - this[offset] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, true) - } - return offset + 4 -} - -Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) - } - return offset + 4 -} - -Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = 0 - var mul = 1 - var sub = 0 - this[offset] = value & 0xFF - while (++i < byteLength && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) { - var limit = Math.pow(2, 8 * byteLength - 1) - - checkInt(this, value, offset, byteLength, limit - 1, -limit) - } - - var i = byteLength - 1 - var mul = 1 - var sub = 0 - this[offset + i] = value & 0xFF - while (--i >= 0 && (mul *= 0x100)) { - if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { - sub = 1 - } - this[offset + i] = ((value / mul) >> 0) - sub & 0xFF - } - - return offset + byteLength -} - -Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) - if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) - if (value < 0) value = 0xff + value + 1 - this[offset] = (value & 0xff) - return offset + 1 -} - -Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - } else { - objectWriteUInt16(this, value, offset, true) - } - return offset + 2 -} - -Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 8) - this[offset + 1] = (value & 0xff) - } else { - objectWriteUInt16(this, value, offset, false) - } - return offset + 2 -} - -Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value & 0xff) - this[offset + 1] = (value >>> 8) - this[offset + 2] = (value >>> 16) - this[offset + 3] = (value >>> 24) - } else { - objectWriteUInt32(this, value, offset, true) - } - return offset + 4 -} - -Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { - value = +value - offset = offset | 0 - if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) - if (value < 0) value = 0xffffffff + value + 1 - if (Buffer.TYPED_ARRAY_SUPPORT) { - this[offset] = (value >>> 24) - this[offset + 1] = (value >>> 16) - this[offset + 2] = (value >>> 8) - this[offset + 3] = (value & 0xff) - } else { - objectWriteUInt32(this, value, offset, false) - } - return offset + 4 -} - -function checkIEEE754 (buf, value, offset, ext, max, min) { - if (offset + ext > buf.length) throw new RangeError('Index out of range') - if (offset < 0) throw new RangeError('Index out of range') -} - -function writeFloat (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) - } - ieee754.write(buf, value, offset, littleEndian, 23, 4) - return offset + 4 -} - -Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { - return writeFloat(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { - return writeFloat(this, value, offset, false, noAssert) -} - -function writeDouble (buf, value, offset, littleEndian, noAssert) { - if (!noAssert) { - checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) - } - ieee754.write(buf, value, offset, littleEndian, 52, 8) - return offset + 8 -} - -Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { - return writeDouble(this, value, offset, true, noAssert) -} - -Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { - return writeDouble(this, value, offset, false, noAssert) -} - -// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) -Buffer.prototype.copy = function copy (target, targetStart, start, end) { - if (!start) start = 0 - if (!end && end !== 0) end = this.length - if (targetStart >= target.length) targetStart = target.length - if (!targetStart) targetStart = 0 - if (end > 0 && end < start) end = start - - // Copy 0 bytes; we're done - if (end === start) return 0 - if (target.length === 0 || this.length === 0) return 0 - - // Fatal error conditions - if (targetStart < 0) { - throw new RangeError('targetStart out of bounds') - } - if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') - if (end < 0) throw new RangeError('sourceEnd out of bounds') - - // Are we oob? - if (end > this.length) end = this.length - if (target.length - targetStart < end - start) { - end = target.length - targetStart + start - } - - var len = end - start - var i - - if (this === target && start < targetStart && targetStart < end) { - // descending copy from end - for (i = len - 1; i >= 0; --i) { - target[i + targetStart] = this[i + start] - } - } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { - // ascending copy from start - for (i = 0; i < len; ++i) { - target[i + targetStart] = this[i + start] - } - } else { - Uint8Array.prototype.set.call( - target, - this.subarray(start, start + len), - targetStart - ) - } - - return len -} - -// Usage: -// buffer.fill(number[, offset[, end]]) -// buffer.fill(buffer[, offset[, end]]) -// buffer.fill(string[, offset[, end]][, encoding]) -Buffer.prototype.fill = function fill (val, start, end, encoding) { - // Handle string cases: - if (typeof val === 'string') { - if (typeof start === 'string') { - encoding = start - start = 0 - end = this.length - } else if (typeof end === 'string') { - encoding = end - end = this.length - } - if (val.length === 1) { - var code = val.charCodeAt(0) - if (code < 256) { - val = code - } - } - if (encoding !== undefined && typeof encoding !== 'string') { - throw new TypeError('encoding must be a string') - } - if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { - throw new TypeError('Unknown encoding: ' + encoding) - } - } else if (typeof val === 'number') { - val = val & 255 - } - - // Invalid ranges are not set to a default, so can range check early. - if (start < 0 || this.length < start || this.length < end) { - throw new RangeError('Out of range index') - } - - if (end <= start) { - return this - } - - start = start >>> 0 - end = end === undefined ? this.length : end >>> 0 - - if (!val) val = 0 - - var i - if (typeof val === 'number') { - for (i = start; i < end; ++i) { - this[i] = val - } - } else { - var bytes = Buffer.isBuffer(val) - ? val - : utf8ToBytes(new Buffer(val, encoding).toString()) - var len = bytes.length - for (i = 0; i < end - start; ++i) { - this[i + start] = bytes[i % len] - } - } - - return this -} - -// HELPER FUNCTIONS -// ================ - -var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g - -function base64clean (str) { - // Node strips out invalid characters like \n and \t from the string, base64-js does not - str = stringtrim(str).replace(INVALID_BASE64_RE, '') - // Node converts strings with length < 2 to '' - if (str.length < 2) return '' - // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not - while (str.length % 4 !== 0) { - str = str + '=' - } - return str -} - -function stringtrim (str) { - if (str.trim) return str.trim() - return str.replace(/^\s+|\s+$/g, '') -} - -function toHex (n) { - if (n < 16) return '0' + n.toString(16) - return n.toString(16) -} - -function utf8ToBytes (string, units) { - units = units || Infinity - var codePoint - var length = string.length - var leadSurrogate = null - var bytes = [] - - for (var i = 0; i < length; ++i) { - codePoint = string.charCodeAt(i) - - // is surrogate component - if (codePoint > 0xD7FF && codePoint < 0xE000) { - // last char was a lead - if (!leadSurrogate) { - // no lead yet - if (codePoint > 0xDBFF) { - // unexpected trail - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } else if (i + 1 === length) { - // unpaired lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - continue - } - - // valid lead - leadSurrogate = codePoint - - continue - } - - // 2 leads in a row - if (codePoint < 0xDC00) { - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - leadSurrogate = codePoint - continue - } - - // valid surrogate pair - codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 - } else if (leadSurrogate) { - // valid bmp char, but last char was a lead - if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) - } - - leadSurrogate = null - - // encode utf8 - if (codePoint < 0x80) { - if ((units -= 1) < 0) break - bytes.push(codePoint) - } else if (codePoint < 0x800) { - if ((units -= 2) < 0) break - bytes.push( - codePoint >> 0x6 | 0xC0, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x10000) { - if ((units -= 3) < 0) break - bytes.push( - codePoint >> 0xC | 0xE0, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else if (codePoint < 0x110000) { - if ((units -= 4) < 0) break - bytes.push( - codePoint >> 0x12 | 0xF0, - codePoint >> 0xC & 0x3F | 0x80, - codePoint >> 0x6 & 0x3F | 0x80, - codePoint & 0x3F | 0x80 - ) - } else { - throw new Error('Invalid code point') - } - } - - return bytes -} - -function asciiToBytes (str) { - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - // Node's code seems to be doing this and not & 0x7F.. - byteArray.push(str.charCodeAt(i) & 0xFF) - } - return byteArray -} - -function utf16leToBytes (str, units) { - var c, hi, lo - var byteArray = [] - for (var i = 0; i < str.length; ++i) { - if ((units -= 2) < 0) break - - c = str.charCodeAt(i) - hi = c >> 8 - lo = c % 256 - byteArray.push(lo) - byteArray.push(hi) - } - - return byteArray -} - -function base64ToBytes (str) { - return base64.toByteArray(base64clean(str)) -} - -function blitBuffer (src, dst, offset, length) { - for (var i = 0; i < length; ++i) { - if ((i + offset >= dst.length) || (i >= src.length)) break - dst[i + offset] = src[i] - } - return i -} - -function isnan (val) { - return val !== val // eslint-disable-line no-self-compare -} - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(64))) - -/***/ }), -/* 91 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.byteLength = byteLength -exports.toByteArray = toByteArray -exports.fromByteArray = fromByteArray - -var lookup = [] -var revLookup = [] -var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array - -var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' -for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i -} - -revLookup['-'.charCodeAt(0)] = 62 -revLookup['_'.charCodeAt(0)] = 63 - -function placeHoldersCount (b64) { - var len = b64.length - if (len % 4 > 0) { - throw new Error('Invalid string. Length must be a multiple of 4') - } - - // the number of equal signs (place holders) - // if there are two placeholders, than the two characters before it - // represent one byte - // if there is only one, then the three characters before it represent 2 bytes - // this is just a cheap hack to not do indexOf twice - return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 -} - -function byteLength (b64) { - // base64 is 4/3 + up to two characters of the original data - return b64.length * 3 / 4 - placeHoldersCount(b64) -} - -function toByteArray (b64) { - var i, j, l, tmp, placeHolders, arr - var len = b64.length - placeHolders = placeHoldersCount(b64) - - arr = new Arr(len * 3 / 4 - placeHolders) - - // if there are placeholders, only get up to the last complete 4 chars - l = placeHolders > 0 ? len - 4 : len - - var L = 0 - - for (i = 0, j = 0; i < l; i += 4, j += 3) { - tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)] - arr[L++] = (tmp >> 16) & 0xFF - arr[L++] = (tmp >> 8) & 0xFF - arr[L++] = tmp & 0xFF - } - - if (placeHolders === 2) { - tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4) - arr[L++] = tmp & 0xFF - } else if (placeHolders === 1) { - tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2) - arr[L++] = (tmp >> 8) & 0xFF - arr[L++] = tmp & 0xFF - } - - return arr -} - -function tripletToBase64 (num) { - return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F] -} - -function encodeChunk (uint8, start, end) { - var tmp - var output = [] - for (var i = start; i < end; i += 3) { - tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) - output.push(tripletToBase64(tmp)) - } - return output.join('') -} - -function fromByteArray (uint8) { - var tmp - var len = uint8.length - var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes - var output = '' - var parts = [] - var maxChunkLength = 16383 // must be multiple of 3 - - // go through the array every three bytes, we'll deal with trailing stuff later - for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { - parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength))) - } - - // pad the end with zeros, but make sure to not forget the extra bytes - if (extraBytes === 1) { - tmp = uint8[len - 1] - output += lookup[tmp >> 2] - output += lookup[(tmp << 4) & 0x3F] - output += '==' - } else if (extraBytes === 2) { - tmp = (uint8[len - 2] << 8) + (uint8[len - 1]) - output += lookup[tmp >> 10] - output += lookup[(tmp >> 4) & 0x3F] - output += lookup[(tmp << 2) & 0x3F] - output += '=' - } - - parts.push(output) - - return parts.join('') -} - - -/***/ }), -/* 92 */ -/***/ (function(module, exports) { - -exports.read = function (buffer, offset, isLE, mLen, nBytes) { - var e, m - var eLen = nBytes * 8 - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var nBits = -7 - var i = isLE ? (nBytes - 1) : 0 - var d = isLE ? -1 : 1 - var s = buffer[offset + i] - - i += d - - e = s & ((1 << (-nBits)) - 1) - s >>= (-nBits) - nBits += eLen - for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - m = e & ((1 << (-nBits)) - 1) - e >>= (-nBits) - nBits += mLen - for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} - - if (e === 0) { - e = 1 - eBias - } else if (e === eMax) { - return m ? NaN : ((s ? -1 : 1) * Infinity) - } else { - m = m + Math.pow(2, mLen) - e = e - eBias - } - return (s ? -1 : 1) * m * Math.pow(2, e - mLen) -} - -exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { - var e, m, c - var eLen = nBytes * 8 - mLen - 1 - var eMax = (1 << eLen) - 1 - var eBias = eMax >> 1 - var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) - var i = isLE ? 0 : (nBytes - 1) - var d = isLE ? 1 : -1 - var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 - - value = Math.abs(value) - - if (isNaN(value) || value === Infinity) { - m = isNaN(value) ? 1 : 0 - e = eMax - } else { - e = Math.floor(Math.log(value) / Math.LN2) - if (value * (c = Math.pow(2, -e)) < 1) { - e-- - c *= 2 - } - if (e + eBias >= 1) { - value += rt / c - } else { - value += rt * Math.pow(2, 1 - eBias) - } - if (value * c >= 2) { - e++ - c /= 2 - } - - if (e + eBias >= eMax) { - m = 0 - e = eMax - } else if (e + eBias >= 1) { - m = (value * c - 1) * Math.pow(2, mLen) - e = e + eBias - } else { - m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) - e = 0 - } - } - - for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} - - e = (e << mLen) | m - eLen += mLen - for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} - - buffer[offset + i - d] |= s * 128 -} - - -/***/ }), -/* 93 */ -/***/ (function(module, exports) { - -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; - - -/***/ }), -/* 94 */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// resolves . and .. elements in a path array with directory names there -// must be no slashes, empty elements, or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Split a filename into [root, dir, basename, ext], unix version -// 'root' is just a slash, or nothing. -var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; -var splitPath = function(filename) { - return splitPathRe.exec(filename).slice(1); -}; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { - var resolvedPath = '', - resolvedAbsolute = false; - - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) ? arguments[i] : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - - // At this point the path should be resolved to a full absolute path, but - // handle relative paths to be safe (might happen when process.cwd() fails) - - // Normalize the path - resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { - var isAbsolute = exports.isAbsolute(path), - trailingSlash = substr(path, -1) === '/'; - - // Normalize the path - path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - -// posix version -exports.isAbsolute = function(path) { - return path.charAt(0) === '/'; -}; - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - if (typeof p !== 'string') { - throw new TypeError('Arguments to path.join must be strings'); - } - return p; - }).join('/')); -}; - - -// path.relative(from, to) -// posix version -exports.relative = function(from, to) { - from = exports.resolve(from).substr(1); - to = exports.resolve(to).substr(1); - - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - - return outputParts.join('/'); -}; - -exports.sep = '/'; -exports.delimiter = ':'; - -exports.dirname = function(path) { - var result = splitPath(path), - root = result[0], - dir = result[1]; - - if (!root && !dir) { - // No dirname whatsoever - return '.'; - } - - if (dir) { - // It has a dirname, strip trailing slash - dir = dir.substr(0, dir.length - 1); - } - - return root + dir; -}; - - -exports.basename = function(path, ext) { - var f = splitPath(path)[2]; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPath(path)[3]; -}; - -function filter (xs, f) { - if (xs.filter) return xs.filter(f); - var res = []; - for (var i = 0; i < xs.length; i++) { - if (f(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// String.prototype.substr - negative index don't work in IE8 -var substr = 'ab'.substr(-1) === 'b' - ? function (str, start, len) { return str.substr(start, len) } - : function (str, start, len) { - if (start < 0) start = str.length + start; - return str.substr(start, len); - } -; - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(95))) - -/***/ }), -/* 95 */ -/***/ (function(module, exports) { - -// shim for using process in browser -var process = module.exports = {}; - -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. - -var cachedSetTimeout; -var cachedClearTimeout; - -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); -} -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); -} -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } - - -} -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } - - - -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = runTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - runClearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }) -/******/ ]); diff --git a/test-web/tests.html b/test-web/tests.html deleted file mode 100644 index 0b14d34..0000000 --- a/test-web/tests.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Postal codes tests - - - - -
-
- - - - - - \ No newline at end of file diff --git a/test-web/webpack.config.js b/test-web/webpack.config.js deleted file mode 100644 index 0f19ca1..0000000 --- a/test-web/webpack.config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - entry: "../test/validationTests.js", - output: { - path: __dirname, - filename: "bundle-tests.js" - }, - module: { - loaders: [ - - ] - } -}; \ No newline at end of file diff --git a/test/formats-web-tests.js b/test/formats-web-tests.js deleted file mode 100644 index bd96a46..0000000 --- a/test/formats-web-tests.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const formatsWeb = require('../formats-web'); -const expect = require('chai').expect; - -describe('formats-web.js', function () { - - const formatsDirectory = path.join(__dirname, '..', 'formats'); - fs.readdir(formatsDirectory, function (err, files) { - if (err) { - throw new Error('Unable to list files in formats directory'); - } - - files.forEach(function(filename) { - it(`should require ${filename}`, function() { - expect(formatsWeb(filename)).to.be.ok; - }); - }); - }); - -}); diff --git a/test/validationTests.js b/test/validationTests.js deleted file mode 100644 index b7edecf..0000000 --- a/test/validationTests.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict'; - -const postalCodes = require('../postal-codes.js'); -const expect = require('chai').expect; - -describe('Postal codes validation: ', function () { - - const countriesData = require('../generated/postal-codes-alpha2'); - Object.keys(countriesData).map(function (alpha2Code) { - - var formatFileName = countriesData[alpha2Code].postalCodeFormat; - if ( !formatFileName ) { - console.log('Cannot find format file for ' + alpha2Code); - return; - } - - const format = require('../formats/' + formatFileName); - format.TestData.Valid.map(function (validPostalCode) { - it(alpha2Code + ' / ' + validPostalCode + ' is valid', function () { - expect(postalCodes.validate(alpha2Code, validPostalCode)).to.be.true; - }) - }); - - format.TestData.Invalid.map(function (invalidPostalCode) { - it(alpha2Code + ' / ' + invalidPostalCode + ' is NOT valid', function () { - expect(postalCodes.validate(alpha2Code, invalidPostalCode)).to.not.be.true; - }) - }); - }); -}); - -describe('Postal codes border cases: ', function () { - const testCases = [ - { - countryCode: null, - postalCode: 1234, - description: 'should return error when country code is null', - expectedResult: 'Missing country code.' - }, - { - countryCode: undefined, - postalCode: 1234, - description: 'should return error when country code is undefined', - expectedResult: 'Missing country code.' - }, - { - countryCode: 'us', - postalCode: null, - description: 'should return error when postal code is null', - expectedResult: 'Missing postal code.' - }, - { - countryCode: 'gb', - postalCode: undefined, - description: 'should return error when postal code is undefined', - expectedResult: 'Missing postal code.' - }, - { - countryCode: 'chf', - postalCode: 8001, - description: 'should return false when country code is unknown', - expectedResult: 'Unknown alpha2/alpha3 country code: CHF' - }, - { - countryCode: 'ch', - postalCode: '80010', - description: 'should return false when postal code is invalid', - expectedResult: "Postal code 80010 is not valid for country CH" - }, - { - countryCode: 'ch', - postalCode: '8001', - description: 'should return true when postal code is valid string', - expectedResult: true - }, - { - countryCode: 'ch', - postalCode: 8001, - description: 'should return true when postal code is valid number', - expectedResult: true - }, - { - countryCode: ' us ', - postalCode: ' 98001 ', - description: 'should trim white spaces in input', - expectedResult: true - }, - { - countryCode: 'HK', - postalCode: 'Hong Kong', - description: 'should return true all the time because it does not use postal codes', - expectedResult: true - } - ]; - - testCases.forEach(function (test) { - it(`${test.description}`, function () { - expect(postalCodes.validate(test.countryCode, test.postalCode)).to.equal(test.expectedResult); - }); - }); -}); \ No newline at end of file From 3a3069013f64c9654a42ad4ca39e9a1e0642b757 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Thu, 24 Sep 2020 16:37:03 +0200 Subject: [PATCH 07/24] Restore args validation --- src/index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 6585d75..bdf2303 100644 --- a/src/index.js +++ b/src/index.js @@ -8,11 +8,20 @@ const lookup = require('../data/lookup.json'); * @return {boolean} */ module.exports.validate = function (countryCode, postalCode) { + if (!countryCode) { + throw new Error('Missing country code.'); + } + + if (!postalCode) { + throw new Error('Missing postal code.'); + } + + const key = countryCode.trim().toUpperCase(); const index = lookup[key]; if (index === undefined) { - throw new Error(`No data for [${countryCode}]`); + throw new Error(`No data for [${countryCode}].`); } const country = countries[index]; From 8e524efb651a20f077ea664f3280026347c2108a Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Thu, 24 Sep 2020 16:44:33 +0200 Subject: [PATCH 08/24] Update README.md --- README.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index f277a67..b802e98 100644 --- a/README.md +++ b/README.md @@ -7,17 +7,17 @@ Provides javascript postal code validation for [all countries](https://en.wikip ### Validation rules -1. Characters " " (space) and "-" (dash) are removed from the input string. -2. Input is case insensitive. -3. Supports both [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) and [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country codes. -4. Validates optional n-digit extention seperated by a space or hyphen. +1. Characters " " (space) and "-" (dash) are removed from the input string, if the postal code format allowes it. +2. Input is case-insensitive. +3. Supports ISO 3166-1 [alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2), [alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) and [numeric-3](https://en.wikipedia.org/wiki/ISO_3166-1_numeric) country codes. +4. Validates optional n-digit extension separated by a space or hyphen. ### Usage ``` const postalCodes = require('postal-codes-js'); -const countryCode = 'CH'; // ISO 3166-1 alpha-2 or alpha-3 country code as string. +const countryCode = 'CH'; // ISO 3166-1 alpha-2, alpha-3 or numeric-3 country code as string. const postalCode = '8008'; // Postal code as string or number. -postalCodes.validate(countryCode, postalCode); // Returns 'true' if valid, error message as string otherwise. +postalCodes.validate(countryCode, postalCode); // Returns true if valid, false otherwise. // All the calls below returns true postalCodes.validate('bg', '1003'); @@ -32,15 +32,19 @@ postalCodes.validate('TUR', '33150'); postalCodes.validate('us', '22313'); postalCodes.validate('USA', '91746-2302'); -// All the calls below return a string +// All the calls below return false postalCodes.validate('UK', 'EC1A 1BB'); - > Unknown alpha2/alpha3 country code: UK + > false postalCodes.validate('PL', '9999'); - > Postal code 9999 is not valid for country PL + > false +// Invalid input throws an error. postalCodes.validate('CH'); - > Missing postal code. + > Uncaught Error: Missing postal code. + +postalCodes.validate('nope', '1234'); + > Uncaught Error: No data for [nope]. ``` ### Testing with mocha From 2a74c07231f478963c9b68eb5bc7bf7bd213eab7 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 08:56:00 +0200 Subject: [PATCH 09/24] Add tests --- test/validation.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 test/validation.js diff --git a/test/validation.js b/test/validation.js new file mode 100644 index 0000000..ce77326 --- /dev/null +++ b/test/validation.js @@ -0,0 +1,28 @@ +const postalCodes = require('../src/index'); +const expect = require('chai').expect; + +describe('Postal codes validation: ', function () { + + const countries = require('../data/countries.json'); + const tests = require('../data/tests.json'); + + Object.values(countries).forEach(function (country) { + if (country.postalCodeFormat === false) { + return; + } + + const data = tests[country.postalCodeFormat]; + + data.valid.forEach(function (validPostalCode) { + it(country.alpha2 + ' / ' + validPostalCode + ' is valid', function () { + expect(postalCodes.validate(country.alpha2, validPostalCode)).to.be.true; + }) + }); + + data.invalid.forEach(function (invalidPostalCode) { + it(country.alpha2 + ' / ' + invalidPostalCode + ' is valid', function () { + expect(postalCodes.validate(country.alpha2, invalidPostalCode)).to.be.false; + }) + }); + }); +}); From 28c0a6d87512c8cde8479ce4b7515e1725787164 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 08:56:42 +0200 Subject: [PATCH 10/24] Remove invalid test data --- data/tests.json | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/data/tests.json b/data/tests.json index 8d6b917..a23b11d 100644 --- a/data/tests.json +++ b/data/tests.json @@ -208,8 +208,7 @@ "1125DK", "DK12345", "DK123", - "123", - "" + "123" ] }, "FK": { @@ -429,8 +428,7 @@ "1125L", "L12345", "L123", - "123", - "" + "123" ] }, "LV": { @@ -749,4 +747,4 @@ "WS-12345" ] } -} \ No newline at end of file +} From ea56b4dd06ce5ac53ad788f68b614800194bcdec Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 08:56:52 +0200 Subject: [PATCH 11/24] Fix redundant chars --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index bdf2303..436bd35 100644 --- a/src/index.js +++ b/src/index.js @@ -33,7 +33,7 @@ module.exports.validate = function (countryCode, postalCode) { const format = formats[country.postalCodeFormat]; const validationRegex = new RegExp(format.validationRegex, 'i'); - const redundantChars = new RegExp(`[${formats}]`, 'g'); + const redundantChars = new RegExp(`[${format.redundantCharacters}]`, 'g'); const preparedPostalCode = postalCode.toString().trim().replace(redundantChars, ''); return validationRegex.test(preparedPostalCode); From 0f5c0ab93c519f5c61a57d37d84b5d2915b5c3ff Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 09:13:58 +0200 Subject: [PATCH 12/24] Test countrys without postal codes --- test/validation.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/validation.js b/test/validation.js index ce77326..c6f2e42 100644 --- a/test/validation.js +++ b/test/validation.js @@ -8,6 +8,9 @@ describe('Postal codes validation: ', function () { Object.values(countries).forEach(function (country) { if (country.postalCodeFormat === false) { + it(country.alpha2 + ' is valid', function () { + expect(postalCodes.validate(country.alpha2, 'abc')).to.be.true; + }); return; } From bbbbf30e544f2e16936fcf60ff04982f1fc44ba3 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 09:14:22 +0200 Subject: [PATCH 13/24] Add arguments tests --- src/index.js | 5 ++--- test/args.js | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 test/args.js diff --git a/src/index.js b/src/index.js index 436bd35..ba1d755 100644 --- a/src/index.js +++ b/src/index.js @@ -4,7 +4,7 @@ const lookup = require('../data/lookup.json'); /** * @param {string|number} countryCode - * @param {string} postalCode + * @param {string|number} postalCode * @return {boolean} */ module.exports.validate = function (countryCode, postalCode) { @@ -16,8 +16,7 @@ module.exports.validate = function (countryCode, postalCode) { throw new Error('Missing postal code.'); } - - const key = countryCode.trim().toUpperCase(); + const key = countryCode.toString().trim().toUpperCase(); const index = lookup[key]; if (index === undefined) { diff --git a/test/args.js b/test/args.js new file mode 100644 index 0000000..b1e4d51 --- /dev/null +++ b/test/args.js @@ -0,0 +1,37 @@ +const postalCodes = require('../src/index'); +const expect = require('chai').expect; + +describe('Argument validation:', function () { + it('throws when args are missing', function () { + expect(function () { + postalCodes.validate(undefined, '1234ab'); + }).to.throw('Missing country code.'); + + expect(function () { + postalCodes.validate('NL', undefined); + }).to.throw('Missing postal code.'); + }); + + it('throws for invalid countries', function () { + expect(function () { + postalCodes.validate('nope', '1234ab'); + }).to.throw('No data for [nope].'); + }); + + it('should accept different keys', function () { + expect(postalCodes.validate('NL', '1234ab')).to.be.true; + expect(postalCodes.validate('NLD', '1234ab')).to.be.true; + expect(postalCodes.validate('528', '1234ab')).to.be.true; + }); + + it('should normalize keys', function () { + expect(postalCodes.validate(' NL ', '1234ab')).to.be.true; + expect(postalCodes.validate('nlD', '1234ab')).to.be.true; + expect(postalCodes.validate(528, '1234ab')).to.be.true; + }); + + it('should normalize the postal codes', function () { + expect(postalCodes.validate('NL', ' 1234-ab ')).to.be.true; + expect(postalCodes.validate('NOR', 1234)).to.be.true; + }); +}); From f21f09a78e87af975a4c5e175c60bad005e80504 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 10:31:29 +0200 Subject: [PATCH 14/24] Fix istanbul for cross-platform --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 00c17b8..1d0d32d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Postal Codes", "main": "postal-codes.js", "scripts": { - "coverage": "istanbul cover _mocha -- -R spec", + "coverage": "istanbul cover node_modules/mocha/bin/mocha", "test": "mocha test" }, "repository": { From b668462c3c688439574896de1a3a476984096b21 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 11:24:33 +0200 Subject: [PATCH 15/24] Anchor & simplify GB regex --- data/formats.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/formats.json b/data/formats.json index 87a9346..ff9a697 100644 --- a/data/formats.json +++ b/data/formats.json @@ -81,7 +81,7 @@ }, "GB": { "redundantCharacters": " -", - "validationRegex": "((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([AZa-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))[0-9][A-Za-z]{2})|GIR0AA" + "validationRegex": "^((([A-Z][0-9]{1,2})|(([A-Z][A-HJ-Y][0-9]{1,2})|(([A-Z][0-9][A-Z])|([A-Z][A-HJ-Y][0-9]?[A-Z]))))[0-9][A-Z]{2})$|^GIR0AA$" }, "GF": { "redundantCharacters": " -", @@ -255,4 +255,4 @@ "redundantCharacters": " -", "validationRegex": "^(WS)?[0-9]{4}$" } -} \ No newline at end of file +} From bf27385cffb1be79fd0bdfd048b24450b4a23092 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 11:26:07 +0200 Subject: [PATCH 16/24] Update istanbul & mocha --- package-lock.json | 2328 +++++++++++++++++++++++++++++++++++++++------ package.json | 9 +- src/index.js | 2 - 3 files changed, 2026 insertions(+), 313 deletions(-) diff --git a/package-lock.json b/package-lock.json index 31028d5..bc6253b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,12 +4,314 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/core": { + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", + "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.6", + "@babel/helper-module-transforms": "^7.11.0", + "@babel/helpers": "^7.10.4", + "@babel/parser": "^7.11.5", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.11.5", + "@babel/types": "^7.11.5", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", + "dev": true, + "requires": { + "@babel/types": "^7.11.5", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz", + "integrity": "sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/helper-module-imports": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-module-transforms": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", + "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.4", + "@babel/helper-replace-supers": "^7.10.4", + "@babel/helper-simple-access": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/template": "^7.10.4", + "@babel/types": "^7.11.0", + "lodash": "^4.17.19" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", + "dev": true, + "requires": { + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-replace-supers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.10.4", + "@babel/helper-optimise-call-expression": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-simple-access": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", + "dev": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", + "dev": true, + "requires": { + "@babel/types": "^7.11.0" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, + "@babel/helpers": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", + "dev": true, + "requires": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", + "dev": true + }, + "@babel/template": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.10.4", + "@babel/types": "^7.10.4" + } + }, + "@babel/traverse": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.11.5", + "@babel/helper-function-name": "^7.10.4", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + }, + "dependencies": { + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "6.12.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", @@ -22,12 +324,51 @@ "uri-js": "^4.2.2" } }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "optional": true + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", + "dev": true, + "requires": { + "default-require-extensions": "^3.0.0" + } + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true }, "argparse": { "version": "1.0.10", @@ -38,6 +379,18 @@ "sprintf-js": "~1.0.2" } }, + "array.prototype.map": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array.prototype.map/-/array.prototype.map-1.0.2.tgz", + "integrity": "sha512-Az3OYxgsa1g7xDYp86l0nnN4bcmuEITGe1rbdEBVkrqkzMgDcbdQ2R7r41pNzti+4NMces3H8gMmuioZUilLgw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "es-array-method-boxes-properly": "^1.0.0", + "is-string": "^1.0.4" + } + }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -59,12 +412,6 @@ "integrity": "sha1-5gtrDo8wG9l+U3UhW9pAbIURjAs=", "dev": true }, - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -98,6 +445,12 @@ "tweetnacl": "^0.14.3" } }, + "binary-extensions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", + "dev": true + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -108,12 +461,39 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, + "caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "dev": true, + "requires": { + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", @@ -134,12 +514,88 @@ "type-detect": "^4.0.5" } }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, "check-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", "dev": true }, + "chokidar": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", + "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.4.0" + } + }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -149,12 +605,11 @@ "delayed-stream": "~1.0.0" } }, - "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha1-1YuytcHuj4ew00ACfp6U4iLFpCI=", - "dev": true, - "optional": true + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true }, "concat-map": { "version": "0.0.1", @@ -162,6 +617,23 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } + }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -181,6 +653,28 @@ "request": "^2.88.0" } }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -191,14 +685,20 @@ } }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", @@ -208,11 +708,23 @@ "type-detect": "^4.0.0" } }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", - "dev": true + "default-require-extensions": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", + "dev": true, + "requires": { + "strip-bom": "^4.0.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } }, "delayed-stream": { "version": "1.0.0", @@ -220,15 +732,10 @@ "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", "dev": true }, - "detect-node": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", - "integrity": "sha1-AU7o+PZpxcWAI9pkuBecCDooxGw=" - }, "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, "ecc-jsbn": { @@ -241,53 +748,83 @@ "safer-buffer": "^2.1.0" } }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "escodegen": { - "version": "1.8.1", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/escodegen/-/escodegen-1.8.1.tgz", - "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "es-abstract": { + "version": "1.17.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.6.tgz", + "integrity": "sha512-Fr89bON3WFyUi5EvAeI48QTWX0AyekGgLA8H+c+7fbfCkJwRWRMLd8CQedNEyJuoYYhmtEqY92pgte1FAhBlhw==", "dev": true, "requires": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.2.0" - }, - "dependencies": { - "esprima": { - "version": "2.7.3", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - } + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.0", + "is-regex": "^1.1.0", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" } }, - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=", + "es-array-method-boxes-properly": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz", + "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==", "dev": true }, - "estraverse": { - "version": "1.9.3", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", - "dev": true + "es-get-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/es-get-iterator/-/es-get-iterator-1.1.0.tgz", + "integrity": "sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ==", + "dev": true, + "requires": { + "es-abstract": "^1.17.4", + "has-symbols": "^1.0.1", + "is-arguments": "^1.0.4", + "is-map": "^2.0.1", + "is-set": "^2.0.1", + "is-string": "^1.0.5", + "isarray": "^2.0.5" + } }, - "esutils": { - "version": "2.0.2", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, - "extend": { - "version": "3.0.2", + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=", + "dev": true + }, + "extend": { + "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true @@ -310,11 +847,54 @@ "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", - "dev": true + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-cache-dir": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + } + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } }, "forever-agent": { "version": "0.6.1", @@ -333,18 +913,55 @@ "mime-types": "^2.1.12" } }, + "fromentries": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz", + "integrity": "sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==", + "dev": true + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, "get-func-name": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", "dev": true }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true + }, "getpass": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", @@ -354,45 +971,33 @@ "assert-plus": "^1.0.0" } }, - "glob": { - "version": "5.0.15", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "dev": true, "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "is-glob": "^4.0.1" } }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha1-8nNdwig2dPpnR4sQGBBZNVw2nl4=", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, - "handlebars": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", - "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", - "dev": true, - "requires": { - "neo-async": "^2.6.0", - "optimist": "^0.6.1", - "source-map": "^0.6.1", - "uglify-js": "^3.1.4" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", @@ -409,16 +1014,41 @@ "har-schema": "^2.0.0" } }, - "has-flag": { - "version": "1.0.0", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/has-flag/-/has-flag-1.0.0.tgz", - "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, + "hasha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + } + }, "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, "http-signature": { @@ -432,6 +1062,18 @@ "sshpk": "^1.7.0" } }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -445,7 +1087,116 @@ "inherits": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "dev": true + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==", + "dev": true + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.1.tgz", + "integrity": "sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-set": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-set/-/is-set-2.0.1.tgz", + "integrity": "sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA==", + "dev": true + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, + "is-string": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", + "integrity": "sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==", + "dev": true + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } }, "is-typedarray": { "version": "1.0.0", @@ -453,6 +1204,18 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "isarray": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", + "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "dev": true + }, "isexe": { "version": "2.0.0", "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/isexe/-/isexe-2.0.0.tgz", @@ -465,36 +1228,142 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, - "istanbul": { - "version": "0.4.5", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/istanbul/-/istanbul-0.4.5.tgz", - "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", - "dev": true, - "requires": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.8.x", - "esprima": "2.7.x", - "glob": "^5.0.15", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "dev": true, + "requires": { + "append-transform": "^2.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + } + }, + "istanbul-lib-processinfo": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.0", + "istanbul-lib-coverage": "^3.0.0-alpha.1", + "make-dir": "^3.0.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^3.3.3" + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" }, "dependencies": { - "esprima": { - "version": "2.7.3", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "iterate-iterator": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/iterate-iterator/-/iterate-iterator-1.0.1.tgz", + "integrity": "sha512-3Q6tudGN05kbkDQDI4CqjaBf4qf85w6W6GnuZDtUVYwKgtC1q8yxYX7CZed7N+tLzQqS6roujWvszf13T+n9aw==", + "dev": true + }, + "iterate-value": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/iterate-value/-/iterate-value-1.0.2.tgz", + "integrity": "sha512-A6fMAio4D2ot2r/TYzr4yUWrmwNdsN5xL7+HUiyACE4DXm+q8HtPcnFTp+NnW3k4N05tZ7FVYFFb2CR13NxyHQ==", + "dev": true, + "requires": { + "es-get-iterator": "^1.0.2", + "iterate-iterator": "^1.0.1" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, "js-yaml": { "version": "3.13.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", @@ -511,6 +1380,12 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -529,6 +1404,15 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", "dev": true }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -547,22 +1431,103 @@ "integrity": "sha1-6w1GtUER68VhrLTECO+TY73I9+A=", "dev": true }, - "levn": { - "version": "0.3.0", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" + "p-locate": "^4.1.0" } }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, "log-driver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", "dev": true }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, "mime-db": { "version": "1.43.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", @@ -593,98 +1558,335 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } - } - }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.1.3.tgz", + "integrity": "sha512-ZbaYib4hT4PpF4bdSO2DohooKXIn4lDeiYqB+vTmCdr6l2woW0b6H3pf5x4sM5nwQMru9RvjjHYWVGltR50ZBw==", "dev": true, "requires": { + "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", + "chokidar": "3.4.2", + "debug": "4.1.1", + "diff": "4.0.2", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", "growl": "1.10.5", - "he": "1.1.1", + "he": "1.2.0", + "js-yaml": "3.14.0", + "log-symbols": "4.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "ms": "2.1.2", + "object.assign": "4.1.0", + "promise.allsettled": "1.0.2", + "serialize-javascript": "4.0.0", + "strip-json-comments": "3.0.1", + "supports-color": "7.1.0", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.0.0", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.1" }, "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "p-limit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.0.2.tgz", + "integrity": "sha512-iwqZSOoWIW+Ew4kAGUlN16J4M7OB3ysMLSZtnhmqx7njIHFPlxWBX8xo3lVTyFVq6mI/lL9qt2IsN1sHwaxJkg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, - "neo-async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", - "integrity": "sha1-rCetpmFn+ohJpq3dg39rGJrSCBw=", + "node-preload": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", + "dev": true, + "requires": { + "process-on-spawn": "^1.0.0" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "nyc": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "requires": { - "abbrev": "1" + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "caching-transform": "^4.0.0", + "convert-source-map": "^1.7.0", + "decamelize": "^1.2.0", + "find-cache-dir": "^3.2.0", + "find-up": "^4.1.0", + "foreground-child": "^2.0.0", + "get-package-type": "^0.1.0", + "glob": "^7.1.6", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-hook": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-processinfo": "^2.0.2", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "make-dir": "^3.0.0", + "node-preload": "^0.2.1", + "p-map": "^3.0.0", + "process-on-spawn": "^1.0.0", + "resolve-from": "^5.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "spawn-wrap": "^2.0.0", + "test-exclude": "^6.0.0", + "yargs": "^15.0.2" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "oauth-sign": { @@ -693,6 +1895,30 @@ "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", "dev": true }, + "object-inspect": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.8.0.tgz", + "integrity": "sha512-jLdtEOB112fORuypAyl/50VRVIBIdVQOSUUGQHzJ4xBSbit81zRarz7GThkEFZy1RceYrWYcPcBFPQwHyAc1gA==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -702,59 +1928,75 @@ "wrappy": "1" } }, - "optimist": { - "version": "0.6.1", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { - "minimist": "~0.0.1", - "wordwrap": "~0.0.2" - }, - "dependencies": { - "minimist": { - "version": "0.0.10", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true - } + "p-try": "^2.0.0" } }, - "optionator": { - "version": "0.8.2", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" + "p-limit": "^2.2.0" } }, - "path": { - "version": "0.12.7", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/path/-/path-0.12.7.tgz", - "integrity": "sha1-1NwqUGxM4hl+tIHr/NWzbAFAsQ8=", + "p-map": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", + "dev": true, "requires": { - "process": "^0.11.1", - "util": "^0.10.3" + "aggregate-error": "^3.0.0" } }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, "pathval": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", @@ -767,16 +2009,42 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, - "process": { - "version": "0.11.10", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/process/-/process-0.11.10.tgz", - "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "process-on-spawn": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", + "dev": true, + "requires": { + "fromentries": "^1.2.0" + } + }, + "promise.allsettled": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/promise.allsettled/-/promise.allsettled-1.0.2.tgz", + "integrity": "sha512-UpcYW5S1RaNKT6pd+s9jp9K9rlQge1UXKskec0j6Mmuq7UJCvlS2J2/s/yuPN8ehftf9HXMxWlKiPbGGUzpoRg==", + "dev": true, + "requires": { + "array.prototype.map": "^1.0.1", + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1", + "function-bind": "^1.1.1", + "iterate-value": "^1.0.0" + } }, "psl": { "version": "1.8.0", @@ -796,6 +2064,33 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readdirp": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", + "dev": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, "request": { "version": "2.88.2", "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", @@ -824,12 +2119,49 @@ "uuid": "^3.3.2" } }, - "resolve": { - "version": "1.1.7", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, "safe-buffer": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", @@ -842,14 +2174,71 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, - "source-map": { - "version": "0.2.0", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "serialize-javascript": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-4.0.0.tgz", + "integrity": "sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw==", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "spawn-wrap": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, - "optional": true, "requires": { - "amdefine": ">=0.0.4" + "foreground-child": "^2.0.0", + "is-windows": "^1.0.2", + "make-dir": "^3.0.0", + "rimraf": "^3.0.0", + "signal-exit": "^3.0.2", + "which": "^2.0.1" + }, + "dependencies": { + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } } }, "sprintf-js": { @@ -875,13 +2264,98 @@ "tweetnacl": "~0.14.0" } }, - "supports-color": { - "version": "3.2.3", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/supports-color/-/supports-color-3.2.3.tgz", - "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { - "has-flag": "^1.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + }, + "strip-json-comments": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", + "dev": true + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" } }, "tough-cookie": { @@ -909,39 +2383,25 @@ "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", "dev": true }, - "type-check": { - "version": "0.3.2", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "dev": true, - "requires": { - "prelude-ls": "~1.1.2" - } - }, "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha1-dkb7XxiHHPu3dJ5pvTmmOI63RQw=", "dev": true }, - "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha1-cEaBNFxTqLIHn7bOwpSwXq0kL/U=", + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, - "optional": true, "requires": { - "commander": "~2.20.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://mcpartifactory.cimpress.net/artifactory/api/npm/npm-virtual/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", - "dev": true, - "optional": true - } + "is-typedarray": "^1.0.0" } }, "uri-js": { @@ -953,14 +2413,6 @@ "punycode": "^2.1.0" } }, - "util": { - "version": "0.10.4", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", - "integrity": "sha1-OqASW/5mikZy3liFfTrOJ+y3aQE=", - "requires": { - "inherits": "2.0.3" - } - }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -978,26 +2430,288 @@ "extsprintf": "^1.2.0" } }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=", + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "requires": { - "isexe": "^2.0.0" + "string-width": "^1.0.2 || 2" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + } } }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "workerpool": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.0.0.tgz", + "integrity": "sha512-fU2OcNA/GVAJLLyKUoHkAgIhKb0JoCpSjLC/G2vYKxUjVmQwGbRVeoPJ1a8U4pnVofz4AQV5Y/NEw8oKqxEBtA==", "dev": true }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.1.tgz", + "integrity": "sha512-qZV14lK9MWsGCmcr7u5oXGH0dbGqZAIxTDrWXZDo5zUr6b6iUmelNKO6x6R1dQT24AH3LgRxJpr8meWy2unolA==", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "decamelize": "^1.2.0", + "flat": "^4.1.0", + "is-plain-obj": "^1.1.0", + "yargs": "^14.2.3" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "14.2.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-14.2.3.tgz", + "integrity": "sha512-ZbotRWhF+lkjijC/VhmOT9wSgyBQ7+zr13+YLkhfsSiTriYsMzkTUFP18pFhWwBeMa5gUc1MzbhrO6/VB7c9Xg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^15.0.1" + } + }, + "yargs-parser": { + "version": "15.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-15.0.1.tgz", + "integrity": "sha512-0OAMV2mAZQrs3FkNpDQcBk1x5HXb8X4twADss4S0Iuk+2dGnLOE/fRHrsYm542GduMveyA77OF4wrNJuanRCWw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } } } } diff --git a/package.json b/package.json index 1d0d32d..5558867 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Postal Codes", "main": "postal-codes.js", "scripts": { - "coverage": "istanbul cover node_modules/mocha/bin/mocha", + "coverage": "nyc mocha", "test": "mocha test" }, "repository": { @@ -19,8 +19,8 @@ "devDependencies": { "chai": "^4.2.0", "coveralls": "^3.0.11", - "istanbul": "^0.4.5", - "mocha": "^5.2.0" + "mocha": "^8.1.3", + "nyc": "^15.1.0" }, "directories": { "test": "test" @@ -32,5 +32,6 @@ "postcode", "js" ], - "license": "Apache-2.0" + "license": "Apache-2.0", + "dependencies": {} } diff --git a/src/index.js b/src/index.js index ba1d755..e7fd512 100644 --- a/src/index.js +++ b/src/index.js @@ -37,5 +37,3 @@ module.exports.validate = function (countryCode, postalCode) { return validationRegex.test(preparedPostalCode); } - -module.exports.lookup = lookup; From 78a6146e2800c93a295cf8c6d9c3c8e7bb31b806 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 11:39:18 +0200 Subject: [PATCH 17/24] Fix lcov reporting for coveralls --- package-lock.json | 54 +++++++++++++++++++++++------------------------ package.json | 4 ++-- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc6253b..91378c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -313,9 +313,9 @@ } }, "ajv": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.0.tgz", - "integrity": "sha512-D6gFiFA0RRLyUbvijN74DWAjXSFxWKaWP7mldxkVhyhAV3+SWA9HEJPHQ2c9soIeTFJqcSdFDGFgdqs1iUU2Hw==", + "version": "6.12.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.5.tgz", + "integrity": "sha512-lRF8RORchjpKG50/WFf8xmg7sgCLFiYNNnqdKflk63whMQcWR5ngGjiSXkL9bjxy6B2npOK2HSMN49jEBMSkag==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -425,9 +425,9 @@ "dev": true }, "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", "dev": true }, "balanced-match": { @@ -641,16 +641,16 @@ "dev": true }, "coveralls": { - "version": "3.0.11", - "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.0.11.tgz", - "integrity": "sha512-LZPWPR2NyGKyaABnc49dR0fpeP6UqhvGq4B5nUrTQ1UBy55z96+ga7r+/ChMdMJUwBgyJDXBi88UBgz2rs9IiQ==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.0.tgz", + "integrity": "sha512-sHxOu2ELzW8/NC1UP5XVLbZDzO4S3VxfFye3XYCznopHy02YjNkHcj5bKaVw2O7hVaBdBjEdQGpie4II1mWhuQ==", "dev": true, "requires": { "js-yaml": "^3.13.1", "lcov-parse": "^1.0.0", "log-driver": "^1.2.7", "minimist": "^1.2.5", - "request": "^2.88.0" + "request": "^2.88.2" } }, "cross-spawn": { @@ -836,9 +836,9 @@ "dev": true }, "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "fast-json-stable-stringify": { @@ -1005,12 +1005,12 @@ "dev": true }, "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", "dev": true, "requires": { - "ajv": "^6.5.5", + "ajv": "^6.12.3", "har-schema": "^2.0.0" } }, @@ -1529,18 +1529,18 @@ } }, "mime-db": { - "version": "1.43.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz", - "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true }, "mime-types": { - "version": "2.1.26", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz", - "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "requires": { - "mime-db": "1.43.0" + "mime-db": "1.44.0" } }, "minimatch": { @@ -2405,9 +2405,9 @@ } }, "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", "dev": true, "requires": { "punycode": "^2.1.0" diff --git a/package.json b/package.json index 5558867..3db8ef9 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Postal Codes", "main": "postal-codes.js", "scripts": { - "coverage": "nyc mocha", + "coverage": "nyc --reporter lcovonly mocha ", "test": "mocha test" }, "repository": { @@ -18,7 +18,7 @@ "homepage": "https://github.com/Cimpress-MCP/postal-codes-js#readme", "devDependencies": { "chai": "^4.2.0", - "coveralls": "^3.0.11", + "coveralls": "^3.1.0", "mocha": "^8.1.3", "nyc": "^15.1.0" }, From 948c308c20f455baede31c3f39554a56ff2fa553 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 12:18:55 +0200 Subject: [PATCH 18/24] Add data validation tests --- test/data.js | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 test/data.js diff --git a/test/data.js b/test/data.js new file mode 100644 index 0000000..06a0a41 --- /dev/null +++ b/test/data.js @@ -0,0 +1,71 @@ +const expect = require('chai').expect; +const countries = require('../data/countries.json'); +const formats = require('../data/formats.json'); +const lookup = require('../data/lookup.json'); +const tests = require('../data/tests.json'); + +const usedFormats = new Set(countries.map(({postalCodeFormat}) => postalCodeFormat)); +// false is not an actual format. +usedFormats.delete(false); + +describe('Data validation:', () => { + + describe('Countries:', () => { + countries.forEach((country, index) => { + + describe(country.alpha2, () => { + if (country.postalCodeFormat !== false) { + it(`should have a format`, () => { + expect(formats[country.postalCodeFormat]).to.be.an('object'); + }); + } + + it(`should have a lookup`, () => { + expect(lookup[country.alpha2]).to.be.a('number') + .and.to.equal(index); + expect(lookup[country.alpha3]).to.be.a('number') + .and.to.equal(index); + expect(lookup[country.numeric3]).to.be.a('number') + .and.to.equal(index); + }); + }); + }); + }); + + describe('Formats:', () => { + Object.entries(formats).forEach(([name, format]) => { + describe(name, () => { + it(`should be complete`, () => { + expect(format.validationRegex).to.be.a('string').and.not.be.empty; + expect(format.redundantCharacters).to.be.a('string'); + }) + + it(`should have tests`, () => { + const countryTests = tests[name] + + expect(countryTests).to.be.an('object'); + expect(countryTests.valid).to.be.an('array').and.not.be.empty; + expect(countryTests.invalid).to.be.an('array').and.not.be.empty; + }); + + it(`should be used`, () => { + expect(usedFormats.has(name)).to.be.true; + }); + }); + }); + }); + + it('should use all tests', () => { + expect(Object.keys(tests)).to.be.lengthOf(Object.keys(formats).length); + }); + + it('should use all lookups', () => { + // alpha2, alpha3, numeric3 + const lookupTypes = 3; + + expect(Object.keys(lookup)).to.be.lengthOf(countries.length * lookupTypes); + }); +}); + + + From c47b01d700afe3ca7a5f89c9be938ccd2d1fc8c7 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 12:20:08 +0200 Subject: [PATCH 19/24] Use arrow functions --- test/args.js | 18 +++++++++--------- test/validation.js | 15 +++++++-------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/test/args.js b/test/args.js index b1e4d51..8c0a953 100644 --- a/test/args.js +++ b/test/args.js @@ -1,36 +1,36 @@ const postalCodes = require('../src/index'); const expect = require('chai').expect; -describe('Argument validation:', function () { - it('throws when args are missing', function () { - expect(function () { +describe('Argument validation:', () => { + it('throws when args are missing', () => { + expect(() => { postalCodes.validate(undefined, '1234ab'); }).to.throw('Missing country code.'); - expect(function () { + expect(() => { postalCodes.validate('NL', undefined); }).to.throw('Missing postal code.'); }); - it('throws for invalid countries', function () { - expect(function () { + it('throws for invalid countries', () => { + expect(() => { postalCodes.validate('nope', '1234ab'); }).to.throw('No data for [nope].'); }); - it('should accept different keys', function () { + it('should accept different keys', () => { expect(postalCodes.validate('NL', '1234ab')).to.be.true; expect(postalCodes.validate('NLD', '1234ab')).to.be.true; expect(postalCodes.validate('528', '1234ab')).to.be.true; }); - it('should normalize keys', function () { + it('should normalize keys', () => { expect(postalCodes.validate(' NL ', '1234ab')).to.be.true; expect(postalCodes.validate('nlD', '1234ab')).to.be.true; expect(postalCodes.validate(528, '1234ab')).to.be.true; }); - it('should normalize the postal codes', function () { + it('should normalize the postal codes', () => { expect(postalCodes.validate('NL', ' 1234-ab ')).to.be.true; expect(postalCodes.validate('NOR', 1234)).to.be.true; }); diff --git a/test/validation.js b/test/validation.js index c6f2e42..391acba 100644 --- a/test/validation.js +++ b/test/validation.js @@ -1,14 +1,13 @@ const postalCodes = require('../src/index'); const expect = require('chai').expect; +const countries = require('../data/countries.json'); +const tests = require('../data/tests.json'); -describe('Postal codes validation: ', function () { +describe('Postal codes validation: ', () => { - const countries = require('../data/countries.json'); - const tests = require('../data/tests.json'); - - Object.values(countries).forEach(function (country) { + Object.values(countries).forEach((country) => { if (country.postalCodeFormat === false) { - it(country.alpha2 + ' is valid', function () { + it(country.alpha2 + ' is valid', () => { expect(postalCodes.validate(country.alpha2, 'abc')).to.be.true; }); return; @@ -17,13 +16,13 @@ describe('Postal codes validation: ', function () { const data = tests[country.postalCodeFormat]; data.valid.forEach(function (validPostalCode) { - it(country.alpha2 + ' / ' + validPostalCode + ' is valid', function () { + it(country.alpha2 + ' / ' + validPostalCode + ' is valid', () => { expect(postalCodes.validate(country.alpha2, validPostalCode)).to.be.true; }) }); data.invalid.forEach(function (invalidPostalCode) { - it(country.alpha2 + ' / ' + invalidPostalCode + ' is valid', function () { + it(country.alpha2 + ' / ' + invalidPostalCode + ' is valid', () => { expect(postalCodes.validate(country.alpha2, invalidPostalCode)).to.be.false; }) }); From 339a4f09e421b406634eb77c932bffd489fe3989 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 12:26:35 +0200 Subject: [PATCH 20/24] Remove node 4 & 5, add 14 for travis --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d56eda4..b3d4ddd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,11 @@ language: node_js os: - 'linux' node_js: + - '14' - '12' - '10' - '8' - '6' - - '5' - - '4' install: - npm install script: From d6011dc7ff58dd0b4ba01e849727646674ef5302 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 14:10:38 +0200 Subject: [PATCH 21/24] Add lookup generation as npm script --- build/make-lookup.js | 6 ++++-- package.json | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build/make-lookup.js b/build/make-lookup.js index 442d901..0842165 100644 --- a/build/make-lookup.js +++ b/build/make-lookup.js @@ -11,5 +11,7 @@ Object lookup[numeric3] = index; }); - -fs.writeFileSync('../data/lookup.json', JSON.stringify(lookup, null, 2)); +fs.writeFileSync( + `${__dirname}/../data/lookup.json`, + JSON.stringify(lookup, null, 2) +); diff --git a/package.json b/package.json index 3db8ef9..894cde4 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "postal-codes.js", "scripts": { "coverage": "nyc --reporter lcovonly mocha ", - "test": "mocha test" + "test": "mocha test", + "build:lookup": "node build/make-lookup.js" }, "repository": { "type": "git", From e908358072913f07ebb9a20672bdd8adffd62cb7 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 14:14:06 +0200 Subject: [PATCH 22/24] Add docs for data files and adding formats --- README.md | 2 ++ data.md | 90 ++++++++++++++++++++++++++++++++++++++++++++++ test/validation.js | 2 +- 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 data.md diff --git a/README.md b/README.md index b802e98..dec442a 100644 --- a/README.md +++ b/README.md @@ -54,5 +54,7 @@ postalCodes.validate('nope', '1234'); ## Contribution Contributions are more than welcome, just fork the repo and create a pull-request ;) +For information about the adding or changing countries, see [data.md](data.md) + ## Contact PostalCodesJS@cimpress.com diff --git a/data.md b/data.md new file mode 100644 index 0000000..5b8ef08 --- /dev/null +++ b/data.md @@ -0,0 +1,90 @@ +All the data that supports this library lives the `data` folder. + +# To add/edit a format: +1. Add or edit the format in `formats.json`. +2. Add or edit the corresponding tests in `tests.json`. +3. Add or edit the country/countries in `countries.json`. +4. Build the lookup: `npm run build:lookup`. +5. Run the tests: `npm run test`. + +# countries.json +countries.json holds an array of each of the supported countries. +## Format +```json +{ + "alpha2": "NL", + "alpha3": "NLD", + "numeric3": "528", + "postalCodeFormat": "NL" +} +``` +- alpha2: The ISO-3166-1 Alpha-2 country code. +- alpha3: The ISO-3166-1 Alpha-3 country code. +- numeric3: The ISO-3166-1 Numeric country code. +- postalCodeFormat: The key of a format. Can also be `false` if the country does + not have postal codes. + +_Special note about Canary Islands: it does not have an alpha 3 nor numeric code._ + +# formats.json +formats.json holds a dictionary of format names to their definition. If multiple +countries have a format in common, the key should be a descriptive name. For +example: `5Digits`. + +If the format is particular to a specific country, then the alpha 2 code of the +country should be used. For example: `NL`. + +## Format +```json +{ + "NL": { + "redundantCharacters": " -", + "validationRegex": "^[1-9][0-9]{3}(?!SA|SD|SS)[A-Z]{2}$" + } +} +``` +- redundantCharacters: characters that should be removed from the postal code + before validation. +- validationRegex: regex to validate the input. The regex is used case-insensitive, + so it does not need to account for casing. It should be anchored to prevent + false positives. + +# lookup.json +lookup.json holds a dictionary of keys to the index in the countries array. It is +used to quickly find countries by a number of keys. + +**This file is generated by `build/make-lookup.js`** + +## Format +```json +{ + "NL": 165, + "NLD": 165, + "528": 165 +} +``` +The keys are the alpha 2, alpha 3 and numeric code of all countries. + +# tests.json +tests.json holds the test data for each format. It is a dictionary of the name +of a format to the test data. This powers the unit tests to ensure the validity +of each regex. + +## Format +```json +{ + "5Digits": { + "valid": [ + "12345", + "56785" + ], + "invalid": [ + "123456", + "1233s", + "123x3" + ] + } +} +``` +- valid: array of postal codes that are valid for the format. +- invalid: array of postal codes that are not valid for the format. diff --git a/test/validation.js b/test/validation.js index 391acba..c6dc5b9 100644 --- a/test/validation.js +++ b/test/validation.js @@ -22,7 +22,7 @@ describe('Postal codes validation: ', () => { }); data.invalid.forEach(function (invalidPostalCode) { - it(country.alpha2 + ' / ' + invalidPostalCode + ' is valid', () => { + it(country.alpha2 + ' / ' + invalidPostalCode + ' is invalid', () => { expect(postalCodes.validate(country.alpha2, invalidPostalCode)).to.be.false; }) }); From fd8e595b99dc412d604f1f38883ac71538a04667 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 25 Sep 2020 14:18:51 +0200 Subject: [PATCH 23/24] Update package.json --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 91378c0..2cb5cef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "postal-codes-js", - "version": "2.5.2", + "version": "3.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 894cde4..245f5df 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "postal-codes-js", - "version": "2.5.2", + "version": "3.0.0", "description": "Postal Codes", - "main": "postal-codes.js", + "main": "src/index.js", "scripts": { "coverage": "nyc --reporter lcovonly mocha ", "test": "mocha test", From e52fb24b0d260f028f22c4055c7b268f3eeece23 Mon Sep 17 00:00:00 2001 From: "tom.hooijenga" Date: Fri, 23 Oct 2020 10:19:17 +0200 Subject: [PATCH 24/24] Remove node 6 & 8 for travis --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b3d4ddd..da10074 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,6 @@ node_js: - '14' - '12' - '10' - - '8' - - '6' install: - npm install script: