Files
NapCatQQ/.pnpm-store/v3/files/cb/b1b6ef008f48ce72b1c092924e88509be3cba9b2f172db83c85f03f8d915c2a879cac90a242d84ffccaa6bbb2821a3f58d8e9d8a135e15358d39f7e426119f
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

21 lines
481 B
Plaintext

import isIndex from './_isIndex.js';
/**
* The base implementation of `_.nth` which doesn't coerce arguments.
*
* @private
* @param {Array} array The array to query.
* @param {number} n The index of the element to return.
* @returns {*} Returns the nth element of `array`.
*/
function baseNth(array, n) {
var length = array.length;
if (!length) {
return;
}
n += n < 0 ? length : 0;
return isIndex(n, length) ? array[n] : undefined;
}
export default baseNth;