From 2ab1bcee40e769268e9d527e59c6dbf20297cc79 Mon Sep 17 00:00:00 2001 From: sthiepaan Date: Sat, 31 Oct 2020 18:41:51 +0100 Subject: [PATCH 1/5] Add 'independence_year' Property to 'data.json' --- data/data.json | 588 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 392 insertions(+), 196 deletions(-) diff --git a/data/data.json b/data/data.json index 0e750f8..531126d 100644 --- a/data/data.json +++ b/data/data.json @@ -22,7 +22,8 @@ "tld": ".af", "constitutional_form": "republic", "language_codes": ["fa-AF", "ps-AF"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1919 }, { "country": "albania", @@ -47,7 +48,8 @@ "tld": ".al", "constitutional_form": "republic", "language_codes": ["sq-AL"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1912 }, { "country": "algeria", @@ -72,7 +74,8 @@ "tld": ".dz", "constitutional_form": "republic", "language_codes": ["ar-DZ", "fr-DZ"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1962 }, { "country": "andorra", @@ -97,7 +100,8 @@ "tld": ".ad", "constitutional_form": "constitutional monarchy", "language_codes": ["ca-AD"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1814 }, { "country": "angola", @@ -122,7 +126,8 @@ "tld": ".ao", "constitutional_form": "republic", "language_codes": ["pt-AO"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1975 }, { "country": "antigua & barbuda", @@ -147,7 +152,8 @@ "tld": ".ag", "constitutional_form": "constitutional monarchy", "language_codes": ["en-AG"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1981 }, { "country": "argentina", @@ -172,7 +178,8 @@ "tld": ".ar", "constitutional_form": "republic", "language_codes": ["es-AR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1816 }, { "country": "armenia", @@ -197,7 +204,8 @@ "tld": ".am", "constitutional_form": "republic", "language_codes": ["as-AM"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1991 }, { "country": "australia", @@ -222,7 +230,8 @@ "tld": ".au", "constitutional_form": "constitutional monarchy", "language_codes": ["en-AU"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "austria", @@ -247,7 +256,8 @@ "tld": ".at", "constitutional_form": "republic", "language_codes": ["de-AT"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1955 }, { "country": "azerbaijan", @@ -272,7 +282,8 @@ "tld": ".az", "constitutional_form": "republic", "language_codes": ["az-AZ"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1991 }, { "country": "the bahamas", @@ -297,7 +308,8 @@ "tld": ".bs", "constitutional_form": "constitutional monarchy", "language_codes": ["en-BS"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1973 }, { "country": "bahrain", @@ -322,7 +334,8 @@ "tld": ".bh", "constitutional_form": "constitutional monarchy", "language_codes": ["ar-BH"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1971 }, { "country": "bangladesh", @@ -347,7 +360,8 @@ "tld": ".bd", "constitutional_form": "republic", "language_codes": ["bn-BD"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1971 }, { "country": "barbados", @@ -372,7 +386,8 @@ "tld": ".bb", "constitutional_form": "constitutional monarchy", "language_codes": ["en-BB"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1966 }, { "country": "belarus", @@ -397,7 +412,8 @@ "tld": ".by", "constitutional_form": "republic", "language_codes": ["be-BY", "ru-BY"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1944 }, { "country": "belgium", @@ -422,7 +438,8 @@ "tld": ".be", "constitutional_form": "constitutional monarchy", "language_codes": ["de-BE", "fr-BE", "nl-BE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1831 }, { "country": "belize", @@ -447,7 +464,8 @@ "tld": ".bz", "constitutional_form": "constitutional monarchy", "language_codes": ["en-BZ"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1981 }, { "country": "benin", @@ -472,7 +490,8 @@ "tld": ".bj", "constitutional_form": "republic", "language_codes": ["fr-BJ"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "bhutan", @@ -497,7 +516,8 @@ "tld": ".bt", "constitutional_form": "constitutional monarchy", "language_codes": ["dz-BT"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1947 }, { "country": "bolivia", @@ -522,7 +542,8 @@ "tld": ".bo", "constitutional_form": "republic", "language_codes": ["ay-BO", "es-BO", "qu-BO"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1825 }, { "country": "bosnia and herzegovina", @@ -547,7 +568,8 @@ "tld": ".ba", "constitutional_form": "republic", "language_codes": ["bs-BA", "hr-BA", "sr-BA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1992 }, { "country": "botswana", @@ -572,7 +594,8 @@ "tld": ".bw", "constitutional_form": "republic", "language_codes": ["en-BW"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1966 }, { "country": "brazil", @@ -597,7 +620,8 @@ "tld": ".br", "constitutional_form": "republic", "language_codes": ["pt-BR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1822 }, { "country": "brunei", @@ -622,7 +646,8 @@ "tld": ".bn", "constitutional_form": "absolute monarchy", "language_codes": ["ms-BN"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1984 }, { "country": "bulgaria", @@ -647,7 +672,8 @@ "tld": ".bg", "constitutional_form": "republic", "language_codes": ["bg-BG"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1908 }, { "country": "burkina faso", @@ -672,7 +698,8 @@ "tld": ".bf", "constitutional_form": "republic", "language_codes": ["fr-BF"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1960 }, { "country": "burundi", @@ -697,7 +724,8 @@ "tld": ".bi", "constitutional_form": "republic", "language_codes": ["fr-BI", "rn-BI"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1962 }, { "country": "cambodia", @@ -722,7 +750,8 @@ "tld": ".kh", "constitutional_form": "constitutional monarchy", "language_codes": ["km-KH"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1953 }, { "country": "cameroon", @@ -747,7 +776,8 @@ "tld": ".cm", "constitutional_form": "republic", "language_codes": ["en-CM", "fr-CM"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "canada", @@ -772,7 +802,8 @@ "tld": ".ca", "constitutional_form": "constitutional monarchy", "language_codes": ["en-CA", "fr-CA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "cape verde", @@ -797,7 +828,8 @@ "tld": ".cv", "constitutional_form": "republic", "language_codes": ["pt-CV"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1975 }, { "country": "central african republic", @@ -822,7 +854,8 @@ "tld": ".cf", "constitutional_form": "republic", "language_codes": ["fr-CF", "sg-CF"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1960 }, { "country": "chad", @@ -847,7 +880,8 @@ "tld": ".td", "constitutional_form": "republic", "language_codes": ["ar-TD", "fr-TD"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1960 }, { "country": "chile", @@ -872,7 +906,8 @@ "tld": ".cl", "constitutional_form": "republic", "language_codes": ["es-CL"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1810 }, { "country": "china", @@ -897,7 +932,8 @@ "tld": ".cn", "constitutional_form": "republic", "language_codes": ["zh-CN"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "colombia", @@ -922,7 +958,8 @@ "tld": ".co", "constitutional_form": "republic", "language_codes": ["es-CO"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1810 }, { "country": "comoros", @@ -947,7 +984,8 @@ "tld": ".km", "constitutional_form": "republic", "language_codes": ["ar-KM", "fr-KM"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1975 }, { "country": "democratic republic of the congo", @@ -972,7 +1010,8 @@ "tld": ".cd", "constitutional_form": "republic", "language_codes": ["fr-CD"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "republic of the congo (congo-brazzaville)", @@ -997,7 +1036,8 @@ "tld": ".cg", "constitutional_form": "republic", "language_codes": ["fr-CG"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "costa rica", @@ -1022,7 +1062,8 @@ "tld": ".cr", "constitutional_form": "republic", "language_codes": ["es-CR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1821 }, { "country": "cote d'ivoire (ivory coast)", @@ -1047,7 +1088,8 @@ "tld": ".ci", "constitutional_form": "republic", "language_codes": ["fr-CI"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "croatia", @@ -1072,7 +1114,8 @@ "tld": ".hr", "constitutional_form": "republic", "language_codes": ["hr-HR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1990 }, { "country": "cuba", @@ -1097,7 +1140,8 @@ "tld": ".cu", "constitutional_form": "republic", "language_codes": ["es-CU"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1868 }, { "country": "cyprus", @@ -1122,7 +1166,8 @@ "tld": ".cy", "constitutional_form": "republic", "language_codes": ["el-CY", "tr-CY"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "czechia", @@ -1147,7 +1192,8 @@ "tld": ".cz", "constitutional_form": "republic", "language_codes": ["cs-CZ"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1918 }, { "country": "denmark", @@ -1172,7 +1218,8 @@ "tld": ".dk", "constitutional_form": "constitutional monarchy", "language_codes": ["da-DK"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "djibouti", @@ -1197,7 +1244,8 @@ "tld": ".dj", "constitutional_form": "republic", "language_codes": ["ar-DJ", "fr-DJ"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1977 }, { "country": "dominica", @@ -1222,7 +1270,8 @@ "tld": ".dm", "constitutional_form": "republic", "language_codes": ["en-DM", "fr-DM"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1978 }, { "country": "dominican republic", @@ -1247,7 +1296,8 @@ "tld": ".do", "constitutional_form": "republic", "language_codes": ["es-DO"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1844 }, { "country": "east timor (timor-leste)", @@ -1272,7 +1322,8 @@ "tld": ".tl", "constitutional_form": "republic", "language_codes": ["pt-TL"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 2002 }, { "country": "ecuador", @@ -1297,7 +1348,8 @@ "tld": ".ec", "constitutional_form": "republic", "language_codes": ["es-EC"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1809 }, { "country": "egypt", @@ -1322,7 +1374,8 @@ "tld": ".eg", "constitutional_form": "republic", "language_codes": ["ar-EG"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "el salvador", @@ -1347,7 +1400,8 @@ "tld": ".sv", "constitutional_form": "republic", "language_codes": ["es-SV"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1821 }, { "country": "equitorial guinea", @@ -1372,7 +1426,8 @@ "tld": ".gq", "constitutional_form": "republic", "language_codes": ["es-GQ", "fr-GQ", "pt-GQ"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1968 }, { "country": "eritrea", @@ -1397,7 +1452,8 @@ "tld": ".er", "constitutional_form": "republic", "language_codes": ["ar-ER", "en-ER", "ti-ER"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1991 }, { "country": "estonia", @@ -1422,7 +1478,8 @@ "tld": ".ee", "constitutional_form": "republic", "language_codes": ["et-EE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1918 }, { "country": "ethiopia", @@ -1447,7 +1504,8 @@ "tld": ".et", "constitutional_form": "republic", "language_codes": ["am-ET"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1991 }, { "country": "fiji", @@ -1472,7 +1530,8 @@ "tld": ".fj", "constitutional_form": "republic", "language_codes": ["en-FJ", "fj-FJ"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1970 }, { "country": "finland", @@ -1497,7 +1556,8 @@ "tld": ".fi", "constitutional_form": "republic", "language_codes": ["fi-FI", "sv-FI"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1917 }, { "country": "france", @@ -1522,7 +1582,8 @@ "tld": ".fr", "constitutional_form": "republic", "language_codes": ["fr-FR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "gabon", @@ -1547,7 +1608,8 @@ "tld": ".ga", "constitutional_form": "republic", "language_codes": ["fr-GA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "the gambia", @@ -1572,7 +1634,8 @@ "tld": ".gm", "constitutional_form": "republic", "language_codes": ["en-GM"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1965 }, { "country": "georgia", @@ -1597,7 +1660,8 @@ "tld": ".ge", "constitutional_form": "republic", "language_codes": ["ka-GE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1918 }, { "country": "germany", @@ -1622,7 +1686,8 @@ "tld": ".de", "constitutional_form": "republic", "language_codes": ["de-DE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "ghana", @@ -1647,7 +1712,8 @@ "tld": ".gh", "constitutional_form": "republic", "language_codes": ["en-GH"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1957 }, { "country": "greece", @@ -1672,7 +1738,8 @@ "tld": ".gr", "constitutional_form": "republic", "language_codes": ["el-GR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1821 }, { "country": "grenada", @@ -1697,7 +1764,8 @@ "tld": ".gd", "constitutional_form": "constitutional monarchy", "language_codes": ["en-GD"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1974 }, { "country": "guatemala", @@ -1722,7 +1790,8 @@ "tld": ".gt", "constitutional_form": "republic", "language_codes": ["es-GT"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1821 }, { "country": "guinea", @@ -1747,7 +1816,8 @@ "tld": ".gn", "constitutional_form": "republic", "language_codes": ["fr-GN"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1958 }, { "country": "guinea-bissau", @@ -1772,7 +1842,8 @@ "tld": ".gw", "constitutional_form": "republic", "language_codes": ["pt-GW"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1973 }, { "country": "guyana", @@ -1797,7 +1868,8 @@ "tld": ".gy", "constitutional_form": "republic", "language_codes": ["en-GY"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1966 }, { "country": "haiti", @@ -1822,7 +1894,8 @@ "tld": ".ht", "constitutional_form": "republic", "language_codes": ["fr-HT", "ht-HT"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1804 }, { "country": "honduras", @@ -1847,7 +1920,8 @@ "tld": ".hn", "constitutional_form": "republic", "language_codes": ["es-HN"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1821 }, { "country": "hungary", @@ -1872,7 +1946,8 @@ "tld": ".hu", "constitutional_form": "republic", "language_codes": ["hu-HU"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1989 }, { "country": "iceland", @@ -1897,7 +1972,8 @@ "tld": ".is", "constitutional_form": "republic", "language_codes": ["is-IS"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1944 }, { "country": "india", @@ -1922,7 +1998,8 @@ "tld": ".in", "constitutional_form": "republic", "language_codes": ["en-IN", "hi-IN"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1947 }, { "country": "indonesia", @@ -1947,7 +2024,8 @@ "tld": ".id", "constitutional_form": "republic", "language_codes": ["id-ID"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1945 }, { "country": "iran", @@ -1972,7 +2050,8 @@ "tld": ".ir", "constitutional_form": "republic", "language_codes": ["fa-IR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1979 }, { "country": "iraq", @@ -1997,7 +2076,8 @@ "tld": ".iq", "constitutional_form": "republic", "language_codes": ["ar-IK", "ku-IK"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1932 }, { "country": "republic of ireland", @@ -2022,7 +2102,8 @@ "tld": ".ie", "constitutional_form": "republic", "language_codes": ["en-IE", "ga-IE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1916 }, { "country": "israel", @@ -2047,7 +2128,8 @@ "tld": ".il", "constitutional_form": "republic", "language_codes": [ "ar-IL", "he-IL"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1948 }, { "country": "italy", @@ -2072,7 +2154,8 @@ "tld": ".it", "constitutional_form": "republic", "language_codes": ["it-IT"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "jamaica", @@ -2097,7 +2180,8 @@ "tld": ".jm", "constitutional_form": "constitutional monarchy", "language_codes": ["en-JM"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1962 }, { "country": "japan", @@ -2122,7 +2206,8 @@ "tld": ".jp", "constitutional_form": "constitutional monarchy", "language_codes": ["ja-JP"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1945 }, { "country": "jordan", @@ -2147,7 +2232,8 @@ "tld": ".jo", "constitutional_form": "constitutional monarchy", "language_codes": ["ar-JO"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1946 }, { "country": "kazakhstan", @@ -2172,7 +2258,8 @@ "tld": ".kz", "constitutional_form": "republic", "language_codes": ["kk-KZ", "ru-KZ"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1991 }, { "country": "kenya", @@ -2197,7 +2284,8 @@ "tld": ".ke", "constitutional_form": "republic", "language_codes": ["en-KE", "sw-KE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1963 }, { "country": "kiribati", @@ -2222,7 +2310,8 @@ "tld": ".ki", "constitutional_form": "republic", "language_codes": ["en-KI"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1979 }, { "country": "north korea", @@ -2247,7 +2336,8 @@ "tld": ".kp", "constitutional_form": "republic", "language_codes": ["ko-KP"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1945 }, { "country": "south korea", @@ -2272,7 +2362,8 @@ "tld": ".kr", "constitutional_form": "republic", "language_codes": ["ko-KR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1945 }, { "country": "kosovo", @@ -2297,7 +2388,8 @@ "tld": ".rs", "constitutional_form": "republic", "language_codes": ["sr-XK", "sq-XK"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 2008 }, { "country": "kuwait", @@ -2322,7 +2414,8 @@ "tld": ".kw", "constitutional_form": "constitutional monarchy", "language_codes": ["ar-KW", "en-KW"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1961 }, { "country": "kyrgyzstan", @@ -2347,7 +2440,8 @@ "tld": ".kg", "constitutional_form": "republic", "language_codes": ["ky-KG", "ru-KG"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1991 }, { "country": "laos", @@ -2372,7 +2466,8 @@ "tld": ".la", "constitutional_form": "republic", "language_codes": ["lo-LA"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1949 }, { "country": "latvia", @@ -2397,7 +2492,8 @@ "tld": ".lv", "constitutional_form": "republic", "language_codes": ["lv-LV"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1990 }, { "country": "lebanon", @@ -2422,7 +2518,8 @@ "tld": ".lb", "constitutional_form": "republic", "language_codes": ["ar-LB", "fr-LB"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1943 }, { "country": "lesotho", @@ -2447,7 +2544,8 @@ "tld": ".ls", "constitutional_form": "constitutional monarchy", "language_codes": ["en-LS", "st-LS"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1966 }, { "country": "liberia", @@ -2472,7 +2570,8 @@ "tld": ".lr", "constitutional_form": "republic", "language_codes": ["en-LR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1847 }, { "country": "libya", @@ -2497,7 +2596,8 @@ "tld": ".ly", "constitutional_form": "n/a", "language_codes": ["ar-LY"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1951 }, { "country": "liechtenstein", @@ -2522,7 +2622,8 @@ "tld": ".li", "constitutional_form": "constitutional monarchy", "language_codes": ["de-LI"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1866 }, { "country": "lithuania", @@ -2547,7 +2648,8 @@ "tld": ".lt", "constitutional_form": "republic", "language_codes": ["lt-LT"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1990 }, { "country": "luxembourg", @@ -2572,7 +2674,8 @@ "tld": ".lu", "constitutional_form": "constitutional monarchy", "language_codes": ["de-LU", "fr-LU", "lb-LU"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1958 }, { "country": "north macedonia (the republic of north macedonia)", @@ -2597,7 +2700,8 @@ "tld": ".mk", "constitutional_form": "republic", "language_codes": ["mk-MK", "sq-MK"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1991 }, { "country": "madagascar", @@ -2622,7 +2726,8 @@ "tld": ".mg", "constitutional_form": "republic", "language_codes": ["fr-MG", "mg-MG"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "malawi", @@ -2647,7 +2752,8 @@ "tld": ".mw", "constitutional_form": "republic", "language_codes": ["en-MW", "ny-MW"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1964 }, { "country": "malaysia", @@ -2672,7 +2778,8 @@ "tld": ".my", "constitutional_form": "constitutional monarchy", "language_codes": ["ms-MY"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1957 }, { "country": "maldives", @@ -2697,7 +2804,8 @@ "tld": ".mv", "constitutional_form": "republic", "language_codes": ["dv-MV"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1965 }, { "country": "mali", @@ -2722,7 +2830,8 @@ "tld": ".ml", "constitutional_form": "n/a", "language_codes": ["fr-ML"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1960 }, { "country": "malta", @@ -2747,7 +2856,8 @@ "tld": ".mt", "constitutional_form": "republic", "language_codes": ["en-MT", "mt-MT"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1964 }, { "country": "marshall islands", @@ -2772,7 +2882,8 @@ "tld": ".mh", "constitutional_form": "republic", "language_codes": ["en-MH", "mh-MH"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1986 }, { "country": "mauritania", @@ -2797,7 +2908,8 @@ "tld": ".mr", "constitutional_form": "republic", "language_codes": ["ar-MR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "mauritius", @@ -2822,7 +2934,8 @@ "tld": ".mu", "constitutional_form": "republic", "language_codes": ["en-MU"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1968 }, { "country": "mexico", @@ -2847,7 +2960,8 @@ "tld": ".mx", "constitutional_form": "republic", "language_codes": ["es-MX"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1810 }, { "country": "federal states of micronesia", @@ -2872,7 +2986,8 @@ "tld": ".fm", "constitutional_form": "republic", "language_codes": ["en-FM"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1986 }, { "country": "moldova", @@ -2897,7 +3012,8 @@ "tld": ".md", "constitutional_form": "republic", "language_codes": ["ro-MD"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1991 }, { "country": "monaco", @@ -2922,7 +3038,8 @@ "tld": ".mc", "constitutional_form": "constitutional monarchy", "language_codes": ["fr-MC"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "mongolia", @@ -2947,7 +3064,8 @@ "tld": ".mn", "constitutional_form": "republic", "language_codes": ["mn-MN"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1911 }, { "country": "montenegro", @@ -2972,7 +3090,8 @@ "tld": ".me", "constitutional_form": "republic", "language_codes": ["sr-ME"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 2006 }, { "country": "morocco", @@ -2997,7 +3116,8 @@ "tld": ".ma", "constitutional_form": "constitutional monarchy", "language_codes": ["ar-MA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1955 }, { "country": "mozambique", @@ -3022,7 +3142,8 @@ "tld": ".mz", "constitutional_form": "republic", "language_codes": ["pt-MZ"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1975 }, { "country": "myanmar (burma)", @@ -3047,7 +3168,8 @@ "tld": ".mm", "constitutional_form": "republic", "language_codes": ["my-MM"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1948 }, { "country": "namibia", @@ -3072,7 +3194,8 @@ "tld": ".na", "constitutional_form": "republic", "language_codes": ["af-NA", "de-NA", "en-NA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1990 }, { "country": "nauru", @@ -3097,7 +3220,8 @@ "tld": ".nr", "constitutional_form": "republic", "language_codes": ["en-NR", "na-NR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1968 }, { "country": "nepal", @@ -3122,7 +3246,8 @@ "tld": ".np", "constitutional_form": "republic", "language_codes": ["ne-NP"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1946 }, { "country": "netherlands", @@ -3147,7 +3272,8 @@ "tld": ".nl", "constitutional_form": "constitutional monarchy", "language_codes": ["nl-NL"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1581 }, { "country": "new zealand", @@ -3172,7 +3298,8 @@ "tld": ".nz", "constitutional_form": "constitutional monarchy", "language_codes": ["en-NZ"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "nicaragua", @@ -3197,7 +3324,8 @@ "tld": ".ni", "constitutional_form": "republic", "language_codes": ["es-NA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1821 }, { "country": "niger", @@ -3222,7 +3350,8 @@ "tld": ".ne", "constitutional_form": "republic", "language_codes": ["fr-NE"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1960 }, { "country": "nigeria", @@ -3247,7 +3376,8 @@ "tld": ".ng", "constitutional_form": "republic", "language_codes": ["en-NG"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "norway", @@ -3272,7 +3402,8 @@ "tld": ".no", "constitutional_form": "constitutional monarchy", "language_codes": ["no-NO"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1905 }, { "country": "oman", @@ -3297,7 +3428,8 @@ "tld": ".om", "constitutional_form": "absolute monarchy", "language_codes": ["ar-OM"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1650 }, { "country": "pakistan", @@ -3322,7 +3454,8 @@ "tld": ".pk", "constitutional_form": "republic", "language_codes": [ "en-PK", "ur-PK"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1947 }, { "country": "palau", @@ -3347,7 +3480,8 @@ "tld": ".pw", "constitutional_form": "republic", "language_codes": ["en-PW"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1994 }, { "country": "panama", @@ -3372,7 +3506,8 @@ "tld": ".pa", "constitutional_form": "republic", "language_codes": ["es-PA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1903 }, { "country": "papa new guinea", @@ -3397,7 +3532,8 @@ "tld": ".pg", "constitutional_form": "constitutional monarchy", "language_codes": ["en-PG"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1975 }, { "country": "paraguay", @@ -3422,7 +3558,8 @@ "tld": ".py", "constitutional_form": "republic", "language_codes": ["es-PY", "gn-PY"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1811 }, { "country": "peru", @@ -3447,7 +3584,8 @@ "tld": ".pe", "constitutional_form": "republic", "language_codes": ["es-PE", "qu-PE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1821 }, { "country": "philippines", @@ -3472,7 +3610,8 @@ "tld": ".ph", "constitutional_form": "republic", "language_codes": ["en-PH", "tl-PH"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1898 }, { "country": "poland", @@ -3497,7 +3636,8 @@ "tld": ".pl", "constitutional_form": "republic", "language_codes": ["pl-PL"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1918 }, { "country": "portugal", @@ -3522,7 +3662,8 @@ "tld": ".pt", "constitutional_form": "republic", "language_codes": ["pt-PT"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1640 }, { "country": "qatar", @@ -3547,7 +3688,8 @@ "tld": ".qa", "constitutional_form": "absolute monarchy", "language_codes": ["ar-QA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1971 }, { "country": "romania", @@ -3572,7 +3714,8 @@ "tld": ".ro", "constitutional_form": "republic", "language_codes": ["ro-RO"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1877 }, { "country": "russia", @@ -3597,7 +3740,8 @@ "tld": ".ru", "constitutional_form": "republic", "language_codes": ["ru-RU"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "rwanda", @@ -3622,7 +3766,8 @@ "tld": ".rw", "constitutional_form": "republic", "language_codes": ["en-RW", "fr-RW", "rw-RW"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1962 }, { "country": "saint kitts and nevis", @@ -3647,7 +3792,8 @@ "tld": ".kn", "constitutional_form": "constitutional monarchy", "language_codes": ["en-KN"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1983 }, { "country": "saint lucia", @@ -3672,7 +3818,8 @@ "tld": ".lc", "constitutional_form": "constitutional monarchy", "language_codes": ["en-LC", "fr-LC"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1979 }, { "country": "saint vincent and the grenadines", @@ -3697,7 +3844,8 @@ "tld": ".vc", "constitutional_form": "constitutional monarchy", "language_codes": ["en-VC"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1979 }, { "country": "samoa", @@ -3722,7 +3870,8 @@ "tld": ".ws", "constitutional_form": "republic", "language_codes": ["en-WS", "sm-WS"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1962 }, { "country": "san marino", @@ -3747,7 +3896,8 @@ "tld": ".sm", "constitutional_form": "republic", "language_codes": ["it-SM"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 301 }, { "country": "sao tome and principe", @@ -3772,7 +3922,8 @@ "tld": ".st", "constitutional_form": "republic", "language_codes": ["pt-ST"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1975 }, { "country": "saudi arabia", @@ -3797,7 +3948,8 @@ "tld": ".sa", "constitutional_form": "absolute monarchy", "language_codes": ["ar-SA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1932 }, { "country": "senegal", @@ -3822,7 +3974,8 @@ "tld": ".sn", "constitutional_form": "republic", "language_codes": ["fr-SN"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "serbia", @@ -3847,7 +4000,8 @@ "tld": ".rs", "constitutional_form": "republic", "language_codes": ["sr-RS"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1804 }, { "country": "seychelles", @@ -3872,7 +4026,8 @@ "tld": ".sc", "constitutional_form": "republic", "language_codes": ["en-SC", "fr-SC"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1976 }, { "country": "sierra leone", @@ -3897,7 +4052,8 @@ "tld": ".sl", "constitutional_form": "republic", "language_codes": ["en-SL"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1961 }, { "country": "singapore", @@ -3922,7 +4078,8 @@ "tld": ".sg", "constitutional_form": "republic", "language_codes": ["en-SG", "ms-SG", "zh-SG"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1965 }, { "country": "slovakia", @@ -3947,7 +4104,8 @@ "tld": ".sk", "constitutional_form": "republic", "language_codes": ["sk-SK"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1992 }, { "country": "slovenia", @@ -3972,7 +4130,8 @@ "tld": ".si", "constitutional_form": "republic", "language_codes": ["sl-SI"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1991 }, { "country": "solomon islands", @@ -3997,7 +4156,8 @@ "tld": ".sb", "constitutional_form": "constitutional monarchy", "language_codes": ["en-SB"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1978 }, { "country": "somalia", @@ -4022,7 +4182,8 @@ "tld": ".so", "constitutional_form": "republic", "language_codes": ["so-SO"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "south africa", @@ -4047,7 +4208,8 @@ "tld": ".za", "constitutional_form": "republic", "language_codes": ["af-ZA", "en-ZA", "xh-ZA", "zu-ZA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1931 }, { "country": "south sudan (republic of south sudan)", @@ -4072,7 +4234,8 @@ "tld": ".ss", "constitutional_form": "republic", "language_codes": ["ar-SS", "en-SS"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 2011 }, { "country": "spain", @@ -4097,7 +4260,8 @@ "tld": ".es", "constitutional_form": "constitutional monarchy", "language_codes": ["ca-ES", "es-ES"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 0 }, { "country": "sri lanka", @@ -4122,7 +4286,8 @@ "tld": ".lk", "constitutional_form": "republic", "language_codes": ["si-LK", "ta-LK"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1948 }, { "country": "sudan (republic of the sudan)", @@ -4147,7 +4312,8 @@ "tld": ".sd", "constitutional_form": "n/a", "language_codes": ["ar-SD", "en-SD"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1956 }, { "country": "suriname", @@ -4172,7 +4338,8 @@ "tld": ".sr", "constitutional_form": "republic", "language_codes": ["nl-SR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1975 }, { "country": "eswatini (swaziland)", @@ -4197,7 +4364,8 @@ "tld": ".sz", "constitutional_form": "absolute monarchy", "language_codes": ["ss-SZ"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1968 }, { "country": "sweden", @@ -4222,7 +4390,8 @@ "tld": ".se", "constitutional_form": "constitutional monarchy", "language_codes": ["sv-SE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1523 }, { "country": "switzerland", @@ -4246,7 +4415,8 @@ "tld": ".ch", "constitutional_form": "republic", "language_codes": ["de-CH", "fr-CH", "it-CH", "rm-CH"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1291 }, { "country": "syria", @@ -4271,7 +4441,8 @@ "tld": ".sy", "constitutional_form": "republic", "language_codes": ["ar-SY"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1946 }, { "country": "taiwan", @@ -4296,7 +4467,8 @@ "tld": ".tw", "constitutional_form": "republic", "language_codes": ["zh-TW"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1912 }, { "country": "tajikistan", @@ -4321,7 +4493,8 @@ "tld": ".tj", "constitutional_form": "republic", "language_codes": ["ru-TJ", "tg-TJ"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1991 }, { "country": "tanzania", @@ -4346,7 +4519,8 @@ "tld": ".tz", "constitutional_form": "republic", "language_codes": ["en-TZ", "sw-TZ"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1961 }, { "country": "thailand", @@ -4371,7 +4545,8 @@ "tld": ".th", "constitutional_form": "constitutional monarchy", "language_codes": ["th-TH"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1767 }, { "country": "togo", @@ -4396,7 +4571,8 @@ "tld": ".tg", "constitutional_form": "republic", "language_codes": ["fr-TG"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1960 }, { "country": "tonga", @@ -4421,7 +4597,8 @@ "tld": ".to", "constitutional_form": "constitutional monarchy", "language_codes": ["en-TO", "to-TO"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1970 }, { "country": "trinidad and tobago", @@ -4446,7 +4623,8 @@ "tld": ".tt", "constitutional_form": "republic", "language_codes": ["en-TT"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1962 }, { "country": "tunisia", @@ -4471,7 +4649,8 @@ "tld": ".tn", "constitutional_form": "republic", "language_codes": ["ar-TN", "fr-TN"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1956 }, { "country": "turkey", @@ -4496,7 +4675,8 @@ "tld": ".tr", "constitutional_form": "republic", "language_codes": ["tr-TR"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1923 }, { "country": "turkmenistan", @@ -4521,7 +4701,8 @@ "tld": ".tm", "constitutional_form": "republic", "language_codes": ["ru-TM", "tk-TM"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1991 }, { "country": "tuvalu", @@ -4546,7 +4727,8 @@ "tld": ".tv", "constitutional_form": "constitutional monarchy", "language_codes": ["en-TV"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1978 }, { "country": "uganda", @@ -4571,7 +4753,8 @@ "tld": ".ug", "constitutional_form": "republic", "language_codes": ["en-UG", "sw-UG"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1962 }, { "country": "ukraine", @@ -4596,7 +4779,8 @@ "tld": ".ua", "constitutional_form": "republic", "language_codes": ["ru-UA", "uk-UA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1991 }, { "country": "united arab emirates", @@ -4621,7 +4805,8 @@ "tld": ".ae", "constitutional_form": "constitutional monarchy", "language_codes": ["ar-AE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1971 }, { "country": "united kingdom", @@ -4646,7 +4831,8 @@ "tld": ".gb/.uk", "constitutional_form": "constitutional monarchy", "language_codes": ["en-GB"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1776 }, { "country": "united states of america", @@ -4671,7 +4857,8 @@ "tld": ".us", "constitutional_form": "republic", "language_codes": ["en-US", "es-US"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1783 }, { "country": "uruguay", @@ -4696,7 +4883,8 @@ "tld": ".uy", "constitutional_form": "republic", "language_codes": ["sp-UY"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1825 }, { "country": "uzbekistan", @@ -4721,7 +4909,8 @@ "tld": ".uz", "constitutional_form": "republic", "language_codes": ["ru-UZ", "uz-UZ"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1991 }, { "country": "vanuatu", @@ -4746,7 +4935,8 @@ "tld": ".vu", "constitutional_form": "republic", "language_codes": ["bi-VU", "en-VU", "fr-VU"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1980 }, { "country": "vatican city", @@ -4771,7 +4961,8 @@ "tld": ".va", "constitutional_form": "absolute monarchy", "language_codes": ["it-VA", "la-VA"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1929 }, { "country": "venezuela", @@ -4796,7 +4987,8 @@ "tld": ".ve", "constitutional_form": "republic", "language_codes": ["es-VE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1811 }, { "country": "vietnam", @@ -4821,7 +5013,8 @@ "tld": ".vn", "constitutional_form": "republic", "language_codes": ["vi-VN"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1945 }, { "country": "yemen", @@ -4846,7 +5039,8 @@ "tld": ".ye", "constitutional_form": "n/a", "language_codes": ["ar-YE"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1967 }, { "country": "zambia", @@ -4871,7 +5065,8 @@ "tld": ".zm", "constitutional_form": "republic", "language_codes": ["en-ZM"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1964 }, { "country": "zimbabwe", @@ -4896,6 +5091,7 @@ "tld": ".zw", "constitutional_form": "republic", "language_codes": ["en-ZW"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1980 } ] From 755a99ce691c841ecffe5ffb90099029c8fb0b1b Mon Sep 17 00:00:00 2001 From: sthiepaan Date: Sat, 31 Oct 2020 18:56:28 +0100 Subject: [PATCH 2/5] Fix existing tests --- spec/getCountriesSpec.js | 100 +++++++++++++++++++++++++++------------ 1 file changed, 69 insertions(+), 31 deletions(-) diff --git a/spec/getCountriesSpec.js b/spec/getCountriesSpec.js index f5d7514..0485292 100644 --- a/spec/getCountriesSpec.js +++ b/spec/getCountriesSpec.js @@ -39,7 +39,8 @@ describe("The index", () => { "tld": ".af", "constitutional_form": "republic", "language_codes": ["fa-AF", "ps-AF"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1919, }); }); }); @@ -69,7 +70,8 @@ describe("The index", () => { "tld": ".al", "constitutional_form": "republic", "language_codes": ["sq-AL"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1912, }); }); }); @@ -105,7 +107,8 @@ describe("The index", () => { "tld": ".ba", "constitutional_form": "republic", "language_codes": ["bs-BA", "hr-BA", "sr-BA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1992, }); }); }); @@ -180,7 +183,7 @@ describe("The index", () => { ).toBeTrue(); }); }); - + describe("The getCountriesByAlcoholProhibition", () => { const results = countryApi.getCountriesByAlcoholProhibition("nationwide"); const expectedResults = [ @@ -200,7 +203,8 @@ describe("The index", () => { tld: '.af', constitutional_form: 'republic', language_codes: [ 'fa-AF', 'ps-AF' ], - is_landlocked: true + is_landlocked: true, + independence_year: 1919, }, { country: 'brunei', @@ -218,7 +222,8 @@ describe("The index", () => { tld: '.bn', constitutional_form: 'absolute monarchy', language_codes: [ 'ms-BN' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1984, }, { country: 'djibouti', @@ -236,7 +241,8 @@ describe("The index", () => { tld: '.dj', constitutional_form: 'republic', language_codes: [ 'ar-DJ', 'fr-DJ' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1977, }, { country: 'iran', @@ -254,7 +260,8 @@ describe("The index", () => { tld: '.ir', constitutional_form: 'republic', language_codes: [ 'fa-IR' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1979 }, { country: 'kuwait', @@ -272,7 +279,8 @@ describe("The index", () => { tld: '.kw', constitutional_form: 'constitutional monarchy', language_codes: [ 'ar-KW', 'en-KW' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1961, }, { country: 'libya', @@ -290,7 +298,8 @@ describe("The index", () => { tld: '.ly', constitutional_form: 'n/a', language_codes: [ 'ar-LY' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1951, }, { country: 'mauritania', @@ -308,7 +317,8 @@ describe("The index", () => { tld: '.mr', constitutional_form: 'republic', language_codes: [ 'ar-MR' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1960, }, { country: 'saudi arabia', @@ -326,7 +336,8 @@ describe("The index", () => { tld: '.sa', constitutional_form: 'absolute monarchy', language_codes: [ 'ar-SA' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1932, }, { country: 'somalia', @@ -344,9 +355,11 @@ describe("The index", () => { tld: '.so', constitutional_form: 'republic', language_codes: [ 'so-SO' ], - is_landlocked: false - } + is_landlocked: false, + independence_year: 1960, + } ]; + it("returns the details of all countries where nationwide alcohol prohibition is applicable", () => { expect(results).toEqual(expectedResults); }); @@ -354,6 +367,7 @@ describe("The index", () => { expect(countryApi.getCountriesByAlcoholProhibition("none").length).toEqual(176); }); }); + describe("The getCountryDetailsByCapital when given a capital", () => { it("returns the details of countries with that capital", () => { expect(countryApi.getCountryDetailsByCapital("kabul")[0]).toEqual({ @@ -379,7 +393,8 @@ describe("The index", () => { "tld": ".af", "constitutional_form": "republic", "language_codes": ["fa-AF", "ps-AF"], - "is_landlocked": true + "is_landlocked": true, + "independence_year": 1919, }); }); }); @@ -409,7 +424,8 @@ describe("The index", () => { "tld": ".al", "constitutional_form": "republic", "language_codes": ["sq-AL"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1912, }); }); }); @@ -445,7 +461,8 @@ describe("The index", () => { "tld": ".ba", "constitutional_form": "republic", "language_codes": ["bs-BA", "hr-BA", "sr-BA"], - "is_landlocked": false + "is_landlocked": false, + "independence_year": 1992, }); }); }); @@ -543,7 +560,8 @@ describe("The index", () => { tld: '.au', constitutional_form: 'constitutional monarchy', language_codes: [ 'en-AU' ], - is_landlocked: false + is_landlocked: false, + independence_year: 0, }, { country: 'fiji', @@ -561,7 +579,8 @@ describe("The index", () => { tld: '.fj', constitutional_form: 'republic', language_codes: [ 'en-FJ', 'fj-FJ' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1970, }, { country: 'kiribati', @@ -579,7 +598,8 @@ describe("The index", () => { tld: '.ki', constitutional_form: 'republic', language_codes: [ 'en-KI' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1979, }, { country: 'marshall islands', @@ -597,7 +617,8 @@ describe("The index", () => { tld: '.mh', constitutional_form: 'republic', language_codes: [ 'en-MH', 'mh-MH' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1986, }, { country: 'federal states of micronesia', @@ -615,7 +636,8 @@ describe("The index", () => { tld: '.fm', constitutional_form: 'republic', language_codes: [ 'en-FM' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1986, }, { country: 'nauru', @@ -633,7 +655,8 @@ describe("The index", () => { tld: '.nr', constitutional_form: 'republic', language_codes: [ 'en-NR', 'na-NR' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1968, }, { country: 'new zealand', @@ -651,7 +674,8 @@ describe("The index", () => { tld: '.nz', constitutional_form: 'constitutional monarchy', language_codes: [ 'en-NZ' ], - is_landlocked: false + is_landlocked: false, + independence_year: 0, }, { country: 'palau', @@ -669,7 +693,8 @@ describe("The index", () => { tld: '.pw', constitutional_form: 'republic', language_codes: [ 'en-PW' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1994, }, { country: 'papa new guinea', @@ -687,7 +712,8 @@ describe("The index", () => { tld: '.pg', constitutional_form: 'constitutional monarchy', language_codes: [ 'en-PG' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1975, }, { country: 'samoa', @@ -705,7 +731,8 @@ describe("The index", () => { tld: '.ws', constitutional_form: 'republic', language_codes: [ 'en-WS', 'sm-WS' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1962, }, { country: 'solomon islands', @@ -723,7 +750,8 @@ describe("The index", () => { tld: '.sb', constitutional_form: 'constitutional monarchy', language_codes: [ 'en-SB' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1978, }, { country: 'tonga', @@ -741,7 +769,8 @@ describe("The index", () => { tld: '.to', constitutional_form: 'constitutional monarchy', language_codes: [ 'en-TO', 'to-TO' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1970, }, { country: 'tuvalu', @@ -759,7 +788,8 @@ describe("The index", () => { tld: '.tv', constitutional_form: 'constitutional monarchy', language_codes: [ 'en-TV' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1978, }, { country: 'vanuatu', @@ -777,7 +807,8 @@ describe("The index", () => { tld: '.vu', constitutional_form: 'republic', language_codes: [ 'bi-VU', 'en-VU', 'fr-VU' ], - is_landlocked: false + is_landlocked: false, + independence_year: 1980, }, ]; const asiaCountries = countryApi.getCountriesByContinent("as"); @@ -826,6 +857,7 @@ describe("The index", () => { constitutional_form: "republic", language_codes: ["pl-PL"], is_landlocked: false, + independence_year: 1918, }; it("returns correct country using numeric ISO", () => { @@ -865,6 +897,7 @@ describe("The index", () => { constitutional_form: "republic", language_codes: ["pl-PL"], is_landlocked: false, + independence_year: 1918, }; const dotRSCountries = countryApi.getCountriesByTLD(".RS"); const expectedDotRSCountries = [ @@ -892,6 +925,7 @@ describe("The index", () => { constitutional_form: "republic", language_codes: ["sr-XK", "sq-XK"], is_landlocked: true, + independence_year: 2008, }, { country: "serbia", @@ -917,6 +951,7 @@ describe("The index", () => { constitutional_form: "republic", language_codes: ["sr-RS"], is_landlocked: true, + independence_year: 1804, }, ]; const [dotUKCountry] = countryApi.getCountriesByTLD(".uk"); @@ -944,6 +979,7 @@ describe("The index", () => { constitutional_form: "constitutional monarchy", language_codes: ["en-GB"], is_landlocked: false, + independence_year: 1776, }; const [dotGBCountry] = countryApi.getCountriesByTLD(".GB"); @@ -1021,6 +1057,7 @@ describe("The index", () => { "mi2": 252072, }, is_landlocked: true, + independence_year: 1919, }); }); @@ -1049,6 +1086,7 @@ describe("The index", () => { constitutional_form: "republic", language_codes: ["sq-AL"], is_landlocked: false, + independence_year: 1912, }); }); }); From 1aecf56dd06b7098ba4db9dc330f97bf2dac3e79 Mon Sep 17 00:00:00 2001 From: sthiepaan Date: Sat, 31 Oct 2020 19:47:53 +0100 Subject: [PATCH 3/5] Add 'getCountriesByIndependenceYearRange' Method --- index.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a01efa2..611787e 100644 --- a/index.js +++ b/index.js @@ -231,7 +231,7 @@ const getCountriesByConstitutionalForm = (constitutionalFormName) => { return result; } -/** +/** * Returns an array of objects containing all countries, each containing `country`, `capital`, * `currency`, `native_language`, `famous_for`, `phone_code`, `flag` and `drive_direction` filtered by `is_landlocked` * @param { Boolean } isLandLocked Country that is surrounded by one or more countries @@ -241,6 +241,18 @@ const getCountriesByLandLock = (isLandLocked) => { return data.filter( country => country.is_landlocked === isLandLocked); }; +/** + * Get list of countries that gained independence in range of years + * @param {Number} from - starting year + * @param {Number} [to] - ending year or current year (if not passed) + * @returns {Array} + */ +const getCountriesByIndependenceYearRange = (from, to) => { + to = to ? to : new Date().getFullYear(); + + return data.filter(({ independence_year: year }) => (year >= from && year <= to)); +}; + module.exports = { getRandomCountry, getNRandomCountriesData, @@ -257,4 +269,5 @@ module.exports = { getCountriesByTLD, getCountriesByConstitutionalForm, getCountriesByLandLock, + getCountriesByIndependenceYearRange, }; From 78b306e0c128aba0eaeee6d58ea22bec8ebc03a3 Mon Sep 17 00:00:00 2001 From: sthiepaan Date: Sat, 31 Oct 2020 19:48:26 +0100 Subject: [PATCH 4/5] Add 'getCountriesByIndependenceYearRange' Tests --- spec/getCountriesSpec.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/spec/getCountriesSpec.js b/spec/getCountriesSpec.js index 0485292..2a5e5ea 100644 --- a/spec/getCountriesSpec.js +++ b/spec/getCountriesSpec.js @@ -1090,4 +1090,33 @@ describe("The index", () => { }); }); }); + + describe("The getCountriesByIndependenceYearRange", () => { + const fifteenthCentury = countryApi.getCountriesByIndependenceYearRange(1501, 1600); + const nlCountry = countryApi.getCountriesByIndependenceYearRange(1581, 1600); + const seCountry = countryApi.getCountriesByIndependenceYearRange(1501, 1523); + const twentyFirstCentury = countryApi.getCountriesByIndependenceYearRange(2000); + const expectedNLCountry = countryApi.getCountryDetailsByName('netherlands'); + const expectedSECountry = countryApi.getCountryDetailsByName('sweden'); + const expectedFifteenthCenturyResult = [...expectedNLCountry, ...expectedSECountry]; + const expectedTwentyFirstCentury = [ + ...countryApi.getCountryDetailsByName('east timor'), + ...countryApi.getCountryDetailsByName('kosovo'), + ...countryApi.getCountryDetailsByName('montenegro'), + ...countryApi.getCountryDetailsByName('south sudan'), + ]; + + it("returns correct countries using both 'from' and 'to' parameters", () => { + expect(fifteenthCentury).toEqual(expectedFifteenthCenturyResult); + }); + it("returns correct countries using year of independence day as 'from' parameter", () => { + expect(nlCountry).toEqual(expectedNLCountry); + }); + it("returns correct countries using year of independence day as 'to' parameter", () => { + expect(seCountry).toEqual(expectedSECountry); + }); + it("returns correct list of countries using only 'from' parameter", () => { + expect(twentyFirstCentury).toEqual(expectedTwentyFirstCentury); + }); + }) }); From 9863d1f27120d4d8c9b965def1f58e6b06e54c77 Mon Sep 17 00:00:00 2001 From: sthiepaan Date: Sat, 31 Oct 2020 20:06:46 +0100 Subject: [PATCH 5/5] Document 'getCountriesByIndependenceYearRange' Method --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 578c8ab..5e80690 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ Currently available data for each country is: - **constitutional_form** - official political system - **language_codes** - list of langauge codes (combination of _ISO 639-1_ and _ISO 3166-1 alpha-2_) - **is_landlocked** - information whether country is surrounded by one or more countries +- **independence_year** - year when country gained independence You can check all changes in the project at [releases page on Github][URL_GH_RELEASES] or in [changelog][DOC_CHANGELOG]. @@ -140,6 +141,7 @@ Type definition of each `Country {Object}`: * @property {String} constitutional_form - Name of official political system * @property {String[]} language_codes - Array of language codes * @property {Boolean} is_landlocked - Is country surrounded by one or more countries + * @property {Number} independence_year - Country independence year */ ``` @@ -168,7 +170,8 @@ Sample `Country {Object}`: tld: '.pl', constitutional_form: 'republic', language_codes: ['pl-PL'], - is_landlocked: false + is_landlocked: false, + independence_year: 1918, } ``` @@ -327,6 +330,17 @@ wcc.getCountriesByLandLock(isLandLocked) // Example: wcc.getCountriesByLandLock(true) ``` +```js +/** + * Get list of countries that gained independence in range of years + * @param {Number} from - starting year + * @param {Number} [to] - ending year or current year (if not passed) + * @returns {Country[]} + */ +wcc.getCountriesByIndependenceYearRange(from, to) +// Example: wcc.getCountriesByIndependenceYearRange(1400, 1950) +``` + ❗️ All params are **NOT** case sensitive so no matter how argument looks, the response will remain the same.