langsmith
Version:
Client library to connect to the LangSmith Observability and Evaluation Platform.
15 lines (14 loc) • 448 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.shuffle = shuffle;
function shuffle(array) {
let currentIndex = array.length;
while (currentIndex !== 0) {
const randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
const tmp = array[currentIndex];
array[currentIndex] = array[randomIndex];
array[randomIndex] = tmp;
}
return array;
}