@selkirk-systems/selkirk-utils 1.1.2 → 1.2.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/utils/EncodingUtils.js +18 -0
- package/lib/utils/EncodingUtils.js +19 -0
- package/package.json +44 -44
|
@@ -0,0 +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
|
+
*/
|
|
9
|
+
export const selkirkEncodePath = path => {
|
|
10
|
+
//Built-in method, will handle special characters aside from : / ? & = #
|
|
11
|
+
path = encodeURI(path);
|
|
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
|
+
return path;
|
|
18
|
+
};
|
|
@@ -0,0 +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
|
+
*/
|
|
9
|
+
export const selkirkEncodePath = (path) => {
|
|
10
|
+
//Built-in method, will handle special characters aside from : / ? & = #
|
|
11
|
+
path = encodeURI(path);
|
|
12
|
+
|
|
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
|
+
return path;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@selkirk-systems/selkirk-utils",
|
|
3
|
-
"version": "1.1
|
|
4
|
-
"description": "Utils we often use in our web projects",
|
|
5
|
-
"keywords": [],
|
|
6
|
-
"author": "Marcos Bernal <mbernal@selkirksystems.com>",
|
|
7
|
-
"license": "ISC",
|
|
8
|
-
"main": "dist/index.js",
|
|
9
|
-
"module": "dist/index.js",
|
|
10
|
-
"directories": {
|
|
11
|
-
"dist": "dist",
|
|
12
|
-
"lib": "lib"
|
|
13
|
-
},
|
|
14
|
-
"files": [
|
|
15
|
-
"dist/**",
|
|
16
|
-
"lib/**"
|
|
17
|
-
],
|
|
18
|
-
"publishConfig": {
|
|
19
|
-
"access": "public"
|
|
20
|
-
},
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git+https://galderak@bitbucket.org/selkirk/web-component-library.git"
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"docs": "jsdoc --configure ../../jsdoc.json -r ./lib -d docs",
|
|
27
|
-
"build": "del dist /Q && cross-env CI=false NODE_ENV=production babel lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__",
|
|
28
|
-
"prepublishOnly": "npm run build"
|
|
29
|
-
},
|
|
30
|
-
"bugs": {
|
|
31
|
-
"url": "https://bitbucket.org/selkirk/web-component-library/issues"
|
|
32
|
-
},
|
|
33
|
-
"homepage": "https://bitbucket.org/selkirk/web-component-library#readme",
|
|
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
|
-
},
|
|
40
|
-
"dependencies": {
|
|
41
|
-
"clsx": "^2.1.1"
|
|
42
|
-
},
|
|
43
|
-
"gitHead": "
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@selkirk-systems/selkirk-utils",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "Utils we often use in our web projects",
|
|
5
|
+
"keywords": [],
|
|
6
|
+
"author": "Marcos Bernal <mbernal@selkirksystems.com>",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.js",
|
|
10
|
+
"directories": {
|
|
11
|
+
"dist": "dist",
|
|
12
|
+
"lib": "lib"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/**",
|
|
16
|
+
"lib/**"
|
|
17
|
+
],
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"access": "public"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://galderak@bitbucket.org/selkirk/web-component-library.git"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"docs": "jsdoc --configure ../../jsdoc.json -r ./lib -d docs",
|
|
27
|
+
"build": "del dist /Q && cross-env CI=false NODE_ENV=production babel lib --out-dir dist --copy-files --ignore __tests__,spec.js,test.js,__snapshots__",
|
|
28
|
+
"prepublishOnly": "npm run build"
|
|
29
|
+
},
|
|
30
|
+
"bugs": {
|
|
31
|
+
"url": "https://bitbucket.org/selkirk/web-component-library/issues"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://bitbucket.org/selkirk/web-component-library#readme",
|
|
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
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"clsx": "^2.1.1"
|
|
42
|
+
},
|
|
43
|
+
"gitHead": "c37f026aeb4bdbe9aef1289a16b0aa4964c2f3bc"
|
|
44
|
+
}
|