@commercetools-frontend/url-utils 24.13.0 → 25.1.0
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.
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
6
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
7
6
|
|
|
8
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
9
8
|
|
|
10
9
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
11
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
12
10
|
|
|
13
11
|
// NOTE: This string will be replaced on build time with the package version.
|
|
14
|
-
var version = "
|
|
12
|
+
var version = "25.1.0";
|
|
15
13
|
|
|
16
14
|
const matchLeadingAndTrailingSlashes = /^\/|\/$/g;
|
|
17
15
|
const trimLeadingAndTrailingSlashes = url => url.replace(matchLeadingAndTrailingSlashes, '');
|
|
@@ -20,12 +18,11 @@ const joinPaths = function () {
|
|
|
20
18
|
paths[_key] = arguments[_key];
|
|
21
19
|
}
|
|
22
20
|
const joint = _mapInstanceProperty__default["default"](paths).call(paths, path => {
|
|
23
|
-
|
|
24
|
-
if (typeof path !== 'string') throw new Error(_concatInstanceProperty__default["default"](_context = "Expected path \"".concat(path, "\" to be a \"string\", but got \"")).call(_context, typeof path, "\""));
|
|
21
|
+
if (typeof path !== 'string') throw new Error(`Expected path "${path}" to be a "string", but got "${typeof path}"`);
|
|
25
22
|
// Trim leading and trailing slash for each single path
|
|
26
23
|
return trimLeadingAndTrailingSlashes(path);
|
|
27
24
|
}).join('/');
|
|
28
|
-
return
|
|
25
|
+
return `/${joint}`;
|
|
29
26
|
};
|
|
30
27
|
|
|
31
28
|
exports.joinPaths = joinPaths;
|
|
@@ -3,15 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _mapInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/map');
|
|
6
|
-
var _concatInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/concat');
|
|
7
6
|
|
|
8
7
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
9
8
|
|
|
10
9
|
var _mapInstanceProperty__default = /*#__PURE__*/_interopDefault(_mapInstanceProperty);
|
|
11
|
-
var _concatInstanceProperty__default = /*#__PURE__*/_interopDefault(_concatInstanceProperty);
|
|
12
10
|
|
|
13
11
|
// NOTE: This string will be replaced on build time with the package version.
|
|
14
|
-
var version = "
|
|
12
|
+
var version = "25.1.0";
|
|
15
13
|
|
|
16
14
|
const matchLeadingAndTrailingSlashes = /^\/|\/$/g;
|
|
17
15
|
const trimLeadingAndTrailingSlashes = url => url.replace(matchLeadingAndTrailingSlashes, '');
|
|
@@ -20,12 +18,11 @@ const joinPaths = function () {
|
|
|
20
18
|
paths[_key] = arguments[_key];
|
|
21
19
|
}
|
|
22
20
|
const joint = _mapInstanceProperty__default["default"](paths).call(paths, path => {
|
|
23
|
-
|
|
24
|
-
if (typeof path !== 'string') throw new Error(_concatInstanceProperty__default["default"](_context = "Expected path \"".concat(path, "\" to be a \"string\", but got \"")).call(_context, typeof path, "\""));
|
|
21
|
+
if (typeof path !== 'string') throw new Error(`Expected path "${path}" to be a "string", but got "${typeof path}"`);
|
|
25
22
|
// Trim leading and trailing slash for each single path
|
|
26
23
|
return trimLeadingAndTrailingSlashes(path);
|
|
27
24
|
}).join('/');
|
|
28
|
-
return
|
|
25
|
+
return `/${joint}`;
|
|
29
26
|
};
|
|
30
27
|
|
|
31
28
|
exports.joinPaths = joinPaths;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import _mapInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/map';
|
|
2
|
-
import _concatInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/concat';
|
|
3
2
|
|
|
4
3
|
// NOTE: This string will be replaced on build time with the package version.
|
|
5
|
-
var version = "
|
|
4
|
+
var version = "25.1.0";
|
|
6
5
|
|
|
7
6
|
const matchLeadingAndTrailingSlashes = /^\/|\/$/g;
|
|
8
7
|
const trimLeadingAndTrailingSlashes = url => url.replace(matchLeadingAndTrailingSlashes, '');
|
|
@@ -11,12 +10,11 @@ const joinPaths = function () {
|
|
|
11
10
|
paths[_key] = arguments[_key];
|
|
12
11
|
}
|
|
13
12
|
const joint = _mapInstanceProperty(paths).call(paths, path => {
|
|
14
|
-
|
|
15
|
-
if (typeof path !== 'string') throw new Error(_concatInstanceProperty(_context = "Expected path \"".concat(path, "\" to be a \"string\", but got \"")).call(_context, typeof path, "\""));
|
|
13
|
+
if (typeof path !== 'string') throw new Error(`Expected path "${path}" to be a "string", but got "${typeof path}"`);
|
|
16
14
|
// Trim leading and trailing slash for each single path
|
|
17
15
|
return trimLeadingAndTrailingSlashes(path);
|
|
18
16
|
}).join('/');
|
|
19
|
-
return
|
|
17
|
+
return `/${joint}`;
|
|
20
18
|
};
|
|
21
19
|
|
|
22
20
|
export { joinPaths, trimLeadingAndTrailingSlashes, version };
|
package/package.json
CHANGED