react-instantsearch-router-nextjs
Version:
React InstantSearch Router for Next.js
19 lines (17 loc) • 538 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "stripLocaleFromUrl", {
enumerable: true,
get: function() {
return stripLocaleFromUrl;
}
});
function stripLocaleFromUrl(url, locale) {
var includePrefixSeparator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
if (!locale) {
return url;
}
return url.replace(new RegExp("".concat(includePrefixSeparator ? '/' : '').concat(locale, "(\\/|\\?|$)")), '$1');
}