Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@volvo-cars/market-sites

Package Overview
Dependencies
Maintainers
11
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volvo-cars/market-sites - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

dist/index.esm.js

@@ -1,2 +0,2 @@

for(var e={ar:["العربية","Arabic",!0],az:["azəri","Azerbaijani"],be:["беларуская","Belarusian"],bg:["български","Bulgarian"],bs:["bosanski","Bosnian"],cs:["čeština","Czech"],da:["dansk","Danish"],de:["Deutsch","German"],el:["Ελληνικά","Greek"],en:["English","English"],es:["español","Spanish"],et:["eesti","Estonian"],fi:["suomi","Finnish"],fr:["français","French"],he:["עברית","Hebrew",!0],hr:["hrvatski","Croatian"],hu:["magyar","Hungarian"],hy:["հայերեն","Armenian"],id:["Indonesia","Indonesian"],is:["íslenska","Icelandic"],it:["italiano","Italian"],ja:["日本語","Japanese"],ka:["ქართული","Georgian"],ko:["한국어","Korean"],km:["ខ្មែរ","Khmer"],lt:["lietuvių","Lithuanian"],lv:["latviešu","Latvian"],mk:["македонски","Macedonian"],no:["norsk","Norwegian"],nl:["Nederlands","Dutch"],pl:["polski","Polish"],pt:["português","Portuguese"],ro:["română","Romanian"],"ro-MD":["română","Moldavian"],ru:["русский","Russian"],sk:["slovenčina","Slovak"],sl:["slovenščina","Slovenian"],sq:["shqip","Albanian"],"sr-Latn":["srpski","Serbian"],"sr-ME":["crnogorski","Montenegrin"],sv:["svenska","Swedish"],th:["ไทย","Thai"],tr:["Türkçe","Turkish"],uk:["українська","Ukrainian"],vi:["Tiếng Việt","Vietnamese"],zh:["中文","Chinese"]},n={"001":"International",AE:"United Arab Emirates",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AT:"Austria",AU:"Australia",AZ:"Azerbaijan",BA:"Bosnia & Herzegovina",BE:"Belgium",BG:"Bulgaria",BH:"Bahrain",BR:"Brazil",BW:"Botswana",BY:"Belarus",CA:"Canada",CH:"Switzerland",CL:"Chile",CN:"China",CO:"Colombia",CR:"Costa Rica",CY:"Cyprus",CZ:"Czechia",DE:"Germany",DK:"Denmark",DO:"Dominican Republic",EC:"Ecuador",EE:"Estonia",EG:"Egypt",ER:"Eritrea",ES:"Spain",FI:"Finland",FR:"France",GB:"United Kingdom",GE:"Georgia",GR:"Greece",GT:"Guatemala",HK:"Hong Kong, China",HR:"Croatia",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IN:"India",IS:"Iceland",IT:"Italy",JO:"Jordan",JP:"Japan",KE:"Kenya",KH:"Cambodia",KR:"Korea",KW:"Kuwait",LB:"Lebanon",LK:"Sri Lanka",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MA:"Morocco",MD:"Moldova",ME:"Montenegro",MK:"North Macedonia",MM:"Myanmar",MT:"Malta",MU:"Mauritius",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NL:"Netherlands",NO:"Norway",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Perú",PH:"Philippines",PL:"Poland",PR:"Puerto Rico",PT:"Portugal",PY:"Paraguay",QA:"Qatar",RO:"Romania",RS:"Serbia",RU:"Russia",SA:"Saudi Arabia",SE:"Sweden",SG:"Singapore",SI:"Slovenia",SK:"Slovakia",TH:"Thailand",TR:"Turkey",TW:"Taiwan, China",UA:"Ukraine",US:"United States",UY:"Uruguay",VN:"Vietnam",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",XA:"Armoured Cars",XD:"Diplomat",XM:"Military",XP:"Police",XX:"Master"},a={intl:["001","en"],"armoured-cars":["XA","en"],diplomat:["XD","en"],military:["XM","en"],police:["XP","en"],master:["XX","en"],al:["AL","sq"],ao:["AO","pt"],ar:["AR","es"],"hy-am":["AM","hy"],"en-am":["AM","en"],au:["AU","en"],at:["AT","de"],az:["AZ","az"],"ar-bh":["BH","ar"],"en-bh":["BH","en"],by:["BY","be"],"fr-be":["BE","fr"],"nl-be":["BE","nl"],ba:["BA","bs"],bw:["BW","en"],br:["BR","pt"],bg:["BG","bg"],kh:["KH","en"],"en-ca":["CA","en"],"fr-ca":["CA","fr"],cl:["CL","es"],"zh-cn":["CN","zh"],hk:["HK","en"],tw:["TW","zh"],co:["CO","es"],cr:["CR","es"],hr:["HR","hr"],cy:["CY","en"],cz:["CZ","cs"],dk:["DK","da"],do:["DO","es"],ec:["EC","es"],"ar-eg":["EG","ar"],"en-eg":["EG","en"],"et-ee":["EE","et"],fi:["FI","fi"],fr:["FR","fr"],ge:["GE","ka"],de:["DE","de"],gr:["GR","el"],gt:["GT","es"],hu:["HU","hu"],in:["IN","en"],id:["ID","id"],it:["IT","it"],is:["IS","is"],ie:["IE","en"],il:["IL","he"],jp:["JP","ja"],"ar-jo":["JO","ar"],"en-jo":["JO","en"],ke:["KE","en"],"ar-kw":["KW","ar"],"en-kw":["KW","en"],"lv-lv":["LV","lv"],lb:["LB","en"],"lt-lt":["LT","lt"],lu:["LU","fr"],mk:["MK","mk"],mt:["MT","en"],my:["MY","en"],mu:["MU","en"],mx:["MX","es"],"ru-md":["MD","ru"],"ro-md":["MD","ro-MD"],me:["ME","sr-ME"],ma:["MA","fr"],mz:["MZ","pt"],mm:["MM","en"],na:["NA","en"],nl:["NL","nl"],nz:["NZ","en"],no:["NO","no"],"ar-om":["OM","ar"],"en-om":["OM","en"],pa:["PA","es"],py:["PY","es"],pl:["PL","pl"],pt:["PT","pt"],pe:["PE","es"],ph:["PH","en"],pr:["PR","en"],"ar-qa":["QA","ar"],"en-qa":["QA","en"],ro:["RO","ro"],ru:["RU","ru"],"ar-sa":["SA","ar"],"en-sa":["SA","en"],rs:["RS","sr-Latn"],sg:["SG","en"],sk:["SK","sk"],si:["SI","sl"],za:["ZA","en"],kr:["KR","ko"],es:["ES","es"],lk:["LK","en"],se:["SE","sv"],"fr-ch":["CH","fr"],"de-ch":["CH","de"],"it-ch":["CH","it"],"en-th":["TH","en"],"th-th":["TH","th"],tr:["TR","tr"],"uk-ua":["UA","uk"],"ar-ae":["AE","ar"],"en-ae":["AE","en"],uk:["GB","en"],us:["US","en"],uy:["UY","es"],"en-vn":["VN","en"],"vi-vn":["VN","vi"],zm:["ZM","en"],zw:["ZW","en"]},r={},i={},t=0,o=Object.entries(a);t<o.length;t++){var s=o[t],l=s[0],u=s[1],h=u[0],g=u[1];r[h]||(r[h]=[]),r[h].push(l),i[g]||(i[g]=[]),i[g].push(l)}var m={"001":"kilometer",US:"mile",GB:"mile"},c=/^[a-zA-Z][a-zA-Z-]*[a-zA-Z]$/;function d(e){if("string"!=typeof e)throw new TypeError("Site slug should be a string, got '"+typeof e+"'");if(""===e)throw new TypeError("Site slug should not be empty");if(!c.test(e))throw new TypeError("Invalid site slug '"+e+"'");if(!(e in a))throw new TypeError("No such market site '"+e+"'")}function A(e){try{d(e)}catch(e){return!1}return!0}var p=function(a,t,o){var s=e[a],l=s[0],u=s[1],h=s[2];this.marketName=n[t],this.regionCode=t,this.siteSlug=o,this.languageName=u,this.localizedLanguageName=l,Object.defineProperties(this,{href:{enumerable:!0,get:function(){return o?"/"+o:"/"}},locale:{enumerable:!0,get:function(){return!t||a.endsWith("-"+t)||(null==t?void 0:t.startsWith("X"))?a:a+"-"+t}},languageCode:{enumerable:!0,get:function(){return a.includes("-")?a.substring(0,a.indexOf("-")):a}},languageDirection:{enumerable:!0,get:function(){return h?"rtl":"ltr"}},multilingual:{enumerable:!0,get:function(){var e;return o?(null==(e=r[t])?void 0:e.length)>1:void 0}},htmlLanguage:{enumerable:!0,get:function(){return 1===i[a].length||(null==t?void 0:t.match(/\d+/))?a:this.locale}},roadLengthUnit:{enumerable:!0,get:function(){return m[t]||m["001"]}}})};function f(e){var n=function(e){var n=e;if("string"!=typeof n)return n;if(n.startsWith("/")){var a=n.replace(/\/+/g,"/").split("/");a.length>1&&(n=a[1])}return n.toLowerCase()}(e);if(!A(n))return new p("en");var r=a[n];return new p(r[1],r[0],n)}function M(){return Object.keys(a).map(function(e){return f(e)})}function b(e){if("string"!=typeof e)throw new TypeError("Invalid region code. Expected string, got "+typeof e);var n=r[e.toUpperCase()];return n&&n.length>0?n.map(function(e){return f(e)}):[]}function E(e,n){return b(e).find(function(e){return e.languageCode===(null==n?void 0:n.toLowerCase())})}export{M as getAllMarketSites,f as getMarketSite,E as getMarketSiteByRegionAndLanguage,b as getMarketSitesByRegion,A as isValidSiteSlug,d as validateSiteSlug};
for(var e={ar:["العربية","Arabic",!0],az:["azəri","Azerbaijani"],be:["беларуская","Belarusian"],bg:["български","Bulgarian"],bs:["bosanski","Bosnian"],cs:["čeština","Czech"],da:["dansk","Danish"],de:["Deutsch","German"],el:["Ελληνικά","Greek"],en:["English","English"],es:["español","Spanish"],et:["eesti","Estonian"],fi:["suomi","Finnish"],fr:["français","French"],he:["עברית","Hebrew",!0],hr:["hrvatski","Croatian"],hu:["magyar","Hungarian"],hy:["հայերեն","Armenian"],id:["Indonesia","Indonesian"],is:["íslenska","Icelandic"],it:["italiano","Italian"],ja:["日本語","Japanese"],ka:["ქართული","Georgian"],ko:["한국어","Korean"],km:["ខ្មែរ","Khmer"],lt:["lietuvių","Lithuanian"],lv:["latviešu","Latvian"],mk:["македонски","Macedonian"],no:["norsk","Norwegian"],nl:["Nederlands","Dutch"],pl:["polski","Polish"],pt:["português","Portuguese"],ro:["română","Romanian"],"ro-MD":["română","Moldavian"],ru:["русский","Russian"],sk:["slovenčina","Slovak"],sl:["slovenščina","Slovenian"],sq:["shqip","Albanian"],"sr-Latn":["srpski","Serbian"],"sr-ME":["crnogorski","Montenegrin"],sv:["svenska","Swedish"],th:["ไทย","Thai"],tr:["Türkçe","Turkish"],uk:["українська","Ukrainian"],vi:["Tiếng Việt","Vietnamese"],zh:["中文","Chinese"]},n={"001":"International",AE:"United Arab Emirates",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AT:"Austria",AU:"Australia",AZ:"Azerbaijan",BA:"Bosnia & Herzegovina",BE:"Belgium",BG:"Bulgaria",BH:"Bahrain",BR:"Brazil",BW:"Botswana",BY:"Belarus",CA:"Canada",CH:"Switzerland",CL:"Chile",CN:"China",CO:"Colombia",CR:"Costa Rica",CY:"Cyprus",CZ:"Czechia",DE:"Germany",DK:"Denmark",DO:"Dominican Republic",EC:"Ecuador",EE:"Estonia",EG:"Egypt",ER:"Eritrea",ES:"Spain",FI:"Finland",FR:"France",GB:"United Kingdom",GE:"Georgia",GR:"Greece",GT:"Guatemala",HK:"Hong Kong, China",HR:"Croatia",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IN:"India",IS:"Iceland",IT:"Italy",JO:"Jordan",JP:"Japan",KE:"Kenya",KH:"Cambodia",KR:"Korea",KW:"Kuwait",LB:"Lebanon",LK:"Sri Lanka",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MA:"Morocco",MD:"Moldova",ME:"Montenegro",MK:"North Macedonia",MM:"Myanmar",MT:"Malta",MU:"Mauritius",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NL:"Netherlands",NO:"Norway",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Perú",PH:"Philippines",PL:"Poland",PR:"Puerto Rico",PT:"Portugal",PY:"Paraguay",QA:"Qatar",RO:"Romania",RS:"Serbia",RU:"Russia",SA:"Saudi Arabia",SE:"Sweden",SG:"Singapore",SI:"Slovenia",SK:"Slovakia",TH:"Thailand",TR:"Turkey",TW:"Taiwan",UA:"Ukraine",US:"United States",UY:"Uruguay",VN:"Vietnam",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",XA:"Armoured Cars",XD:"Diplomat",XM:"Military",XP:"Police",XX:"Master"},a={intl:["001","en"],"armoured-cars":["XA","en"],diplomat:["XD","en"],military:["XM","en"],police:["XP","en"],master:["XX","en"],al:["AL","sq"],ao:["AO","pt"],ar:["AR","es"],"hy-am":["AM","hy"],"en-am":["AM","en"],au:["AU","en"],at:["AT","de"],az:["AZ","az"],"ar-bh":["BH","ar"],"en-bh":["BH","en"],by:["BY","be"],"fr-be":["BE","fr"],"nl-be":["BE","nl"],ba:["BA","bs"],bw:["BW","en"],br:["BR","pt"],bg:["BG","bg"],kh:["KH","en"],"en-ca":["CA","en"],"fr-ca":["CA","fr"],cl:["CL","es"],"zh-cn":["CN","zh"],hk:["HK","en"],tw:["TW","zh"],co:["CO","es"],cr:["CR","es"],hr:["HR","hr"],cy:["CY","en"],cz:["CZ","cs"],dk:["DK","da"],do:["DO","es"],ec:["EC","es"],"ar-eg":["EG","ar"],"en-eg":["EG","en"],"et-ee":["EE","et"],fi:["FI","fi"],fr:["FR","fr"],ge:["GE","ka"],de:["DE","de"],gr:["GR","el"],gt:["GT","es"],hu:["HU","hu"],in:["IN","en"],id:["ID","id"],it:["IT","it"],is:["IS","is"],ie:["IE","en"],il:["IL","he"],jp:["JP","ja"],"ar-jo":["JO","ar"],"en-jo":["JO","en"],ke:["KE","en"],"ar-kw":["KW","ar"],"en-kw":["KW","en"],"lv-lv":["LV","lv"],lb:["LB","en"],"lt-lt":["LT","lt"],lu:["LU","fr"],mk:["MK","mk"],mt:["MT","en"],my:["MY","en"],mu:["MU","en"],mx:["MX","es"],"ru-md":["MD","ru"],"ro-md":["MD","ro-MD"],me:["ME","sr-ME"],ma:["MA","fr"],mz:["MZ","pt"],mm:["MM","en"],na:["NA","en"],nl:["NL","nl"],nz:["NZ","en"],no:["NO","no"],"ar-om":["OM","ar"],"en-om":["OM","en"],pa:["PA","es"],py:["PY","es"],pl:["PL","pl"],pt:["PT","pt"],pe:["PE","es"],ph:["PH","en"],pr:["PR","en"],"ar-qa":["QA","ar"],"en-qa":["QA","en"],ro:["RO","ro"],ru:["RU","ru"],"ar-sa":["SA","ar"],"en-sa":["SA","en"],rs:["RS","sr-Latn"],sg:["SG","en"],sk:["SK","sk"],si:["SI","sl"],za:["ZA","en"],kr:["KR","ko"],es:["ES","es"],lk:["LK","en"],se:["SE","sv"],"fr-ch":["CH","fr"],"de-ch":["CH","de"],"it-ch":["CH","it"],"en-th":["TH","en"],"th-th":["TH","th"],tr:["TR","tr"],"uk-ua":["UA","uk"],"ar-ae":["AE","ar"],"en-ae":["AE","en"],uk:["GB","en"],us:["US","en"],uy:["UY","es"],"en-vn":["VN","en"],"vi-vn":["VN","vi"],zm:["ZM","en"],zw:["ZW","en"]},r={},i={},t=0,o=Object.entries(a);t<o.length;t++){var s=o[t],l=s[0],u=s[1],h=u[0],g=u[1];r[h]||(r[h]=[]),r[h].push(l),i[g]||(i[g]=[]),i[g].push(l)}var m={"001":"kilometer",US:"mile",GB:"mile"},c=/^[a-zA-Z][a-zA-Z-]*[a-zA-Z]$/;function d(e){if("string"!=typeof e)throw new TypeError("Site slug should be a string, got '"+typeof e+"'");if(""===e)throw new TypeError("Site slug should not be empty");if(!c.test(e))throw new TypeError("Invalid site slug '"+e+"'");if(!(e in a))throw new TypeError("No such market site '"+e+"'")}function A(e){try{d(e)}catch(e){return!1}return!0}var p=function(a,t,o){var s=e[a],l=s[0],u=s[1],h=s[2];this.marketName=n[t],this.regionCode=t,this.siteSlug=o,this.languageName=u,this.localizedLanguageName=l,Object.defineProperties(this,{href:{enumerable:!0,get:function(){return o?"/"+o:"/"}},locale:{enumerable:!0,get:function(){return!t||a.endsWith("-"+t)||(null==t?void 0:t.startsWith("X"))?a:a+"-"+t}},languageCode:{enumerable:!0,get:function(){return a.includes("-")?a.substring(0,a.indexOf("-")):a}},languageDirection:{enumerable:!0,get:function(){return h?"rtl":"ltr"}},multilingual:{enumerable:!0,get:function(){var e;return o?(null==(e=r[t])?void 0:e.length)>1:void 0}},htmlLanguage:{enumerable:!0,get:function(){return 1===i[a].length||(null==t?void 0:t.match(/\d+/))?a:this.locale}},roadLengthUnit:{enumerable:!0,get:function(){return m[t]||m["001"]}}})};function f(e){var n=function(e){var n=e;if("string"!=typeof n)return n;if(n.startsWith("/")){var a=n.replace(/\/+/g,"/").split("/");a.length>1&&(n=a[1])}return n.toLowerCase()}(e);if(!A(n))return new p("en");var r=a[n];return new p(r[1],r[0],n)}function M(){return Object.keys(a).map(function(e){return f(e)})}function b(e){if("string"!=typeof e)throw new TypeError("Invalid region code. Expected string, got "+typeof e);var n=r[e.toUpperCase()];return n&&n.length>0?n.map(function(e){return f(e)}):[]}function E(e,n){return b(e).find(function(e){return e.languageCode===(null==n?void 0:n.toLowerCase())})}export{M as getAllMarketSites,f as getMarketSite,E as getMarketSiteByRegionAndLanguage,b as getMarketSitesByRegion,A as isValidSiteSlug,d as validateSiteSlug};
//# sourceMappingURL=index.esm.js.map

