Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSDoc: update head(), last(), and nth() to reflect actual behavior #3459

Merged
merged 6 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/head.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import _nth from './internal/_nth.js';
* @since v0.1.0
* @category List
* @sig [a] -> a | Undefined
* @sig String -> String
* @sig String -> String | Undefined
* @param {Array|String} list
* @return {*}
* @see R.tail, R.init, R.last
Expand All @@ -21,7 +21,7 @@ import _nth from './internal/_nth.js';
* R.head([]); //=> undefined
*
* R.head('abc'); //=> 'a'
* R.head(''); //=> ''
* R.head(''); //=> undefined
*/
var head = _curry1(function(list) {
return _nth(0, list);
Expand Down
4 changes: 2 additions & 2 deletions source/last.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import _nth from './internal/_nth.js';
* @since v0.1.4
* @category List
* @sig [a] -> a | Undefined
* @sig String -> String
* @sig String -> String | Undefined
* @param {*} list
* @return {*}
* @see R.init, R.head, R.tail
Expand All @@ -20,7 +20,7 @@ import _nth from './internal/_nth.js';
* R.last([]); //=> undefined
*
* R.last('abc'); //=> 'c'
* R.last(''); //=> ''
* R.last(''); //=> undefined
*/
var last = _curry1(function(list) {
return _nth(-1, list);
Expand Down
4 changes: 2 additions & 2 deletions source/nth.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import _nth from './internal/_nth.js';
* @since v0.1.0
* @category List
* @sig Number -> [a] -> a | Undefined
* @sig Number -> String -> String
* @sig Number -> String -> String | Undefined
* @param {Number} offset
* @param {*} list
* @return {*}
Expand All @@ -22,7 +22,7 @@ import _nth from './internal/_nth.js';
* R.nth(-99, list); //=> undefined
*
* R.nth(2, 'abc'); //=> 'c'
* R.nth(3, 'abc'); //=> ''
* R.nth(3, 'abc'); //=> undefined
* @symb R.nth(-1, [a, b, c]) = c
* @symb R.nth(0, [a, b, c]) = a
* @symb R.nth(1, [a, b, c]) = b
Expand Down