optional:{ Â Â Â Â any: (<T1>(p1) => AnyPredicate<T1>) & (<T1, T2>(p1, p2) => AnyPredicate<T1 | T2>) & (<T1, T2, T3>(p1, p2, p3) => AnyPredicate<T1 | T2 | T3>) & (<T1, T2, T3, T4>(p1, p2, p3, p4) => AnyPredicate<T1 | T2 | T3 | T4>) & (<T1, T2, T3, T4, T5>(p1, p2, p3, p4, p5) => AnyPredicate<T1 | T2 | T3 | T4 | T5>) & (<T1, T2, T3, T4, T5, T6>(p1, p2, p3, p4, p5, p6) => AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6>) & (<T1, T2, T3, T4, T5, T6, T7>(p1, p2, p3, p4, p5, p6, p7) => AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7>) & (<T1, T2, T3, T4, T5, T6, T7, T8>(p1, p2, p3, p4, p5, p6, p7, p8) => AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8>) & (<T1, T2, T3, T4, T5, T6, T7, T8, T9>(p1, p2, p3, p4, p5, p6, p7, p8, p9) => AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>) & (<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10) => AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9 | T10>) & ((...predicate) => AnyPredicate<unknown>); Â Â Â Â array: ArrayPredicate<unknown> & BasePredicate<undefined | unknown[]>; Â Â Â Â arrayBuffer: ArrayBufferPredicate<ArrayBuffer> & BasePredicate<undefined | ArrayBuffer>; Â Â Â Â bigint: BigIntPredicate & BasePredicate<undefined | bigint>; Â Â Â Â boolean: BooleanPredicate & BasePredicate<undefined | boolean>; Â Â Â Â buffer: Predicate<Buffer> & BasePredicate<undefined | Buffer>; Â Â Â Â dataView: DataViewPredicate & BasePredicate<undefined | DataView>; Â Â Â Â date: DatePredicate & BasePredicate<undefined | Date>; Â Â Â Â error: ErrorPredicate & BasePredicate<undefined | Error>; Â Â Â Â float32Array: TypedArrayPredicate<Float32Array> & BasePredicate<undefined | Float32Array>; Â Â Â Â float64Array: TypedArrayPredicate<Float64Array> & BasePredicate<undefined | Float64Array>; Â Â Â Â function: Predicate<Function> & BasePredicate<undefined | Function>; Â Â Â Â int16Array: TypedArrayPredicate<Int16Array> & BasePredicate<undefined | Int16Array>; Â Â Â Â int32Array: TypedArrayPredicate<Int32Array> & BasePredicate<undefined | Int32Array>; Â Â Â Â int8Array: TypedArrayPredicate<Int8Array> & BasePredicate<undefined | Int8Array>; Â Â Â Â iterable: Predicate<Iterable<unknown>> & BasePredicate<undefined | Iterable<unknown>>; Â Â Â Â map: MapPredicate<unknown, unknown> & BasePredicate<undefined | Map<unknown, unknown>>; Â Â Â Â nan: Predicate<number> & BasePredicate<undefined | number>; Â Â Â Â null: Predicate<null> & BasePredicate<undefined | null>; Â Â Â Â nullOrUndefined: Predicate<undefined | null> & BasePredicate<undefined | null>; Â Â Â Â number: NumberPredicate & BasePredicate<undefined | number>; Â Â Â Â object: ObjectPredicate<object> & BasePredicate<undefined | object>; Â Â Â Â promise: Predicate<Promise<unknown>> & BasePredicate<undefined | Promise<unknown>>; Â Â Â Â regExp: Predicate<RegExp> & BasePredicate<undefined | RegExp>; Â Â Â Â set: SetPredicate<any> & BasePredicate<undefined | Set<any>>; Â Â Â Â sharedArrayBuffer: ArrayBufferPredicate<SharedArrayBuffer> & BasePredicate<undefined | SharedArrayBuffer>; Â Â Â Â string: StringPredicate & BasePredicate<undefined | string>; Â Â Â Â symbol: Predicate<symbol> & BasePredicate<undefined | symbol>; Â Â Â Â typedArray: TypedArrayPredicate<TypedArray> & BasePredicate<undefined | TypedArray>; Â Â Â Â uint16Array: TypedArrayPredicate<Uint16Array> & BasePredicate<undefined | Uint16Array>; Â Â Â Â uint32Array: TypedArrayPredicate<Uint32Array> & BasePredicate<undefined | Uint32Array>; Â Â Â Â uint8Array: TypedArrayPredicate<Uint8Array> & BasePredicate<undefined | Uint8Array>; Â Â Â Â uint8ClampedArray: TypedArrayPredicate<Uint8ClampedArray> & BasePredicate<undefined | Uint8ClampedArray>; Â Â Â Â undefined: Predicate<undefined> & BasePredicate<undefined>; Â Â Â Â weakMap: WeakMapPredicate<object> & BasePredicate<undefined | WeakMap<object, unknown>>; Â Â Â Â weakSet: WeakSetPredicate<object> & BasePredicate<undefined | WeakSet<object>>; }
Make the following predicate optional so it doesn't fail when the value is undefined.
Test if the value matches the predicate. Throws an
ArgumentError
if the test fails.