UNPKG

react-instantsearch-router-nextjs

Version:
19 lines (17 loc) 538 B
'use strict'; 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'); }