UNPKG

539 BJavaScriptView Raw
1"use strict";exports.__esModule=true;exports.normalizeLocalePath=normalizeLocalePath;function normalizeLocalePath(pathname,locales){let detectedLocale;// first item will be empty string from splitting at first char
2const pathnameParts=pathname.split('/');(locales||[]).some(locale=>{if(pathnameParts[1].toLowerCase()===locale.toLowerCase()){detectedLocale=locale;pathnameParts.splice(1,1);pathname=pathnameParts.join('/')||'/';return true;}return false;});return{pathname,detectedLocale};}
3//# sourceMappingURL=normalize-locale-path.js.map
\No newline at end of file