- array<input>(): ArrayChainable<ArrayP<input, unknown>>
Returns ArrayChainable<ArrayP<input, unknown>>
- array<input, const pattern>(pattern): ArrayChainable<ArrayP<input, pattern>>
Type Parameters
- input
- const pattern extends readonly [] | readonly [unknown, unknown] | readonly [unknown, unknown] | {
[k: string]: unknown;
} | Primitives | UnknownMatcher | readonly UnknownPattern[] | readonly [UnknownPattern, UnknownPattern] | readonly [UnknownPattern, UnknownPattern] | PatternMatcher<WithDefault<UnwrapArray<input>, unknown>> | {
readonly [k in string | number | symbol]?: Pattern<Readonly<MergeUnion<Exclude<WithDefault<UnwrapArray<input>, unknown>, (readonly any[] | Primitives | Map<any, any> | Set<any>)>>>[k]>
}
Returns ArrayChainable<ArrayP<input, pattern>>
P.array(subpattern)
takes a sub pattern and returns a pattern, which matches arrays if all their elements match the sub pattern.Read the documentation for
P.array
on GitHub