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:
698 bytes
|
Line | |
---|
1 | import { curry, dropWhile, join, pipe, split } from 'ramda';
|
---|
2 | import included from './included';
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * Removes specified characters from the beginning of a string.
|
---|
6 | *
|
---|
7 | * @func trimCharsStart
|
---|
8 | * @memberOf RA
|
---|
9 | * @since {@link https://char0n.github.io/ramda-adjunct/2.24.0|v2.24.0}
|
---|
10 | * @category String
|
---|
11 | * @sig String -> String
|
---|
12 | * @param {string} chars The characters to trim
|
---|
13 | * @param {string} value The string to trim
|
---|
14 | * @return {string} Returns the trimmed string.
|
---|
15 | * @example
|
---|
16 | *
|
---|
17 | * RA.trimCharsStart('_-', '-_-abc-_-'); //=> 'abc-_-'
|
---|
18 | */
|
---|
19 |
|
---|
20 | var trimCharsStart = curry(function (chars, value) {
|
---|
21 | return pipe(split(''), dropWhile(included(chars)), join(''))(value);
|
---|
22 | });
|
---|
23 | export default trimCharsStart; |
---|
Note:
See
TracBrowser
for help on using the repository browser.