@tmlmobilidade/utils 20250710.1249.46 → 20250710.1703.17

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 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ // export * from './parse-as-array-of-strings.js';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,43 @@
1
+ // /* * */
2
+ export {};
3
+ // import { createParser } from 'nuqs';
4
+ // /* * */
5
+ // const parseFn = (queryValue: string) => {
6
+ // // Skip if the query value is invalid.
7
+ // if (!queryValue || typeof queryValue !== 'string') return null;
8
+ // // Handle the special case where the query value is 'none'.
9
+ // if (queryValue === 'none') return [];
10
+ // // Split the query value by commas, trim each item,
11
+ // // filter out empty items, and return a sorted unique string.
12
+ // return queryValue
13
+ // .split(',')
14
+ // .map(item => item.trim())
15
+ // .filter(item => item !== 'none' && item !== '');
16
+ // };
17
+ // /* * */
18
+ // const serializeFn = (value: string[]) => {
19
+ // // Skip if the value is not a valid array.
20
+ // if (!Array.isArray(value)) return null;
21
+ // // Handle the special case where the value is empty.
22
+ // if (value.length === 0) return 'none';
23
+ // // Return a sorted unique string of values.
24
+ // // This ensures that the values are unique and sorted,
25
+ // // which is essential for consistent filtering.
26
+ // return Array
27
+ // .from(new Set(value))
28
+ // .sort()
29
+ // .map(item => item.trim())
30
+ // .join(',');
31
+ // };
32
+ // /* * */
33
+ // const eqFn = (a: string[], b: string[]) => {
34
+ // // Skip if the values are not valid arrays.
35
+ // if (!Array.isArray(a) || !Array.isArray(b)) return null;
36
+ // // Check if the arrays are equal by quickly comparing their lengths
37
+ // if (a.length !== b.length) return false;
38
+ // // If the length is the same ensure they're equal by also
39
+ // // checking if every item in one array is included in the other.
40
+ // return a.every(item => b.includes(item)) && b.every(item => a.includes(item));
41
+ // };
42
+ // /* * */
43
+ // export const parseAsArrayOfStrings = createParser({ eq: eqFn, parse: parseFn, serialize: serializeFn });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/utils",
3
- "version": "20250710.1249.46",
3
+ "version": "20250710.1703.17",
4
4
  "author": "João de Vasconcelos & Jusi Monteiro",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "homepage": "https://github.com/tmlmobilidade/services#readme",