@selkirk-systems/selkirk-utils 1.1.2 → 1.2.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.
@@ -0,0 +1,18 @@
1
+ export const selkirkEncodePath = path => {
2
+ //Built-in method, will handle special characters aside from : / ? & = #
3
+ path = encodeURI(path);
4
+
5
+ //Manually handling the other characters after splitting out the post-URL query
6
+ const i = path.lastIndexOf("?");
7
+ if (i > -1) {
8
+ let before = path.slice(0, i);
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
+ }
17
+ return path;
18
+ };
@@ -0,0 +1,19 @@
1
+ export const selkirkEncodePath = (path) => {
2
+ //Built-in method, will handle special characters aside from : / ? & = #
3
+ path = encodeURI(path);
4
+
5
+ //Manually handling the other characters after splitting out the post-URL query
6
+ const i = path.lastIndexOf("?");
7
+ if(i > -1){
8
+ let before = path.slice(0, i);
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
+ }
17
+
18
+ return path;
19
+ }
package/package.json CHANGED
@@ -1,44 +1,44 @@
1
- {
2
- "name": "@selkirk-systems/selkirk-utils",
3
- "version": "1.1.2",
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": "43799a4b8b18f6526128e96a05d1ddb8f6ab2eec"
44
- }
1
+ {
2
+ "name": "@selkirk-systems/selkirk-utils",
3
+ "version": "1.2.0",
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
+ }