import { createErrorReporter } from "./error-reporter" ; import { createVal } from "./val" ; param { function | * } test return { function } export const createArrTypeMatch = ctx => function arrTypeMatch ( test ) { const predicate = createVal ( ctx ) ( test ) ; return function matchFn ( arr , msg ? ) { return createErrorReporter ( "arrTypeMatch" , ctx , msg , [ arr ] ) ( ( ) => { if ( ! Array . isArray ( arr ) ) return false ; let matches = true ; for ( let i = 0 ; i < arr . length ; i ++ ) { matches = matches && predicate ( arr [ i ] ) ; } return matches ; } ) ; } ; } ;