diff --git a/country/AUS.json b/country/AUS.json new file mode 100644 index 0000000..83fc36d --- /dev/null +++ b/country/AUS.json @@ -0,0 +1,4 @@ +{ + "zipCodeFormat": "numeric", + "zipCodeLength": 4 +} \ No newline at end of file diff --git a/lib/region.js b/lib/region.js index 57bd737..1940c00 100644 --- a/lib/region.js +++ b/lib/region.js @@ -20,6 +20,7 @@ const availableCountries = new Set([ 'RUS', 'SWE', 'USA', + 'AUS', ]); ////////////////////// diff --git a/package-lock.json b/package-lock.json index cd435a3..3e41bc3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "region_identifier", - "version": "2.0.1", + "version": "2.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "region_identifier", - "version": "2.0.1", + "version": "2.0.2", "license": "CC BY 3.0", "dependencies": { "axios": "^1.7.2", diff --git a/package.json b/package.json index d7e5c2e..5861b29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "region_identifier", - "version": "2.0.1", + "version": "2.0.2", "description": "Gets the name of the region depending of the country and zip code.", "main": "index.js", "repository": { diff --git a/regionNames/AUS.json b/regionNames/AUS.json new file mode 100644 index 0000000..d182783 --- /dev/null +++ b/regionNames/AUS.json @@ -0,0 +1,10 @@ +{ + "AU-NSW": "New South Wales", + "AU-ACT": "Australian Capital Territory", + "AU-VIC": "Victoria", + "AU-QLD": "Queensland", + "AU-SA": "South Australia", + "AU-WA": "Western Australia", + "AU-TAS": "Tasmania", + "AU-NT": "Northern Territory" +} \ No newline at end of file diff --git a/regions/AUS.json b/regions/AUS.json new file mode 100644 index 0000000..971bb13 --- /dev/null +++ b/regions/AUS.json @@ -0,0 +1,97 @@ +[ + { + "region": "AU-NSW", + "low": 1000, + "high": 1999 + }, + { + "region": "AU-NSW", + "low": 2000, + "high": 2599 + }, + { + "region": "AU-NSW", + "low": 2619, + "high": 2899 + }, + { + "region": "AU-NSW", + "low": 2921, + "high": 2999 + }, + { + "region": "AU-ACT", + "low": 200, + "high": 299 + }, + { + "region": "AU-ACT", + "low": 2600, + "high": 2618 + }, + { + "region": "AU-ACT", + "low": 2900, + "high": 2920 + }, + { + "region": "AU-VIC", + "low": 3000, + "high": 3996 + }, + { + "region": "AU-VIC", + "low": 8000, + "high": 8999 + }, + { + "region": "AU-QLD", + "low": 4000, + "high": 4999 + }, + { + "region": "AU-QLD", + "low": 9000, + "high": 9999 + }, + { + "region": "AU-SA", + "low": 5000, + "high": 5799 + }, + { + "region": "AU-SA", + "low": 5800, + "high": 5999 + }, + { + "region": "AU-WA", + "low": 6000, + "high": 6797 + }, + { + "region": "AU-WA", + "low": 6800, + "high": 6999 + }, + { + "region": "AU-TAS", + "low": 7000, + "high": 7799 + }, + { + "region": "AU-TAS", + "low": 7800, + "high": 7999 + }, + { + "region": "AU-NT", + "low": 800, + "high": 899 + }, + { + "region": "AU-NT", + "low": 900, + "high": 999 + } +] \ No newline at end of file diff --git a/test/tests.js b/test/tests.js index 5631dee..007dd31 100644 --- a/test/tests.js +++ b/test/tests.js @@ -319,6 +319,16 @@ const countriesPostalCodes = { zip: '22100', result: 'FI-01', usingGoogle: false, + },{ + name: 'AUS', + zip: '0841', + result: 'AU-NT', + usingGoogle: false, + },{ + name: 'AUS', + zip: '2111', + result: 'AU-NSW', + usingGoogle: false, }], };