@cuemath/web-utils 1.0.40 → 1.0.41

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.
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.removeTrailingSlashFromPath = exports.removeHrefLangFromPath = exports.removeQueryStringFromPath = void 0;
4
4
  // remove query params from path /algebra?query=1 to /algebra
5
- const removeQueryStringFromPath = (path) => path.split('?')[0];
5
+ const removeQueryStringFromPath = (path) => path?.split('?')[0];
6
6
  exports.removeQueryStringFromPath = removeQueryStringFromPath;
7
7
  // remove hreflang from path /en-in/ to /
8
8
  const removeHrefLangFromPath = (path) => path.replace(/\/en-[a-z]{2}\//, '/');
9
9
  exports.removeHrefLangFromPath = removeHrefLangFromPath;
10
10
  // remove trailing slash from path /algebra/ to /algebra
11
- const removeTrailingSlashFromPath = (path) => path.replace(/\/$/, '');
11
+ const removeTrailingSlashFromPath = (path) => path?.replace(/\/$/, '');
12
12
  exports.removeTrailingSlashFromPath = removeTrailingSlashFromPath;
13
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/url-parser/index.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AACtD,MAAM,yBAAyB,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAA9D,QAAA,yBAAyB,6BAAqC;AAE3E,yCAAyC;AAClC,MAAM,sBAAsB,GAAG,CAAC,IAAY,EAAE,EAAE,CACrD,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAD1B,QAAA,sBAAsB,0BACI;AAEvC,wDAAwD;AACjD,MAAM,2BAA2B,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAAxE,QAAA,2BAA2B,+BAA6C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/url-parser/index.ts"],"names":[],"mappings":";;;AAAA,6DAA6D;AACtD,MAAM,yBAAyB,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAA/D,QAAA,yBAAyB,6BAAsC;AAE5E,yCAAyC;AAClC,MAAM,sBAAsB,GAAG,CAAC,IAAY,EAAE,EAAE,CACrD,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAD1B,QAAA,sBAAsB,0BACI;AAEvC,wDAAwD;AACjD,MAAM,2BAA2B,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAAzE,QAAA,2BAA2B,+BAA8C"}
@@ -1,7 +1,7 @@
1
1
  // remove query params from path /algebra?query=1 to /algebra
2
- export const removeQueryStringFromPath = (path) => path.split('?')[0];
2
+ export const removeQueryStringFromPath = (path) => path === null || path === void 0 ? void 0 : path.split('?')[0];
3
3
  // remove hreflang from path /en-in/ to /
4
4
  export const removeHrefLangFromPath = (path) => path.replace(/\/en-[a-z]{2}\//, '/');
5
5
  // remove trailing slash from path /algebra/ to /algebra
6
- export const removeTrailingSlashFromPath = (path) => path.replace(/\/$/, '');
6
+ export const removeTrailingSlashFromPath = (path) => path === null || path === void 0 ? void 0 : path.replace(/\/$/, '');
7
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/url-parser/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3E,yCAAyC;AACzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,IAAY,EAAE,EAAE,CACrD,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAEvC,wDAAwD;AACxD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/url-parser/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,IAAS,EAAE,EAAE,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAE5E,yCAAyC;AACzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,IAAY,EAAE,EAAE,CACrD,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;AAEvC,wDAAwD;AACxD,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuemath/web-utils",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "Shared web utils package",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",