UNPKG

together-ai-sdk

Version:

A typescript SDK for the Together AI API

15 lines (14 loc) 454 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.indexArray = void 0; /** * Returns an array of defined length where each element is its index * @param length - the length of the array * @returns an array with defined length */ const indexArray = (length) => { if (length <= 0 || !isFinite(length)) return []; return [...(new Array(Math.floor(length))).keys()]; }; exports.indexArray = indexArray;