@@ -1,2 +0,2 @@

for(var e={ar:["العربية","Arabic",!0],az:["azəri","Azerbaijani"],be:["беларуская","Belarusian"],bg:["български","Bulgarian"],bs:["bosanski","Bosnian"],cs:["čeština","Czech"],da:["dansk","Danish"],de:["Deutsch","German"],el:["Ελληνικά","Greek"],en:["English","English"],es:["español","Spanish"],et:["eesti","Estonian"],fi:["suomi","Finnish"],fr:["français","French"],he:["עברית","Hebrew",!0],hr:["hrvatski","Croatian"],hu:["magyar","Hungarian"],hy:["հայերեն","Armenian"],id:["Indonesia","Indonesian"],is:["íslenska","Icelandic"],it:["italiano","Italian"],ja:["日本語","Japanese"],ka:["ქართული","Georgian"],ko:["한국어","Korean"],km:["ខ្មែរ","Khmer"],lt:["lietuvių","Lithuanian"],lv:["latviešu","Latvian"],mk:["македонски","Macedonian"],no:["norsk","Norwegian"],nl:["Nederlands","Dutch"],pl:["polski","Polish"],pt:["português","Portuguese"],ro:["română","Romanian"],"ro-MD":["română","Moldavian"],ru:["русский","Russian"],sk:["slovenčina","Slovak"],sl:["slovenščina","Slovenian"],sq:["shqip","Albanian"],"sr-Latn":["srpski","Serbian"],"sr-ME":["crnogorski","Montenegrin"],sv:["svenska","Swedish"],th:["ไทย","Thai"],tr:["Türkçe","Turkish"],uk:["українська","Ukrainian"],vi:["Tiếng Việt","Vietnamese"],zh:["中文","Chinese"]},n={"001":"International",AE:"United Arab Emirates",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AT:"Austria",AU:"Australia",AZ:"Azerbaijan",BA:"Bosnia & Herzegovina",BE:"Belgium",BG:"Bulgaria",BH:"Bahrain",BR:"Brazil",BW:"Botswana",BY:"Belarus",CA:"Canada",CH:"Switzerland",CL:"Chile",CN:"China",CO:"Colombia",CR:"Costa Rica",CY:"Cyprus",CZ:"Czechia",DE:"Germany",DK:"Denmark",DO:"Dominican Republic",EC:"Ecuador",EE:"Estonia",EG:"Egypt",ER:"Eritrea",ES:"Spain",FI:"Finland",FR:"France",GB:"United Kingdom",GE:"Georgia",GR:"Greece",GT:"Guatemala",HK:"Hong Kong, China",HR:"Croatia",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IN:"India",IS:"Iceland",IT:"Italy",JO:"Jordan",JP:"Japan",KE:"Kenya",KH:"Cambodia",KR:"Korea",KW:"Kuwait",LB:"Lebanon",LK:"Sri Lanka",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MA:"Morocco",MD:"Moldova",ME:"Montenegro",MK:"North Macedonia",MM:"Myanmar",MT:"Malta",MU:"Mauritius",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NL:"Netherlands",NO:"Norway",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Perú",PH:"Philippines",PL:"Poland",PR:"Puerto Rico",PT:"Portugal",PY:"Paraguay",QA:"Qatar",RO:"Romania",RS:"Serbia",RU:"Russia",SA:"Saudi Arabia",SE:"Sweden",SG:"Singapore",SI:"Slovenia",SK:"Slovakia",TH:"Thailand",TR:"Turkey",TW:"Taiwan, China",UA:"Ukraine",US:"United States",UY:"Uruguay",VN:"Vietnam",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",XA:"Armoured Cars",XD:"Diplomat",XM:"Military",XP:"Police",XX:"Master"},a={intl:["001","en"],"armoured-cars":["XA","en"],diplomat:["XD","en"],military:["XM","en"],police:["XP","en"],master:["XX","en"],al:["AL","sq"],ao:["AO","pt"],ar:["AR","es"],"hy-am":["AM","hy"],"en-am":["AM","en"],au:["AU","en"],at:["AT","de"],az:["AZ","az"],"ar-bh":["BH","ar"],"en-bh":["BH","en"],by:["BY","be"],"fr-be":["BE","fr"],"nl-be":["BE","nl"],ba:["BA","bs"],bw:["BW","en"],br:["BR","pt"],bg:["BG","bg"],kh:["KH","en"],"en-ca":["CA","en"],"fr-ca":["CA","fr"],cl:["CL","es"],"zh-cn":["CN","zh"],hk:["HK","en"],tw:["TW","zh"],co:["CO","es"],cr:["CR","es"],hr:["HR","hr"],cy:["CY","en"],cz:["CZ","cs"],dk:["DK","da"],do:["DO","es"],ec:["EC","es"],"ar-eg":["EG","ar"],"en-eg":["EG","en"],"et-ee":["EE","et"],fi:["FI","fi"],fr:["FR","fr"],ge:["GE","ka"],de:["DE","de"],gr:["GR","el"],gt:["GT","es"],hu:["HU","hu"],in:["IN","en"],id:["ID","id"],it:["IT","it"],is:["IS","is"],ie:["IE","en"],il:["IL","he"],jp:["JP","ja"],"ar-jo":["JO","ar"],"en-jo":["JO","en"],ke:["KE","en"],"ar-kw":["KW","ar"],"en-kw":["KW","en"],"lv-lv":["LV","lv"],lb:["LB","en"],"lt-lt":["LT","lt"],lu:["LU","fr"],mk:["MK","mk"],mt:["MT","en"],my:["MY","en"],mu:["MU","en"],mx:["MX","es"],"ru-md":["MD","ru"],"ro-md":["MD","ro-MD"],me:["ME","sr-ME"],ma:["MA","fr"],mz:["MZ","pt"],mm:["MM","en"],na:["NA","en"],nl:["NL","nl"],nz:["NZ","en"],no:["NO","no"],"ar-om":["OM","ar"],"en-om":["OM","en"],pa:["PA","es"],py:["PY","es"],pl:["PL","pl"],pt:["PT","pt"],pe:["PE","es"],ph:["PH","en"],pr:["PR","en"],"ar-qa":["QA","ar"],"en-qa":["QA","en"],ro:["RO","ro"],ru:["RU","ru"],"ar-sa":["SA","ar"],"en-sa":["SA","en"],rs:["RS","sr-Latn"],sg:["SG","en"],sk:["SK","sk"],si:["SI","sl"],za:["ZA","en"],kr:["KR","ko"],es:["ES","es"],lk:["LK","en"],se:["SE","sv"],"fr-ch":["CH","fr"],"de-ch":["CH","de"],"it-ch":["CH","it"],"en-th":["TH","en"],"th-th":["TH","th"],tr:["TR","tr"],"uk-ua":["UA","uk"],"ar-ae":["AE","ar"],"en-ae":["AE","en"],uk:["GB","en"],us:["US","en"],uy:["UY","es"],"en-vn":["VN","en"],"vi-vn":["VN","vi"],zm:["ZM","en"],zw:["ZW","en"]},r={},i={},t=0,o=Object.entries(a);t<o.length;t++){var s=o[t],l=s[0],u=s[1],g=u[0],h=u[1];r[g]||(r[g]=[]),r[g].push(l),i[h]||(i[h]=[]),i[h].push(l)}var m={"001":"kilometer",US:"mile",GB:"mile"},d=/^[a-zA-Z][a-zA-Z-]*[a-zA-Z]$/;function c(e){if("string"!=typeof e)throw new TypeError("Site slug should be a string, got '"+typeof e+"'");if(""===e)throw new TypeError("Site slug should not be empty");if(!d.test(e))throw new TypeError("Invalid site slug '"+e+"'");if(!(e in a))throw new TypeError("No such market site '"+e+"'")}function A(e){try{c(e)}catch(e){return!1}return!0}var p=function(a,t,o){var s=e[a],l=s[0],u=s[1],g=s[2];this.marketName=n[t],this.regionCode=t,this.siteSlug=o,this.languageName=u,this.localizedLanguageName=l,Object.defineProperties(this,{href:{enumerable:!0,get:function(){return o?"/"+o:"/"}},locale:{enumerable:!0,get:function(){return!t||a.endsWith("-"+t)||(null==t?void 0:t.startsWith("X"))?a:a+"-"+t}},languageCode:{enumerable:!0,get:function(){return a.includes("-")?a.substring(0,a.indexOf("-")):a}},languageDirection:{enumerable:!0,get:function(){return g?"rtl":"ltr"}},multilingual:{enumerable:!0,get:function(){var e;return o?(null==(e=r[t])?void 0:e.length)>1:void 0}},htmlLanguage:{enumerable:!0,get:function(){return 1===i[a].length||(null==t?void 0:t.match(/\d+/))?a:this.locale}},roadLengthUnit:{enumerable:!0,get:function(){return m[t]||m["001"]}}})};function M(e){var n=function(e){var n=e;if("string"!=typeof n)return n;if(n.startsWith("/")){var a=n.replace(/\/+/g,"/").split("/");a.length>1&&(n=a[1])}return n.toLowerCase()}(e);if(!A(n))return new p("en");var r=a[n];return new p(r[1],r[0],n)}function f(e){if("string"!=typeof e)throw new TypeError("Invalid region code. Expected string, got "+typeof e);var n=r[e.toUpperCase()];return n&&n.length>0?n.map(function(e){return M(e)}):[]}exports.getAllMarketSites=function(){return Object.keys(a).map(function(e){return M(e)})},exports.getMarketSite=M,exports.getMarketSiteByRegionAndLanguage=function(e,n){return f(e).find(function(e){return e.languageCode===(null==n?void 0:n.toLowerCase())})},exports.getMarketSitesByRegion=f,exports.isValidSiteSlug=A,exports.validateSiteSlug=c;
for(var e={ar:["العربية","Arabic",!0],az:["azəri","Azerbaijani"],be:["беларуская","Belarusian"],bg:["български","Bulgarian"],bs:["bosanski","Bosnian"],cs:["čeština","Czech"],da:["dansk","Danish"],de:["Deutsch","German"],el:["Ελληνικά","Greek"],en:["English","English"],es:["español","Spanish"],et:["eesti","Estonian"],fi:["suomi","Finnish"],fr:["français","French"],he:["עברית","Hebrew",!0],hr:["hrvatski","Croatian"],hu:["magyar","Hungarian"],hy:["հայերեն","Armenian"],id:["Indonesia","Indonesian"],is:["íslenska","Icelandic"],it:["italiano","Italian"],ja:["日本語","Japanese"],ka:["ქართული","Georgian"],ko:["한국어","Korean"],km:["ខ្មែរ","Khmer"],lt:["lietuvių","Lithuanian"],lv:["latviešu","Latvian"],mk:["македонски","Macedonian"],no:["norsk","Norwegian"],nl:["Nederlands","Dutch"],pl:["polski","Polish"],pt:["português","Portuguese"],ro:["română","Romanian"],"ro-MD":["română","Moldavian"],ru:["русский","Russian"],sk:["slovenčina","Slovak"],sl:["slovenščina","Slovenian"],sq:["shqip","Albanian"],"sr-Latn":["srpski","Serbian"],"sr-ME":["crnogorski","Montenegrin"],sv:["svenska","Swedish"],th:["ไทย","Thai"],tr:["Türkçe","Turkish"],uk:["українська","Ukrainian"],vi:["Tiếng Việt","Vietnamese"],zh:["中文","Chinese"]},n={"001":"International",AE:"United Arab Emirates",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AT:"Austria",AU:"Australia",AZ:"Azerbaijan",BA:"Bosnia & Herzegovina",BE:"Belgium",BG:"Bulgaria",BH:"Bahrain",BR:"Brazil",BW:"Botswana",BY:"Belarus",CA:"Canada",CH:"Switzerland",CL:"Chile",CN:"China",CO:"Colombia",CR:"Costa Rica",CY:"Cyprus",CZ:"Czechia",DE:"Germany",DK:"Denmark",DO:"Dominican Republic",EC:"Ecuador",EE:"Estonia",EG:"Egypt",ER:"Eritrea",ES:"Spain",FI:"Finland",FR:"France",GB:"United Kingdom",GE:"Georgia",GR:"Greece",GT:"Guatemala",HK:"Hong Kong, China",HR:"Croatia",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IN:"India",IS:"Iceland",IT:"Italy",JO:"Jordan",JP:"Japan",KE:"Kenya",KH:"Cambodia",KR:"Korea",KW:"Kuwait",LB:"Lebanon",LK:"Sri Lanka",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",MA:"Morocco",MD:"Moldova",ME:"Montenegro",MK:"North Macedonia",MM:"Myanmar",MT:"Malta",MU:"Mauritius",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NL:"Netherlands",NO:"Norway",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Perú",PH:"Philippines",PL:"Poland",PR:"Puerto Rico",PT:"Portugal",PY:"Paraguay",QA:"Qatar",RO:"Romania",RS:"Serbia",RU:"Russia",SA:"Saudi Arabia",SE:"Sweden",SG:"Singapore",SI:"Slovenia",SK:"Slovakia",TH:"Thailand",TR:"Turkey",TW:"Taiwan",UA:"Ukraine",US:"United States",UY:"Uruguay",VN:"Vietnam",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",XA:"Armoured Cars",XD:"Diplomat",XM:"Military",XP:"Police",XX:"Master"},a={intl:["001","en"],"armoured-cars":["XA","en"],diplomat:["XD","en"],military:["XM","en"],police:["XP","en"],master:["XX","en"],al:["AL","sq"],ao:["AO","pt"],ar:["AR","es"],"hy-am":["AM","hy"],"en-am":["AM","en"],au:["AU","en"],at:["AT","de"],az:["AZ","az"],"ar-bh":["BH","ar"],"en-bh":["BH","en"],by:["BY","be"],"fr-be":["BE","fr"],"nl-be":["BE","nl"],ba:["BA","bs"],bw:["BW","en"],br:["BR","pt"],bg:["BG","bg"],kh:["KH","en"],"en-ca":["CA","en"],"fr-ca":["CA","fr"],cl:["CL","es"],"zh-cn":["CN","zh"],hk:["HK","en"],tw:["TW","zh"],co:["CO","es"],cr:["CR","es"],hr:["HR","hr"],cy:["CY","en"],cz:["CZ","cs"],dk:["DK","da"],do:["DO","es"],ec:["EC","es"],"ar-eg":["EG","ar"],"en-eg":["EG","en"],"et-ee":["EE","et"],fi:["FI","fi"],fr:["FR","fr"],ge:["GE","ka"],de:["DE","de"],gr:["GR","el"],gt:["GT","es"],hu:["HU","hu"],in:["IN","en"],id:["ID","id"],it:["IT","it"],is:["IS","is"],ie:["IE","en"],il:["IL","he"],jp:["JP","ja"],"ar-jo":["JO","ar"],"en-jo":["JO","en"],ke:["KE","en"],"ar-kw":["KW","ar"],"en-kw":["KW","en"],"lv-lv":["LV","lv"],lb:["LB","en"],"lt-lt":["LT","lt"],lu:["LU","fr"],mk:["MK","mk"],mt:["MT","en"],my:["MY","en"],mu:["MU","en"],mx:["MX","es"],"ru-md":["MD","ru"],"ro-md":["MD","ro-MD"],me:["ME","sr-ME"],ma:["MA","fr"],mz:["MZ","pt"],mm:["MM","en"],na:["NA","en"],nl:["NL","nl"],nz:["NZ","en"],no:["NO","no"],"ar-om":["OM","ar"],"en-om":["OM","en"],pa:["PA","es"],py:["PY","es"],pl:["PL","pl"],pt:["PT","pt"],pe:["PE","es"],ph:["PH","en"],pr:["PR","en"],"ar-qa":["QA","ar"],"en-qa":["QA","en"],ro:["RO","ro"],ru:["RU","ru"],"ar-sa":["SA","ar"],"en-sa":["SA","en"],rs:["RS","sr-Latn"],sg:["SG","en"],sk:["SK","sk"],si:["SI","sl"],za:["ZA","en"],kr:["KR","ko"],es:["ES","es"],lk:["LK","en"],se:["SE","sv"],"fr-ch":["CH","fr"],"de-ch":["CH","de"],"it-ch":["CH","it"],"en-th":["TH","en"],"th-th":["TH","th"],tr:["TR","tr"],"uk-ua":["UA","uk"],"ar-ae":["AE","ar"],"en-ae":["AE","en"],uk:["GB","en"],us:["US","en"],uy:["UY","es"],"en-vn":["VN","en"],"vi-vn":["VN","vi"],zm:["ZM","en"],zw:["ZW","en"]},r={},i={},t=0,o=Object.entries(a);t<o.length;t++){var s=o[t],l=s[0],u=s[1],g=u[0],h=u[1];r[g]||(r[g]=[]),r[g].push(l),i[h]||(i[h]=[]),i[h].push(l)}var m={"001":"kilometer",US:"mile",GB:"mile"},d=/^[a-zA-Z][a-zA-Z-]*[a-zA-Z]$/;function c(e){if("string"!=typeof e)throw new TypeError("Site slug should be a string, got '"+typeof e+"'");if(""===e)throw new TypeError("Site slug should not be empty");if(!d.test(e))throw new TypeError("Invalid site slug '"+e+"'");if(!(e in a))throw new TypeError("No such market site '"+e+"'")}function A(e){try{c(e)}catch(e){return!1}return!0}var p=function(a,t,o){var s=e[a],l=s[0],u=s[1],g=s[2];this.marketName=n[t],this.regionCode=t,this.siteSlug=o,this.languageName=u,this.localizedLanguageName=l,Object.defineProperties(this,{href:{enumerable:!0,get:function(){return o?"/"+o:"/"}},locale:{enumerable:!0,get:function(){return!t||a.endsWith("-"+t)||(null==t?void 0:t.startsWith("X"))?a:a+"-"+t}},languageCode:{enumerable:!0,get:function(){return a.includes("-")?a.substring(0,a.indexOf("-")):a}},languageDirection:{enumerable:!0,get:function(){return g?"rtl":"ltr"}},multilingual:{enumerable:!0,get:function(){var e;return o?(null==(e=r[t])?void 0:e.length)>1:void 0}},htmlLanguage:{enumerable:!0,get:function(){return 1===i[a].length||(null==t?void 0:t.match(/\d+/))?a:this.locale}},roadLengthUnit:{enumerable:!0,get:function(){return m[t]||m["001"]}}})};function M(e){var n=function(e){var n=e;if("string"!=typeof n)return n;if(n.startsWith("/")){var a=n.replace(/\/+/g,"/").split("/");a.length>1&&(n=a[1])}return n.toLowerCase()}(e);if(!A(n))return new p("en");var r=a[n];return new p(r[1],r[0],n)}function f(e){if("string"!=typeof e)throw new TypeError("Invalid region code. Expected string, got "+typeof e);var n=r[e.toUpperCase()];return n&&n.length>0?n.map(function(e){return M(e)}):[]}exports.getAllMarketSites=function(){return Object.keys(a).map(function(e){return M(e)})},exports.getMarketSite=M,exports.getMarketSiteByRegionAndLanguage=function(e,n){return f(e).find(function(e){return e.languageCode===(null==n?void 0:n.toLowerCase())})},exports.getMarketSitesByRegion=f,exports.isValidSiteSlug=A,exports.validateSiteSlug=c;
//# sourceMappingURL=index.js.map

@@ -99,3 +99,3 @@ /**

readonly TR: "Turkey";
readonly TW: "Taiwan, China";
readonly TW: "Taiwan";
readonly UA: "Ukraine";

@@ -102,0 +102,0 @@ readonly US: "United States";

@@ -7,3 +7,3 @@ {

"name": "@volvo-cars/market-sites",
"version": "1.0.1",
"version": "1.0.2",
"files": [

@@ -10,0 +10,0 @@ "dist"

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc