Skip to content

Commit

Permalink
JSDoc: update head(), last(), and nth() to reflect actual behav…
Browse files Browse the repository at this point in the history
…ior (#3459)
  • Loading branch information
Harris-Miller committed May 2, 2024
1 parent ad50734 commit dcaac73
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
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

0 comments on commit dcaac73

Please sign in to comment.