source: node_modules/ramda-adjunct/src/trimStart.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: 843 bytes
RevLine 
[d24f17c]1import { invoker } from 'ramda';
2
3import ponyfill from './internal/ponyfills/String.trimStart';
4import isFunction from './isFunction';
5
6export const trimStartPonyfill = ponyfill;
7
8export const trimStartInvoker = invoker(0, 'trimStart');
9
10/**
11 * Removes whitespace from the beginning of a string.
12 *
13 * @func trimStart
14 * @memberOf RA
15 * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
16 * @category String
17 * @sig String -> String
18 * @param {string} value String value to have the whitespace removed from the beginning
19 * @return {string} A new string representing the calling string stripped of whitespace from its beginning (left end).
20 * @example
21 *
22 * RA.trimStart(' abc'); //=> 'abc'
23 */
24
25const trimStart = isFunction(String.prototype.trimStart)
26 ? trimStartInvoker
27 : trimStartPonyfill;
28
29export default trimStart;
Note: See TracBrowser for help on using the repository browser.