初始化项目,添加 favicon.ico、screenshot.png 等静态资源文件,以及 Vue、TailwindCSS 等依赖项。配置了 Vite 和 PostCSS,并生成了基本的项目结构。
23 lines
608 B
JavaScript
23 lines
608 B
JavaScript
"use strict";
|
|
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;
|