@selkirk-systems/selkirk-utils 1.2.0 → 1.3.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.
- package/dist/index.js +1 -0
- package/dist/utils/EncodingUtils.js +13 -13
- package/dist/utils/EnvUtils.js +0 -1
- package/lib/index.js +2 -1
- package/lib/utils/EncodingUtils.js +13 -13
- package/lib/utils/EnvUtils.js +0 -1
- package/package.json +1 -5
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from './utils/ArrayUtils';
|
|
|
3
3
|
export * from './utils/AuthUtils';
|
|
4
4
|
export * from './utils/CacheUtils';
|
|
5
5
|
export * from './utils/DateUtils';
|
|
6
|
+
export * from './utils/EncodingUtils';
|
|
6
7
|
export * from './utils/EntityUtils';
|
|
7
8
|
export * from './utils/EnvUtils';
|
|
8
9
|
export * from './utils/FetchUtils';
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a path to its URL encoded form. Will encode '?', so please
|
|
3
|
+
* break apart paths containing queries before using.
|
|
4
|
+
* @method
|
|
5
|
+
*
|
|
6
|
+
* @param {string} path - provided URL string
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
1
9
|
export const selkirkEncodePath = path => {
|
|
2
10
|
//Built-in method, will handle special characters aside from : / ? & = #
|
|
3
11
|
path = encodeURI(path);
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let after = path.slice(i);
|
|
10
|
-
before = before.replaceAll(":", encodeURIComponent(":"));
|
|
11
|
-
before = before.replaceAll("?", encodeURIComponent("?"));
|
|
12
|
-
before = before.replaceAll("&", encodeURIComponent("&"));
|
|
13
|
-
before = before.replaceAll("=", encodeURIComponent("="));
|
|
14
|
-
before = before.replaceAll("#", encodeURIComponent("#"));
|
|
15
|
-
path = before + after;
|
|
16
|
-
}
|
|
12
|
+
path = path.replaceAll(":", encodeURIComponent(":"));
|
|
13
|
+
path = path.replaceAll("?", encodeURIComponent("?"));
|
|
14
|
+
path = path.replaceAll("&", encodeURIComponent("&"));
|
|
15
|
+
path = path.replaceAll("=", encodeURIComponent("="));
|
|
16
|
+
path = path.replaceAll("#", encodeURIComponent("#"));
|
|
17
17
|
return path;
|
|
18
18
|
};
|
package/dist/utils/EnvUtils.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from './utils/ArrayUtils';
|
|
|
3
3
|
export * from './utils/AuthUtils'
|
|
4
4
|
export * from './utils/CacheUtils';
|
|
5
5
|
export * from './utils/DateUtils';
|
|
6
|
+
export * from './utils/EncodingUtils';
|
|
6
7
|
export * from './utils/EntityUtils';
|
|
7
8
|
export * from './utils/EnvUtils';
|
|
8
9
|
export * from './utils/FetchUtils';
|
|
@@ -11,4 +12,4 @@ export * from './utils/LayerUtils';
|
|
|
11
12
|
export * from './utils/ListUtils';
|
|
12
13
|
export * from './utils/NumberUtils';
|
|
13
14
|
export * from './utils/ObjUtils';
|
|
14
|
-
export * from './utils/StringUtils';
|
|
15
|
+
export * from './utils/StringUtils';
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Converts a path to its URL encoded form. Will encode '?', so please
|
|
3
|
+
* break apart paths containing queries before using.
|
|
4
|
+
* @method
|
|
5
|
+
*
|
|
6
|
+
* @param {string} path - provided URL string
|
|
7
|
+
* @returns {string}
|
|
8
|
+
*/
|
|
1
9
|
export const selkirkEncodePath = (path) => {
|
|
2
10
|
//Built-in method, will handle special characters aside from : / ? & = #
|
|
3
11
|
path = encodeURI(path);
|
|
4
12
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
before = before.replaceAll(":",encodeURIComponent(":"));
|
|
11
|
-
before = before.replaceAll("?",encodeURIComponent("?"));
|
|
12
|
-
before = before.replaceAll("&",encodeURIComponent("&"));
|
|
13
|
-
before = before.replaceAll("=",encodeURIComponent("="));
|
|
14
|
-
before = before.replaceAll("#",encodeURIComponent("#"));
|
|
15
|
-
path = before + after;
|
|
16
|
-
}
|
|
17
|
-
|
|
13
|
+
path = path.replaceAll(":",encodeURIComponent(":"));
|
|
14
|
+
path = path.replaceAll("?",encodeURIComponent("?"));
|
|
15
|
+
path = path.replaceAll("&",encodeURIComponent("&"));
|
|
16
|
+
path = path.replaceAll("=",encodeURIComponent("="));
|
|
17
|
+
path = path.replaceAll("#",encodeURIComponent("#"));
|
|
18
18
|
return path;
|
|
19
19
|
}
|
package/lib/utils/EnvUtils.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selkirk-systems/selkirk-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Utils we often use in our web projects",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Marcos Bernal <mbernal@selkirksystems.com>",
|
|
@@ -32,10 +32,6 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://bitbucket.org/selkirk/web-component-library#readme",
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@selkirk-systems/layout": "^1.3.1",
|
|
36
|
-
"primereact": "^10.9.4",
|
|
37
|
-
"react": ">=18.0.0",
|
|
38
|
-
"wouter": "^3.6.0"
|
|
39
35
|
},
|
|
40
36
|
"dependencies": {
|
|
41
37
|
"clsx": "^2.1.1"
|