source: node_modules/ramda-adjunct/es/trimEnd.js

main
Last change on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 825 bytes
Line 
1import { invoker } from 'ramda';
2import ponyfill from './internal/ponyfills/String.trimEnd';
3import isFunction from './isFunction';
4export var trimEndPonyfill = ponyfill;
5export var trimEndInvoker = invoker(0, 'trimEnd');
6
7/**
8 * Removes whitespace from the end of a string.
9 *
10 * @func trimEnd
11 * @memberOf RA
12 * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
13 * @category String
14 * @sig String -> String
15 * @param {string} value String value to have the whitespace removed from the end
16 * @return {string} A new string representing the calling string stripped of whitespace from its end (right end).
17 * @see {@link RA.trimEnd|trimEnd}
18 * @example
19 *
20 * RA.trimEnd('abc '); //=> 'abc'
21 */
22
23var trimEnd = isFunction(String.prototype.trimEnd) ? trimEndInvoker : trimEndPonyfill;
24export default trimEnd;
Note: See TracBrowser for help on using the repository browser.