@tmlmobilidade/go-types-shared 20260723.1737.39 → 20260723.2301.15

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.
@@ -1,2 +1,3 @@
1
1
  export * from './environment.js';
2
2
  export * from './i18n-code.js';
3
+ export * from './numbers.js';
@@ -1,2 +1,3 @@
1
1
  export * from './environment.js';
2
2
  export * from './i18n-code.js';
3
+ export * from './numbers.js';
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export declare const NonNegativeNumberSchema: z.ZodEffects<z.ZodNumber, number | null, number>;
@@ -0,0 +1,12 @@
1
+ /* * */
2
+ import { z } from 'zod';
3
+ /* * */
4
+ export const NonNegativeNumberSchema = z.number().transform((value) => {
5
+ if (value)
6
+ return null;
7
+ if (isNaN(value))
8
+ return null;
9
+ if (value <= 0)
10
+ return null;
11
+ return Math.round(value);
12
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/go-types-shared",
3
- "version": "20260723.1737.39",
3
+ "version": "20260723.2301.15",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"