hh-contracts 0.0.102 → 0.0.104
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.
|
@@ -35,10 +35,17 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.BooleanQueryParamSchema = void 0;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
|
+
// export const BooleanQueryParamSchema = z
|
|
39
|
+
// .union([z.boolean(), z.enum(['true', 'false', '1', '0', 'yes', 'no'])])
|
|
40
|
+
// .transform(value => {
|
|
41
|
+
// if (typeof value === 'boolean') return value;
|
|
42
|
+
// return value === 'true' || value === '1' || value === 'yes';
|
|
43
|
+
// });
|
|
38
44
|
exports.BooleanQueryParamSchema = z
|
|
39
|
-
.
|
|
45
|
+
.enum(['all', 'true', 'false', '1', '0', 'yes', 'no'])
|
|
40
46
|
.transform(value => {
|
|
41
|
-
if (
|
|
42
|
-
return
|
|
43
|
-
|
|
47
|
+
if (value === 'true' || value === '1' || value === 'yes')
|
|
48
|
+
return true;
|
|
49
|
+
if (value === 'false' || value === '0' || value === 'no')
|
|
50
|
+
return false;
|
|
44
51
|
});
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
|
|
3
|
+
// export const BooleanQueryParamSchema = z
|
|
4
|
+
// .union([z.boolean(), z.enum(['true', 'false', '1', '0', 'yes', 'no'])])
|
|
5
|
+
// .transform(value => {
|
|
6
|
+
// if (typeof value === 'boolean') return value;
|
|
7
|
+
// return value === 'true' || value === '1' || value === 'yes';
|
|
8
|
+
// });
|
|
9
|
+
|
|
3
10
|
export const BooleanQueryParamSchema = z
|
|
4
|
-
.
|
|
11
|
+
.enum(['all', 'true', 'false', '1', '0', 'yes', 'no'])
|
|
5
12
|
.transform(value => {
|
|
6
|
-
if (
|
|
7
|
-
|
|
13
|
+
if (value === 'true' || value === '1' || value === 'yes') return true;
|
|
14
|
+
if (value === 'false' || value === '0' || value === 'no') return false;
|
|
8
15
|
});
|