import { getEq } from 'fp-ts/lib/Array' ; import { Eq } from 'fp-ts/lib/Eq' ; import { takeLast } from './takeLast' ; function _endsWith < A > ( E ) { const eqArray = getEq ( E ) ; return ( suffix , as ) => eqArray . equals ( suffix , takeLast ( suffix . length , as ) ) ; } since export function endsWith < A > ( E ) ; export function endsWith < A > ( E ) { const endsWithE = _endsWith ( E ) ; return ( suffix , oas ) => { if ( oas === undefined ) { return ( as ) => endsWithE ( suffix , as ) ; } else { return endsWithE ( suffix , oas ) ; } } ; }