Function
IsIPRange
(options?: IsIPRangeOptions)
Source from the content-addressed store, hash-verified
| 27 | * z.string().optional().transform(...).pipe(IsIPRange({ requireCIDR: false })) |
| 28 | */ |
| 29 | export function IsIPRange(options?: IsIPRangeOptions) { |
| 30 | return z |
| 31 | .array(z.string()) |
| 32 | .refine((arr) => arr.every((item) => isIPOrRange(item, options)), 'Must be an ip address or ip address range'); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Like z.object().partial(), but rejects objects where every field is undefined. |
Tested by
no test coverage detected