详细说明: - 添加了V2版本的工作流页面和结果页面 - 更新了Serena记忆文件 - 添加了详细实施计划文档 - 优化了Vite配置 - 更新了项目文档CLAUDE.md - 构建了演示系统的dist版本 - 包含了exhibition-demo的完整依赖
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const fsWalk = require("@nodelib/fs.walk");
|
|
const reader_1 = require("./reader");
|
|
const stream_1 = require("./stream");
|
|
class ReaderAsync extends reader_1.default {
|
|
constructor() {
|
|
super(...arguments);
|
|
this._walkAsync = fsWalk.walk;
|
|
this._readerStream = new stream_1.default(this._settings);
|
|
}
|
|
dynamic(root, options) {
|
|
return new Promise((resolve, reject) => {
|
|
this._walkAsync(root, options, (error, entries) => {
|
|
if (error === null) {
|
|
resolve(entries);
|
|
}
|
|
else {
|
|
reject(error);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
async static(patterns, options) {
|
|
const entries = [];
|
|
const stream = this._readerStream.static(patterns, options);
|
|
// After #235, replace it with an asynchronous iterator.
|
|
return new Promise((resolve, reject) => {
|
|
stream.once('error', reject);
|
|
stream.on('data', (entry) => entries.push(entry));
|
|
stream.once('end', () => resolve(entries));
|
|
});
|
|
}
|
|
}
|
|
exports.default = ReaderAsync;
|