justus 0.0.4 → 0.0.7

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.
@@ -7,11 +7,11 @@ import {
7
7
  Validator,
8
8
  } from '../types'
9
9
 
10
- type UnionArguments = readonly [ Validation, ...Validation[] ]
10
+ export type UnionArguments = readonly [ Validation, ...Validation[] ]
11
11
 
12
12
  /* -------------------------------------------------------------------------- */
13
13
 
14
- type InferOneOfValidationType<A extends UnionArguments> =
14
+ export type InferOneOfValidationType<A extends UnionArguments> =
15
15
  A extends readonly [ infer First, ...infer Rest ] ?
16
16
  First extends Validation ?
17
17
  Rest extends UnionArguments ?
@@ -49,7 +49,7 @@ export function oneOf<A extends UnionArguments>(...args: A): OneOfValidator<A> {
49
49
 
50
50
  /* -------------------------------------------------------------------------- */
51
51
 
52
- type InferAllOfValidationType<A extends UnionArguments> =
52
+ export type InferAllOfValidationType<A extends UnionArguments> =
53
53
  A extends readonly [ infer First, ...infer Rest ] ?
54
54
  First extends Validation ?
55
55
  Rest extends UnionArguments ?
@@ -21,6 +21,7 @@ const KEYS: Exclude<keyof URLConstraints, 'searchParams'>[] = [
21
21
  const OPTIONS: ValidationOptions = {
22
22
  stripAdditionalProperties: false,
23
23
  stripForbiddenProperties: false,
24
+ stripOptionalNulls: false,
24
25
  }
25
26
 
26
27
  /** Constraints to validate a `URL` with. */
@@ -129,10 +130,10 @@ export class URLValidator extends Validator<URL> {
129
130
 
130
131
  const anyURLValidator = new URLValidator()
131
132
 
132
- function _url(): URLValidator
133
- function _url(constraints: URLConstraints): URLValidator
133
+ export function _url(): URLValidator
134
+ export function _url(constraints: URLConstraints): URLValidator
134
135
 
135
- function _url(constraints?: URLConstraints): URLValidator {
136
+ export function _url(constraints?: URLConstraints): URLValidator {
136
137
  return constraints ? new URLValidator(constraints) : anyURLValidator
137
138
  }
138
139