react-instantsearch-router-nextjs 7.25.0 → 7.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js
CHANGED
|
@@ -1,104 +1,92 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.createInstantSearchRouterNext = createInstantSearchRouterNext;
|
|
7
|
-
var _history = _interopRequireDefault(require("instantsearch.js/cjs/lib/routers/history"));
|
|
8
|
-
var _stripLocaleFromUrl = require("./utils/stripLocaleFromUrl");
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
11
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
14
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
16
|
-
function createInstantSearchRouterNext(options) {
|
|
17
|
-
var _ref = options || {},
|
|
18
|
-
beforePopState = _ref.beforePopState,
|
|
19
|
-
singletonRouter = _ref.singletonRouter,
|
|
20
|
-
serverUrl = _ref.serverUrl,
|
|
21
|
-
beforeStart = _ref.beforeStart,
|
|
22
|
-
beforeDispose = _ref.beforeDispose,
|
|
23
|
-
routerOptions = _ref.routerOptions;
|
|
24
|
-
var handler;
|
|
25
|
-
var ownBeforePopState = function ownBeforePopState() {
|
|
26
|
-
return true;
|
|
27
|
-
};
|
|
3
|
+
var _object_spread = require('@swc/helpers/_/_object_spread');
|
|
4
|
+
var history = require('instantsearch.js/cjs/lib/routers/history');
|
|
28
5
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
6
|
+
function stripLocaleFromUrl(url, locale) {
|
|
7
|
+
var includePrefixSeparator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
|
|
8
|
+
if (!locale) {
|
|
9
|
+
return url;
|
|
10
|
+
}
|
|
11
|
+
return url.replace(new RegExp("".concat(includePrefixSeparator ? '/' : '').concat(locale, "(\\/|\\?|$)")), '$1');
|
|
12
|
+
}
|
|
37
13
|
|
|
38
|
-
|
|
14
|
+
function createInstantSearchRouterNext(options) {
|
|
15
|
+
var _ref = options || {}, beforePopState = _ref.beforePopState, singletonRouter = _ref.singletonRouter, serverUrl = _ref.serverUrl, beforeStart = _ref.beforeStart, beforeDispose = _ref.beforeDispose, routerOptions = _ref.routerOptions;
|
|
16
|
+
var handler;
|
|
17
|
+
var ownBeforePopState = function ownBeforePopState() {
|
|
18
|
+
return true;
|
|
19
|
+
};
|
|
20
|
+
// If we're rendering on the server, we create a simpler router
|
|
21
|
+
if (typeof window === 'undefined') {
|
|
22
|
+
return history(_object_spread._({
|
|
23
|
+
getLocation: function getLocation() {
|
|
24
|
+
return new URL(serverUrl);
|
|
25
|
+
}
|
|
26
|
+
}, routerOptions));
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
39
29
|
* Marker to skip `routeChangeComplete` event when the push comes from the router itself.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
30
|
+
*/ var lastPushFromThis = false;
|
|
31
|
+
var router = history(_object_spread._({
|
|
32
|
+
start: function start(onUpdate) {
|
|
33
|
+
var _singletonRouter_router;
|
|
34
|
+
if (beforeStart) {
|
|
35
|
+
beforeStart(onUpdate);
|
|
36
|
+
}
|
|
37
|
+
var initialPathname = singletonRouter.pathname;
|
|
38
|
+
handler = function handler() {
|
|
39
|
+
// Without this check, we would trigger an unnecessary search when navigating
|
|
40
|
+
// to a page without InstantSearch
|
|
41
|
+
if (singletonRouter.pathname === initialPathname && !lastPushFromThis) {
|
|
42
|
+
onUpdate();
|
|
43
|
+
}
|
|
44
|
+
lastPushFromThis = false;
|
|
45
|
+
};
|
|
46
|
+
singletonRouter.events.on('routeChangeComplete', handler);
|
|
47
|
+
if ((_singletonRouter_router = singletonRouter.router) === null || _singletonRouter_router === void 0 ? void 0 : _singletonRouter_router._bps) {
|
|
48
|
+
ownBeforePopState = singletonRouter.router._bps;
|
|
49
|
+
}
|
|
50
|
+
function libraryBeforePopState() {
|
|
51
|
+
var previousPathname = singletonRouter.asPath.split('?')[0];
|
|
52
|
+
var nextPathname = new URL(window.location.href).pathname;
|
|
53
|
+
// We strip the locale from the pathname if it's present
|
|
54
|
+
nextPathname = stripLocaleFromUrl(nextPathname, singletonRouter.locale, previousPathname !== '/');
|
|
55
|
+
// We only want to trigger a server request when going back/forward to a different page
|
|
56
|
+
return previousPathname !== nextPathname;
|
|
57
|
+
}
|
|
58
|
+
singletonRouter.beforePopState(function(state) {
|
|
59
|
+
if (beforePopState) {
|
|
60
|
+
return beforePopState({
|
|
61
|
+
state: state,
|
|
62
|
+
libraryBeforePopState: libraryBeforePopState,
|
|
63
|
+
ownBeforePopState: ownBeforePopState
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return libraryBeforePopState();
|
|
67
|
+
});
|
|
68
|
+
},
|
|
69
|
+
dispose: function dispose() {
|
|
70
|
+
if (beforeDispose) {
|
|
71
|
+
beforeDispose();
|
|
72
|
+
}
|
|
73
|
+
singletonRouter.events.off('routeChangeComplete', handler);
|
|
74
|
+
singletonRouter.beforePopState(ownBeforePopState);
|
|
75
|
+
},
|
|
76
|
+
push: function push(newUrl) {
|
|
77
|
+
// We need to do this because there's an error when using i18n on the
|
|
78
|
+
// root path it says for example `pages/fr.js` doesn't exist
|
|
79
|
+
var url = stripLocaleFromUrl(newUrl, singletonRouter.locale);
|
|
80
|
+
// No need to provide the second argument, Next.js will know what to do
|
|
81
|
+
singletonRouter.push(url, undefined, {
|
|
82
|
+
shallow: true
|
|
83
|
+
});
|
|
84
|
+
lastPushFromThis = true;
|
|
54
85
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
function libraryBeforePopState() {
|
|
62
|
-
var previousPathname = singletonRouter.asPath.split('?')[0];
|
|
63
|
-
var nextPathname = new URL(window.location.href).pathname;
|
|
64
|
-
|
|
65
|
-
// We strip the locale from the pathname if it's present
|
|
66
|
-
nextPathname = (0, _stripLocaleFromUrl.stripLocaleFromUrl)(nextPathname, singletonRouter.locale, previousPathname !== '/');
|
|
67
|
-
|
|
68
|
-
// We only want to trigger a server request when going back/forward to a different page
|
|
69
|
-
return previousPathname !== nextPathname;
|
|
70
|
-
}
|
|
71
|
-
singletonRouter.beforePopState(function (state) {
|
|
72
|
-
if (beforePopState) {
|
|
73
|
-
return beforePopState({
|
|
74
|
-
state: state,
|
|
75
|
-
libraryBeforePopState: libraryBeforePopState,
|
|
76
|
-
ownBeforePopState: ownBeforePopState
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
return libraryBeforePopState();
|
|
80
|
-
});
|
|
81
|
-
},
|
|
82
|
-
dispose: function dispose() {
|
|
83
|
-
if (beforeDispose) {
|
|
84
|
-
beforeDispose();
|
|
85
|
-
}
|
|
86
|
-
singletonRouter.events.off('routeChangeComplete', handler);
|
|
87
|
-
singletonRouter.beforePopState(ownBeforePopState);
|
|
88
|
-
},
|
|
89
|
-
push: function push(newUrl) {
|
|
90
|
-
// We need to do this because there's an error when using i18n on the
|
|
91
|
-
// root path it says for example `pages/fr.js` doesn't exist
|
|
92
|
-
var url = (0, _stripLocaleFromUrl.stripLocaleFromUrl)(newUrl, singletonRouter.locale);
|
|
86
|
+
}, routerOptions));
|
|
87
|
+
router._isNextRouter = true;
|
|
88
|
+
router.$$type = 'ais.nextjs';
|
|
89
|
+
return router;
|
|
90
|
+
}
|
|
93
91
|
|
|
94
|
-
|
|
95
|
-
singletonRouter.push(url, undefined, {
|
|
96
|
-
shallow: true
|
|
97
|
-
});
|
|
98
|
-
lastPushFromThis = true;
|
|
99
|
-
}
|
|
100
|
-
}, routerOptions));
|
|
101
|
-
router._isNextRouter = true;
|
|
102
|
-
router.$$type = 'ais.nextjs';
|
|
103
|
-
return router;
|
|
104
|
-
}
|
|
92
|
+
exports.createInstantSearchRouterNext = createInstantSearchRouterNext;
|
package/dist/cjs/package.json
CHANGED
package/dist/es/index.js
CHANGED
|
@@ -1,97 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
import history from "instantsearch.js/es/lib/routers/history.js";
|
|
8
|
-
import { stripLocaleFromUrl } from "./utils/stripLocaleFromUrl.js";
|
|
9
|
-
export function createInstantSearchRouterNext(options) {
|
|
10
|
-
var _ref = options || {},
|
|
11
|
-
beforePopState = _ref.beforePopState,
|
|
12
|
-
singletonRouter = _ref.singletonRouter,
|
|
13
|
-
serverUrl = _ref.serverUrl,
|
|
14
|
-
beforeStart = _ref.beforeStart,
|
|
15
|
-
beforeDispose = _ref.beforeDispose,
|
|
16
|
-
routerOptions = _ref.routerOptions;
|
|
17
|
-
var handler;
|
|
18
|
-
var ownBeforePopState = function ownBeforePopState() {
|
|
19
|
-
return true;
|
|
20
|
-
};
|
|
1
|
+
import { _ } from '@swc/helpers/cjs/_object_spread.cjs';
|
|
2
|
+
import history from 'instantsearch.js/es/lib/routers/history.js';
|
|
21
3
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
4
|
+
function stripLocaleFromUrl(url, locale) {
|
|
5
|
+
var includePrefixSeparator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
|
|
6
|
+
if (!locale) {
|
|
7
|
+
return url;
|
|
8
|
+
}
|
|
9
|
+
return url.replace(new RegExp("".concat(includePrefixSeparator ? '/' : '').concat(locale, "(\\/|\\?|$)")), '$1');
|
|
10
|
+
}
|
|
30
11
|
|
|
31
|
-
|
|
12
|
+
function createInstantSearchRouterNext(options) {
|
|
13
|
+
var _ref = options || {}, beforePopState = _ref.beforePopState, singletonRouter = _ref.singletonRouter, serverUrl = _ref.serverUrl, beforeStart = _ref.beforeStart, beforeDispose = _ref.beforeDispose, routerOptions = _ref.routerOptions;
|
|
14
|
+
var handler;
|
|
15
|
+
var ownBeforePopState = function ownBeforePopState() {
|
|
16
|
+
return true;
|
|
17
|
+
};
|
|
18
|
+
// If we're rendering on the server, we create a simpler router
|
|
19
|
+
if (typeof window === 'undefined') {
|
|
20
|
+
return history(_({
|
|
21
|
+
getLocation: function getLocation() {
|
|
22
|
+
return new URL(serverUrl);
|
|
23
|
+
}
|
|
24
|
+
}, routerOptions));
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
32
27
|
* Marker to skip `routeChangeComplete` event when the push comes from the router itself.
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
28
|
+
*/ var lastPushFromThis = false;
|
|
29
|
+
var router = history(_({
|
|
30
|
+
start: function start(onUpdate) {
|
|
31
|
+
var _singletonRouter_router;
|
|
32
|
+
if (beforeStart) {
|
|
33
|
+
beforeStart(onUpdate);
|
|
34
|
+
}
|
|
35
|
+
var initialPathname = singletonRouter.pathname;
|
|
36
|
+
handler = function handler() {
|
|
37
|
+
// Without this check, we would trigger an unnecessary search when navigating
|
|
38
|
+
// to a page without InstantSearch
|
|
39
|
+
if (singletonRouter.pathname === initialPathname && !lastPushFromThis) {
|
|
40
|
+
onUpdate();
|
|
41
|
+
}
|
|
42
|
+
lastPushFromThis = false;
|
|
43
|
+
};
|
|
44
|
+
singletonRouter.events.on('routeChangeComplete', handler);
|
|
45
|
+
if ((_singletonRouter_router = singletonRouter.router) === null || _singletonRouter_router === void 0 ? void 0 : _singletonRouter_router._bps) {
|
|
46
|
+
ownBeforePopState = singletonRouter.router._bps;
|
|
47
|
+
}
|
|
48
|
+
function libraryBeforePopState() {
|
|
49
|
+
var previousPathname = singletonRouter.asPath.split('?')[0];
|
|
50
|
+
var nextPathname = new URL(window.location.href).pathname;
|
|
51
|
+
// We strip the locale from the pathname if it's present
|
|
52
|
+
nextPathname = stripLocaleFromUrl(nextPathname, singletonRouter.locale, previousPathname !== '/');
|
|
53
|
+
// We only want to trigger a server request when going back/forward to a different page
|
|
54
|
+
return previousPathname !== nextPathname;
|
|
55
|
+
}
|
|
56
|
+
singletonRouter.beforePopState(function(state) {
|
|
57
|
+
if (beforePopState) {
|
|
58
|
+
return beforePopState({
|
|
59
|
+
state: state,
|
|
60
|
+
libraryBeforePopState: libraryBeforePopState,
|
|
61
|
+
ownBeforePopState: ownBeforePopState
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return libraryBeforePopState();
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
dispose: function dispose() {
|
|
68
|
+
if (beforeDispose) {
|
|
69
|
+
beforeDispose();
|
|
70
|
+
}
|
|
71
|
+
singletonRouter.events.off('routeChangeComplete', handler);
|
|
72
|
+
singletonRouter.beforePopState(ownBeforePopState);
|
|
73
|
+
},
|
|
74
|
+
push: function push(newUrl) {
|
|
75
|
+
// We need to do this because there's an error when using i18n on the
|
|
76
|
+
// root path it says for example `pages/fr.js` doesn't exist
|
|
77
|
+
var url = stripLocaleFromUrl(newUrl, singletonRouter.locale);
|
|
78
|
+
// No need to provide the second argument, Next.js will know what to do
|
|
79
|
+
singletonRouter.push(url, undefined, {
|
|
80
|
+
shallow: true
|
|
81
|
+
});
|
|
82
|
+
lastPushFromThis = true;
|
|
71
83
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
beforeDispose();
|
|
78
|
-
}
|
|
79
|
-
singletonRouter.events.off('routeChangeComplete', handler);
|
|
80
|
-
singletonRouter.beforePopState(ownBeforePopState);
|
|
81
|
-
},
|
|
82
|
-
push: function push(newUrl) {
|
|
83
|
-
// We need to do this because there's an error when using i18n on the
|
|
84
|
-
// root path it says for example `pages/fr.js` doesn't exist
|
|
85
|
-
var url = stripLocaleFromUrl(newUrl, singletonRouter.locale);
|
|
84
|
+
}, routerOptions));
|
|
85
|
+
router._isNextRouter = true;
|
|
86
|
+
router.$$type = 'ais.nextjs';
|
|
87
|
+
return router;
|
|
88
|
+
}
|
|
86
89
|
|
|
87
|
-
|
|
88
|
-
singletonRouter.push(url, undefined, {
|
|
89
|
-
shallow: true
|
|
90
|
-
});
|
|
91
|
-
lastPushFromThis = true;
|
|
92
|
-
}
|
|
93
|
-
}, routerOptions));
|
|
94
|
-
router._isNextRouter = true;
|
|
95
|
-
router.$$type = 'ais.nextjs';
|
|
96
|
-
return router;
|
|
97
|
-
}
|
|
90
|
+
export { createInstantSearchRouterNext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-instantsearch-router-nextjs",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.26.1",
|
|
4
4
|
"description": "React InstantSearch Router for Next.js",
|
|
5
5
|
"types": "dist/es/index.d.ts",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -38,10 +38,7 @@
|
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
40
|
"clean": "rm -rf dist",
|
|
41
|
-
"build": "
|
|
42
|
-
"build:cjs": "BABEL_ENV=cjs babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/cjs --ignore '**/__tests__/**/*','**/__mocks__/**/*' --quiet && ../../scripts/prepare-cjs.sh",
|
|
43
|
-
"build:es:base": "BABEL_ENV=es babel src --root-mode upward --extensions '.js,.ts,.tsx' --out-dir dist/es --ignore '**/__tests__/**/*','**/__mocks__/**/*'",
|
|
44
|
-
"build:es": "yarn build:es:base --quiet",
|
|
41
|
+
"build": "BABEL_ENV=es,rollup BUILD_FORMAT=esm rollup -c rollup.config.mjs && BABEL_ENV=rollup BUILD_FORMAT=cjs rollup -c rollup.config.mjs && yarn build:types",
|
|
45
42
|
"build:types": "tsc -p ./tsconfig.declaration.json --outDir ./dist/es",
|
|
46
43
|
"test:exports": "node ./__tests__/module/is-es-module.mjs && node ./__tests__/module/is-cjs-module.cjs",
|
|
47
44
|
"test:e2e": "playwright test",
|
|
@@ -49,8 +46,9 @@
|
|
|
49
46
|
"watch:es": "yarn --silent build:es:base --watch"
|
|
50
47
|
},
|
|
51
48
|
"dependencies": {
|
|
52
|
-
"
|
|
53
|
-
"
|
|
49
|
+
"@swc/helpers": "0.5.18",
|
|
50
|
+
"instantsearch.js": "4.90.0",
|
|
51
|
+
"react-instantsearch-core": "7.26.1"
|
|
54
52
|
},
|
|
55
53
|
"devDependencies": {
|
|
56
54
|
"@playwright/test": "1.49.1"
|
|
@@ -58,5 +56,5 @@
|
|
|
58
56
|
"peerDependencies": {
|
|
59
57
|
"next": ">= 9 && < 17"
|
|
60
58
|
},
|
|
61
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "5b11048373caf7f15dbd8c1c737a123eca49cb12"
|
|
62
60
|
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.stripLocaleFromUrl = stripLocaleFromUrl;
|
|
7
|
-
function stripLocaleFromUrl(url, locale) {
|
|
8
|
-
var includePrefixSeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
9
|
-
if (!locale) {
|
|
10
|
-
return url;
|
|
11
|
-
}
|
|
12
|
-
return url.replace(new RegExp("".concat(includePrefixSeparator ? '/' : '').concat(locale, "(\\/|\\?|$)")), '$1');
|
|
13
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export function stripLocaleFromUrl(url, locale) {
|
|
2
|
-
var includePrefixSeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
3
|
-
if (!locale) {
|
|
4
|
-
return url;
|
|
5
|
-
}
|
|
6
|
-
return url.replace(new RegExp("".concat(includePrefixSeparator ? '/' : '').concat(locale, "(\\/|\\?|$)")), '$1');
|
|
7
|
-
}
|