Download web/node_modules/fast-glob/out/utils/array.js from Amitkumar001/Law_Slm: direct link, hf CLI and curl.
- Browser
- Download file 608 Bytes
-
https://huggingface.co/Amitkumar001/Law_Slm/resolve/main/web/node_modules/fast-glob/out/utils/array.js
- Command line
-
hf download hf://Amitkumar001/Law_Slm/web/node_modules/fast-glob/out/utils/array.js
-
curl -L -o array.js https://huggingface.co/Amitkumar001/Law_Slm/resolve/main/web/node_modules/fast-glob/out/utils/array.js
608 Bytes
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.splitWhen = exports.flatten = void 0; | |
| function flatten(items) { | |
| return items.reduce((collection, item) => [].concat(collection, item), []); | |
| } | |
| exports.flatten = flatten; | |
| function splitWhen(items, predicate) { | |
| const result = [[]]; | |
| let groupIndex = 0; | |
| for (const item of items) { | |
| if (predicate(item)) { | |
| groupIndex++; | |
| result[groupIndex] = []; | |
| } | |
| else { | |
| result[groupIndex].push(item); | |
| } | |
| } | |
| return result; | |
| } | |
| exports.splitWhen = splitWhen; | |