Skip to content

Instantly share code, notes, and snippets.

@ca057
Last active September 19, 2017 19:29
Show Gist options
  • Save ca057/afdb5515f7fea0dfbde21accfb933d91 to your computer and use it in GitHub Desktop.
Save ca057/afdb5515f7fea0dfbde21accfb933d91 to your computer and use it in GitHub Desktop.
// @flow
import { flip, concat } from 'ramda';
type AppendString =
| ((end: string) => (base: string) => string)
| ((end: string, base: string) => string);
/**
* Appends a string to another string, can be used curried.
*
* @example
* appendString('.jpg')('filename') // filename.jpg
*/
export const appendString: AppendString = flip(concat);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment