reports/frontend/node_modules/es-toolkit/dist/fp/array/at.js
jtricerolph 1c411e402e Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-20 14:37:36 +00:00

25 lines
786 B
JavaScript

const require_at = require("../../array/at.js");
//#region src/fp/array/at.ts
/**
* Creates a function that retrieves elements from the piped array at the specified indices.
*
* Negative indices count back from the end of the array, matching the main {@link at}
* implementation. Use the returned function with {@link pipe}.
*
* @template T - The type of elements in the array.
* @param indices - The indices of the elements to retrieve from the piped array.
* @returns A function that maps a readonly array to a new array of selected values.
*
* @example
* import { at, pipe } from 'es-toolkit/fp';
*
* pipe([10, 20, 30, 40], at([1, -1]));
* // => [20, 40]
*/
function at(indices) {
return function(array) {
return require_at.at(array, indices);
};
}
//#endregion
exports.at = at;