import { List } from '../types' ; import { Maybe } from '@typed/maybe' ; import { curry2 } from '@typed/functions' ; import { slice } from '../slice' ; name export const dropLast = curry2 ( __dropLast ) ; export type DropLast = { < A > ( quanity , list ) : Array < A > ; < A > ( quanity ) : ( list : List < A > ) => Array < A > ; } ; function __dropLast < A > ( quanity , list ) { return slice ( 0 , Maybe . of ( list . length - quanity ) , list ) ; }