This repository has been archived on 2026-03-28. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
StasisWarden-Legacy/node_modules/es-toolkit/dist/array/takeWhile.js
T

18 lines
390 B
JavaScript

'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function takeWhile(arr, shouldContinueTaking) {
const result = [];
for (let i = 0; i < arr.length; i++) {
const item = arr[i];
if (!shouldContinueTaking(item)) {
break;
}
result.push(item);
}
return result;
}
exports.takeWhile = takeWhile;