@takeshape/routing 7.239.0 → 8.0.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/es/urls.js +2 -6
- package/lib/urls.js +5 -8
- package/package.json +2 -2
package/es/urls.js
CHANGED
|
@@ -23,16 +23,12 @@ function escapePath(path) {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
export function getAssetUrl(s3Key, options = {}) {
|
|
26
|
-
var _options$baseUrl;
|
|
27
|
-
|
|
28
26
|
const path = getPath(s3Key);
|
|
29
|
-
const baseUrl =
|
|
27
|
+
const baseUrl = options.baseUrl ?? assetBaseUrl;
|
|
30
28
|
return path ? `${baseUrl}/${escapePath(path)}` : '';
|
|
31
29
|
}
|
|
32
30
|
export function getImageUrl(key, query, options = {}) {
|
|
33
|
-
var _options$baseUrl2;
|
|
34
|
-
|
|
35
31
|
const path = getPath(key);
|
|
36
|
-
const baseUrl =
|
|
32
|
+
const baseUrl = options.baseUrl ?? imageBaseUrl;
|
|
37
33
|
return path ? `${baseUrl}/${escapePath(path)}${formatQuery(query)}` : '';
|
|
38
34
|
}
|
package/lib/urls.js
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.assetBaseUrl = void 0;
|
|
7
7
|
exports.getAssetUrl = getAssetUrl;
|
|
8
8
|
exports.getImageUrl = getImageUrl;
|
|
9
|
-
exports.
|
|
9
|
+
exports.getPath = getPath;
|
|
10
|
+
exports.imageBaseUrl = void 0;
|
|
10
11
|
|
|
11
12
|
var _queryString = _interopRequireDefault(require("query-string"));
|
|
12
13
|
|
|
@@ -40,17 +41,13 @@ function escapePath(path) {
|
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
function getAssetUrl(s3Key, options = {}) {
|
|
43
|
-
var _options$baseUrl;
|
|
44
|
-
|
|
45
44
|
const path = getPath(s3Key);
|
|
46
|
-
const baseUrl =
|
|
45
|
+
const baseUrl = options.baseUrl ?? assetBaseUrl;
|
|
47
46
|
return path ? `${baseUrl}/${escapePath(path)}` : '';
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
function getImageUrl(key, query, options = {}) {
|
|
51
|
-
var _options$baseUrl2;
|
|
52
|
-
|
|
53
50
|
const path = getPath(key);
|
|
54
|
-
const baseUrl =
|
|
51
|
+
const baseUrl = options.baseUrl ?? imageBaseUrl;
|
|
55
52
|
return path ? `${baseUrl}/${escapePath(path)}${formatQuery(query)}` : '';
|
|
56
53
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/routing",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"author": "asprouse",
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"engines": {
|
|
19
|
-
"node": ">=
|
|
19
|
+
"node": ">=14"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"lodash": "^4.17.20",
|