初始化环境文件

This commit is contained in:
CN-JS-HuiBai
2026-04-04 12:49:09 +08:00
parent 07742d2688
commit c607af6fac
5971 changed files with 515160 additions and 18 deletions

43
node_modules/fast-xml-parser/src/cli/read.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
'use strict';
import { Transform } from 'stream';
export default class ReadToEnd extends Transform {
constructor(options = {}) {
super(options);
this._encoding = options.encoding || 'utf8';
this._buffer = '';
}
_transform(chunk, encoding, done) {
this._buffer += chunk.toString(this._encoding);
this.push(chunk);
done();
}
_flush(done) {
this.emit('complete', null, this._buffer);
done();
}
static readToEnd(stream, options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
const dest = new ReadToEnd(options);
stream.pipe(dest);
stream.on('error', (err) => {
stream.unpipe(dest);
callback(err);
});
dest.on('complete', callback);
dest.resume();
return dest;
}
}