import { createErrorReporter } from "./error-reporter" ; import { createVal } from "./val" ; param { ... function | * } args return { function } export const createArrIncludes = ctx => function arrIncl ( ... args ) { return function holdsFn ( n , msg ? ) { return createErrorReporter ( "arrIncl" , ctx , msg , [ n , ... args ] ) ( ( ) => { let i , j ; let fns = [ ] ; let success = [ ] ; for ( i = 0 ; i < args . length ; i ++ ) { const arg = args [ i ] ; fns . push ( createVal ( ctx ) ( arg ) ) ; success . push ( false ) ; } for ( i = 0 ; i < n . length ; i ++ ) { const item = n [ i ] ; for ( j = 0 ; j < fns . length ; j ++ ) { if ( ! success [ j ] ) { const fn = fns [ j ] ; success [ j ] = success [ j ] || fn ( item ) ; } } } return success . reduce ( ( a , b ) => a && b ) ; } ) ; } ; } ;