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
|
Rev | Line | |
---|
[d24f17c] | 1 | import { invoker } from 'ramda';
|
---|
| 2 | import ponyfill from './internal/ponyfills/String.trimEnd';
|
---|
| 3 | import isFunction from './isFunction';
|
---|
| 4 | export var trimEndPonyfill = ponyfill;
|
---|
| 5 | export 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 |
|
---|
| 23 | var trimEnd = isFunction(String.prototype.trimEnd) ? trimEndInvoker : trimEndPonyfill;
|
---|
| 24 | export default trimEnd; |
---|
Note:
See
TracBrowser
for help on using the repository browser.