diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 108a12bf0e..205df9f569 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1601,6 +1601,10 @@ declare namespace R { * Returns a new list with the same elements as the original list, just in the reverse order. */ reverse(list: ReadonlyArray): T[]; + /** + * Returns a new string with the characters in reverse order. + */ + reverse(str: string): string; /** * Scan is similar to reduce, but returns a list of successively reduced values from the left. diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index eacb4558e3..8aef1c65fc 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -977,6 +977,13 @@ type Pair = KeyValuePair; R.reverse([]); // => [] }; +() => { + R.reverse('abc'); // => 'cba' + R.reverse('ab'); // => 'ba' + R.reverse('a'); // => 'a' + R.reverse(''); // => '' +}; + () => { const numbers = [1, 2, 3, 4]; R.scan(R.multiply, 1, numbers); // => [1, 1, 2, 6, 24]