import { List } from '../types' ; import { curry2 } from '@typed/functions' ; import { length } from '../length' ; name export const startsWith = curry2 ( __startsWith ) ; export type StartsWith = { < A > ( search , list ) : boolean ; < A > ( search ) : ( list : List < A > ) => boolean ; } ; function __startsWith < A > ( search , list ) { const searchCount = length ( search ) ; for ( let i = 0 ; i < searchCount ; ++ i ) if ( search [ i ] !== list [ i ] ) return false ; return true ; }