UNPKG

tamda

Version:

Practical functional programming library for TypeScript

22 lines (21 loc) 733 B
/** * Returns the last character in a string `text`, or `undefined` if empty. * @param text String to get last character from. */ export declare function last(text: string): string | undefined; /** * Returns the last item in an `array`, or `undefined` if empty. * @param array Array to get last item from. */ export declare function last<T>(array: T[]): T | undefined; /** * Returns a function that * returns the last item in a `list`, or `undefined` if empty. */ export declare function last(): typeof deferred; /** * Returns the last item in a `list`, or `undefined` if empty. * @param list List to get last item from. */ declare function deferred<T>(list: string | T[]): T | undefined; export {};