@vpmedia/simplify 1.50.0 → 1.52.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/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ## [1.52.0] - 2025-12-16
2
+
3
+ ### 💼 Other
4
+
5
+ - *(deps)* Bump dependency versions
6
+
7
+ ### ⚙️ Miscellaneous Tasks
8
+
9
+ - Release
10
+ - Improve type checking
11
+ - *(release)* V1.52.0
12
+ ## [1.51.0] - 2025-12-16
13
+
14
+ ### 🐛 Bug Fixes
15
+
16
+ - Added missing fallback value to get url param
17
+
18
+ ### ⚙️ Miscellaneous Tasks
19
+
20
+ - Release
21
+ - *(release)* V1.51.0
1
22
  ## [1.50.0] - 2025-12-16
2
23
 
3
24
  ### ⚙️ Miscellaneous Tasks
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpmedia/simplify",
3
- "version": "1.50.0",
3
+ "version": "1.52.0",
4
4
  "description": "@vpmedia/simplify",
5
5
  "author": "Andras Csizmadia <andras@vpmedia.hu> (www.vpmedia.hu)",
6
6
  "license": "MIT",
@@ -27,10 +27,10 @@
27
27
  "devDependencies": {
28
28
  "@commitlint/cli": "^20.2.0",
29
29
  "@commitlint/config-conventional": "^20.2.0",
30
- "@eslint/js": "^9.39.1",
31
- "@types/node": "^25.0.1",
30
+ "@eslint/js": "^9.39.2",
31
+ "@types/node": "^25.0.2",
32
32
  "@vitest/coverage-v8": "^4.0.15",
33
- "eslint": "^9.39.1",
33
+ "eslint": "^9.39.2",
34
34
  "eslint-plugin-jsdoc": "^61.5.0",
35
35
  "eslint-plugin-oxlint": "^1.32.0",
36
36
  "eslint-plugin-unicorn": "^62.0.0",
@@ -4,15 +4,16 @@ const urlSearchParams = new URLSearchParams(window.location.search);
4
4
 
5
5
  /**
6
6
  * TBD.
7
+ * @template T
7
8
  * @param {string} key - TBD.
8
- * @param {string | null | undefined} defaultValue - TBD.
9
+ * @param {T} defaultValue - TBD.
9
10
  * @param {boolean} isSanitize - TBD.
10
- * @returns {string | null} TBD.
11
+ * @returns {string | T} TBD.
11
12
  */
12
13
  export const getURLParam = (key, defaultValue = null, isSanitize = true) => {
13
14
  const paramValue = urlSearchParams.get(key);
14
15
  if (paramValue === null || paramValue === undefined) {
15
- return null;
16
+ return defaultValue;
16
17
  }
17
18
  if (isSanitize) {
18
19
  return sanitizeURLParam(paramValue);
@@ -0,0 +1,5 @@
1
+ import { getURLParam } from './getURLParam.js';
2
+
3
+ test('Tests getURLParam()', () => {
4
+ expect(getURLParam('key', 'fallback')).toBe('fallback');
5
+ });
@@ -1,2 +1,2 @@
1
- export function getURLParam(key: string, defaultValue?: string | null | undefined, isSanitize?: boolean): string | null;
1
+ export function getURLParam<T>(key: string, defaultValue?: T, isSanitize?: boolean): string | T;
2
2
  //# sourceMappingURL=getURLParam.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getURLParam.d.ts","sourceRoot":"","sources":["../../src/util/getURLParam.js"],"names":[],"mappings":"AAWO,iCALI,MAAM,iBACN,MAAM,GAAG,IAAI,GAAG,SAAS,eACzB,OAAO,GACL,MAAM,GAAG,IAAI,CAWzB"}
1
+ {"version":3,"file":"getURLParam.d.ts","sourceRoot":"","sources":["../../src/util/getURLParam.js"],"names":[],"mappings":"AAYO,4BANM,CAAC,OACH,MAAM,iBACN,CAAC,eACD,OAAO,GACL,MAAM,GAAG,CAAC,CAWtB"}