libshv-js 3.4.0 → 3.4.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/zod.ts +6 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libshv-js",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "description": "Typescript implementation of libshv",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
package/src/zod.ts CHANGED
@@ -8,6 +8,9 @@ export const metamap = <T extends Record<string | number, ZodType<any, any, any>
8
8
  export const int = () => z.number();
9
9
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-arguments -- Zod needs the default argument, otherwise it'll infer as UInt<unknown>
10
10
  export const uint = () => z.instanceof(UInt<number>);
11
+ export const double = () => z.instanceof(Double);
12
+ export const decimal = () => z.instanceof(Decimal);
13
+ export const blob = () => z.instanceof(ArrayBuffer);
11
14
 
12
15
  const withMetaInstanceParser = z.instanceof(RpcValueWithMetaData);
13
16
  export const rpcvalue = () => z.union([
@@ -15,9 +18,9 @@ export const rpcvalue = () => z.union([
15
18
  z.boolean(),
16
19
  z.number(),
17
20
  uint(),
18
- z.instanceof(Double),
19
- z.instanceof(Decimal),
20
- z.instanceof(ArrayBuffer),
21
+ double(),
22
+ decimal(),
23
+ blob(),
21
24
  z.string(),
22
25
  z.date(),
23
26
  z.array(z.any()),