@ontos-ai/knowhere-claw 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/_virtual/_rolldown/runtime.js +2 -1
- package/dist/config.js +115 -1
- package/dist/connect-builder.js +181 -0
- package/dist/graph-builder.js +204 -0
- package/dist/index.js +15 -3
- package/dist/kg-service.js +249 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js +212 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js +35 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/util/abi_crosswalk.js +2609 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/util/napi.js +142 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js +103 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js +199 -0
- package/dist/node_modules/.pnpm/@mapbox_node-pre-gyp@1.0.11/node_modules/@mapbox/node-pre-gyp/package.js +67 -0
- package/dist/node_modules/.pnpm/abbrev@1.1.1/node_modules/abbrev/abbrev.js +59 -0
- package/dist/node_modules/.pnpm/ansi-regex@5.0.1/node_modules/ansi-regex/index.js +11 -0
- package/dist/node_modules/.pnpm/aproba@2.1.0/node_modules/aproba/index.js +119 -0
- package/dist/node_modules/.pnpm/are-we-there-yet@2.0.0/node_modules/are-we-there-yet/lib/index.js +13 -0
- package/dist/node_modules/.pnpm/are-we-there-yet@2.0.0/node_modules/are-we-there-yet/lib/tracker-base.js +16 -0
- package/dist/node_modules/.pnpm/are-we-there-yet@2.0.0/node_modules/are-we-there-yet/lib/tracker-group.js +98 -0
- package/dist/node_modules/.pnpm/are-we-there-yet@2.0.0/node_modules/are-we-there-yet/lib/tracker-stream.js +37 -0
- package/dist/node_modules/.pnpm/are-we-there-yet@2.0.0/node_modules/are-we-there-yet/lib/tracker.js +32 -0
- package/dist/node_modules/.pnpm/balanced-match@1.0.2/node_modules/balanced-match/index.js +53 -0
- package/dist/node_modules/.pnpm/brace-expansion@1.1.12/node_modules/brace-expansion/index.js +132 -0
- package/dist/node_modules/.pnpm/color-support@1.1.3/node_modules/color-support/browser.js +18 -0
- package/dist/node_modules/.pnpm/concat-map@0.0.1/node_modules/concat-map/index.js +19 -0
- package/dist/node_modules/.pnpm/console-control-strings@1.1.0/node_modules/console-control-strings/index.js +104 -0
- package/dist/node_modules/.pnpm/delegates@1.0.0/node_modules/delegates/index.js +104 -0
- package/dist/node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/detect-libc.js +221 -0
- package/dist/node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/elf.js +26 -0
- package/dist/node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/filesystem.js +48 -0
- package/dist/node_modules/.pnpm/detect-libc@2.1.2/node_modules/detect-libc/lib/process.js +24 -0
- package/dist/node_modules/.pnpm/emoji-regex@8.0.0/node_modules/emoji-regex/index.js +10 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/copy-sync.js +120 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/copy.js +100 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/copy/index.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/empty/index.js +43 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/file.js +53 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/index.js +27 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/link.js +56 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink-paths.js +89 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink-type.js +35 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/ensure/symlink.js +81 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/fs/index.js +113 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/index.js +29 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/json/index.js +22 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/json/jsonfile.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/json/output-json-sync.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/json/output-json.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/index.js +20 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/make-dir.js +33 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/mkdirs/utils.js +17 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/move/index.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/move/move-sync.js +56 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/move/move.js +49 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/output-file/index.js +30 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/path-exists/index.js +18 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/remove/index.js +27 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/util/async.js +15 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/util/stat.js +131 -0
- package/dist/node_modules/.pnpm/fs-extra@11.3.4/node_modules/fs-extra/lib/util/utimes.js +34 -0
- package/dist/node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/index.js +51 -0
- package/dist/node_modules/.pnpm/fs.realpath@1.0.0/node_modules/fs.realpath/old.js +171 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/base-theme.js +21 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/error.js +27 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/has-color.js +9 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/index.js +224 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/plumbing.js +48 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/process.js +8 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/progress-bar.js +46 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/render-template.js +155 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/set-immediate.js +14 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/set-interval.js +8 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/spin.js +10 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/template-item.js +58 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/theme-set.js +99 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/themes.js +67 -0
- package/dist/node_modules/.pnpm/gauge@3.0.2/node_modules/gauge/wide-truncate.js +22 -0
- package/dist/node_modules/.pnpm/glob@7.2.3/node_modules/glob/common.js +162 -0
- package/dist/node_modules/.pnpm/glob@7.2.3/node_modules/glob/glob.js +451 -0
- package/dist/node_modules/.pnpm/glob@7.2.3/node_modules/glob/sync.js +280 -0
- package/dist/node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/clone.js +20 -0
- package/dist/node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js +362 -0
- package/dist/node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js +92 -0
- package/dist/node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js +255 -0
- package/dist/node_modules/.pnpm/has-unicode@2.0.1/node_modules/has-unicode/index.js +14 -0
- package/dist/node_modules/.pnpm/inflight@1.0.6/node_modules/inflight/inflight.js +45 -0
- package/dist/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js +27 -0
- package/dist/node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js +14 -0
- package/dist/node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/index.js +68 -0
- package/dist/node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/utils.js +19 -0
- package/dist/node_modules/.pnpm/minimatch@3.1.5/node_modules/minimatch/minimatch.js +578 -0
- package/dist/node_modules/.pnpm/nodejieba@2.6.0/node_modules/nodejieba/index.js +46 -0
- package/dist/node_modules/.pnpm/nopt@5.0.0/node_modules/nopt/lib/nopt.js +330 -0
- package/dist/node_modules/.pnpm/npmlog@5.0.1/node_modules/npmlog/log.js +305 -0
- package/dist/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js +54 -0
- package/dist/node_modules/.pnpm/once@1.4.0/node_modules/once/once.js +44 -0
- package/dist/node_modules/.pnpm/path-is-absolute@1.0.1/node_modules/path-is-absolute/index.js +19 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/errors-browser.js +88 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_duplex.js +75 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_passthrough.js +19 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_readable.js +666 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_transform.js +89 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/_stream_writable.js +423 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/async_iterator.js +172 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/buffer_list.js +243 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/destroy.js +77 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/end-of-stream.js +87 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/from-browser.js +10 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/pipeline.js +80 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/state.js +21 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/lib/internal/streams/stream-browser.js +8 -0
- package/dist/node_modules/.pnpm/readable-stream@3.6.2/node_modules/readable-stream/readable-browser.js +23 -0
- package/dist/node_modules/.pnpm/rimraf@3.0.2/node_modules/rimraf/rimraf.js +229 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/comparator.js +79 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/range.js +282 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/classes/semver.js +186 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/clean.js +14 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/cmp.js +41 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/coerce.js +34 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-build.js +15 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare-loose.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/compare.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/diff.js +32 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/eq.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gt.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/gte.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/inc.js +22 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lt.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/lte.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/major.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/minor.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/neq.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/parse.js +19 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/patch.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/prerelease.js +14 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rcompare.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/rsort.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/satisfies.js +18 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/sort.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/functions/valid.js +14 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js +99 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/constants.js +28 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/debug.js +8 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/identifiers.js +23 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/lrucache.js +36 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/parse-options.js +15 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/internal/re.js +84 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/gtr.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/intersects.js +15 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/ltr.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/max-satisfying.js +31 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-satisfying.js +31 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/min-version.js +45 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/outside.js +64 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/simplify.js +35 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/subset.js +102 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/to-comparators.js +11 -0
- package/dist/node_modules/.pnpm/semver@7.7.4/node_modules/semver/ranges/valid.js +17 -0
- package/dist/node_modules/.pnpm/set-blocking@2.0.0/node_modules/set-blocking/index.js +12 -0
- package/dist/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +130 -0
- package/dist/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/signals.js +16 -0
- package/dist/node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js +30 -0
- package/dist/node_modules/.pnpm/strip-ansi@6.0.1/node_modules/strip-ansi/index.js +10 -0
- package/dist/node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js +26 -0
- package/dist/node_modules/.pnpm/util-deprecate@1.0.2/node_modules/util-deprecate/browser.js +59 -0
- package/dist/node_modules/.pnpm/wide-align@1.1.5/node_modules/wide-align/align.js +52 -0
- package/dist/node_modules/.pnpm/wrappy@1.0.2/node_modules/wrappy/wrappy.js +26 -0
- package/dist/tools.js +163 -3
- package/openclaw.plugin.json +1 -1
- package/package.json +15 -6
- package/skills/knowhere/SKILL.md +1 -1
- package/dist/__tests__/channel-route.test.d.ts +0 -1
- package/dist/__tests__/ingest-tool.test.d.ts +0 -1
- package/dist/__tests__/read-result-file-tool.test.d.ts +0 -1
- package/dist/__tests__/tracker-progress.test.d.ts +0 -1
- package/dist/channel-delivery.d.ts +0 -21
- package/dist/client.d.ts +0 -33
- package/dist/config.d.ts +0 -12
- package/dist/error-message.d.ts +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/parser.d.ts +0 -16
- package/dist/session.d.ts +0 -11
- package/dist/store.d.ts +0 -79
- package/dist/text.d.ts +0 -10
- package/dist/tools.d.ts +0 -8
- package/dist/tracker-progress.d.ts +0 -10
- package/dist/types.d.ts +0 -248
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { __commonJSMin, __require } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/legacy-streams.js
|
|
3
|
+
var require_legacy_streams = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
var Stream = __require("stream").Stream;
|
|
5
|
+
module.exports = legacy;
|
|
6
|
+
function legacy(fs) {
|
|
7
|
+
return {
|
|
8
|
+
ReadStream,
|
|
9
|
+
WriteStream
|
|
10
|
+
};
|
|
11
|
+
function ReadStream(path, options) {
|
|
12
|
+
if (!(this instanceof ReadStream)) return new ReadStream(path, options);
|
|
13
|
+
Stream.call(this);
|
|
14
|
+
var self = this;
|
|
15
|
+
this.path = path;
|
|
16
|
+
this.fd = null;
|
|
17
|
+
this.readable = true;
|
|
18
|
+
this.paused = false;
|
|
19
|
+
this.flags = "r";
|
|
20
|
+
this.mode = 438;
|
|
21
|
+
this.bufferSize = 64 * 1024;
|
|
22
|
+
options = options || {};
|
|
23
|
+
var keys = Object.keys(options);
|
|
24
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
25
|
+
var key = keys[index];
|
|
26
|
+
this[key] = options[key];
|
|
27
|
+
}
|
|
28
|
+
if (this.encoding) this.setEncoding(this.encoding);
|
|
29
|
+
if (this.start !== void 0) {
|
|
30
|
+
if ("number" !== typeof this.start) throw TypeError("start must be a Number");
|
|
31
|
+
if (this.end === void 0) this.end = Infinity;
|
|
32
|
+
else if ("number" !== typeof this.end) throw TypeError("end must be a Number");
|
|
33
|
+
if (this.start > this.end) throw new Error("start must be <= end");
|
|
34
|
+
this.pos = this.start;
|
|
35
|
+
}
|
|
36
|
+
if (this.fd !== null) {
|
|
37
|
+
process.nextTick(function() {
|
|
38
|
+
self._read();
|
|
39
|
+
});
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
fs.open(this.path, this.flags, this.mode, function(err, fd) {
|
|
43
|
+
if (err) {
|
|
44
|
+
self.emit("error", err);
|
|
45
|
+
self.readable = false;
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
self.fd = fd;
|
|
49
|
+
self.emit("open", fd);
|
|
50
|
+
self._read();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function WriteStream(path, options) {
|
|
54
|
+
if (!(this instanceof WriteStream)) return new WriteStream(path, options);
|
|
55
|
+
Stream.call(this);
|
|
56
|
+
this.path = path;
|
|
57
|
+
this.fd = null;
|
|
58
|
+
this.writable = true;
|
|
59
|
+
this.flags = "w";
|
|
60
|
+
this.encoding = "binary";
|
|
61
|
+
this.mode = 438;
|
|
62
|
+
this.bytesWritten = 0;
|
|
63
|
+
options = options || {};
|
|
64
|
+
var keys = Object.keys(options);
|
|
65
|
+
for (var index = 0, length = keys.length; index < length; index++) {
|
|
66
|
+
var key = keys[index];
|
|
67
|
+
this[key] = options[key];
|
|
68
|
+
}
|
|
69
|
+
if (this.start !== void 0) {
|
|
70
|
+
if ("number" !== typeof this.start) throw TypeError("start must be a Number");
|
|
71
|
+
if (this.start < 0) throw new Error("start must be >= zero");
|
|
72
|
+
this.pos = this.start;
|
|
73
|
+
}
|
|
74
|
+
this.busy = false;
|
|
75
|
+
this._queue = [];
|
|
76
|
+
if (this.fd === null) {
|
|
77
|
+
this._open = fs.open;
|
|
78
|
+
this._queue.push([
|
|
79
|
+
this._open,
|
|
80
|
+
this.path,
|
|
81
|
+
this.flags,
|
|
82
|
+
this.mode,
|
|
83
|
+
void 0
|
|
84
|
+
]);
|
|
85
|
+
this.flush();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}));
|
|
90
|
+
//#endregion
|
|
91
|
+
export default require_legacy_streams();
|
|
92
|
+
export { require_legacy_streams };
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { __commonJSMin, __require } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/polyfills.js
|
|
3
|
+
var require_polyfills = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
var constants = __require("constants");
|
|
5
|
+
var origCwd = process.cwd;
|
|
6
|
+
var cwd = null;
|
|
7
|
+
var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform;
|
|
8
|
+
process.cwd = function() {
|
|
9
|
+
if (!cwd) cwd = origCwd.call(process);
|
|
10
|
+
return cwd;
|
|
11
|
+
};
|
|
12
|
+
try {
|
|
13
|
+
process.cwd();
|
|
14
|
+
} catch (er) {}
|
|
15
|
+
if (typeof process.chdir === "function") {
|
|
16
|
+
var chdir = process.chdir;
|
|
17
|
+
process.chdir = function(d) {
|
|
18
|
+
cwd = null;
|
|
19
|
+
chdir.call(process, d);
|
|
20
|
+
};
|
|
21
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir);
|
|
22
|
+
}
|
|
23
|
+
module.exports = patch;
|
|
24
|
+
function patch(fs) {
|
|
25
|
+
if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) patchLchmod(fs);
|
|
26
|
+
if (!fs.lutimes) patchLutimes(fs);
|
|
27
|
+
fs.chown = chownFix(fs.chown);
|
|
28
|
+
fs.fchown = chownFix(fs.fchown);
|
|
29
|
+
fs.lchown = chownFix(fs.lchown);
|
|
30
|
+
fs.chmod = chmodFix(fs.chmod);
|
|
31
|
+
fs.fchmod = chmodFix(fs.fchmod);
|
|
32
|
+
fs.lchmod = chmodFix(fs.lchmod);
|
|
33
|
+
fs.chownSync = chownFixSync(fs.chownSync);
|
|
34
|
+
fs.fchownSync = chownFixSync(fs.fchownSync);
|
|
35
|
+
fs.lchownSync = chownFixSync(fs.lchownSync);
|
|
36
|
+
fs.chmodSync = chmodFixSync(fs.chmodSync);
|
|
37
|
+
fs.fchmodSync = chmodFixSync(fs.fchmodSync);
|
|
38
|
+
fs.lchmodSync = chmodFixSync(fs.lchmodSync);
|
|
39
|
+
fs.stat = statFix(fs.stat);
|
|
40
|
+
fs.fstat = statFix(fs.fstat);
|
|
41
|
+
fs.lstat = statFix(fs.lstat);
|
|
42
|
+
fs.statSync = statFixSync(fs.statSync);
|
|
43
|
+
fs.fstatSync = statFixSync(fs.fstatSync);
|
|
44
|
+
fs.lstatSync = statFixSync(fs.lstatSync);
|
|
45
|
+
if (fs.chmod && !fs.lchmod) {
|
|
46
|
+
fs.lchmod = function(path, mode, cb) {
|
|
47
|
+
if (cb) process.nextTick(cb);
|
|
48
|
+
};
|
|
49
|
+
fs.lchmodSync = function() {};
|
|
50
|
+
}
|
|
51
|
+
if (fs.chown && !fs.lchown) {
|
|
52
|
+
fs.lchown = function(path, uid, gid, cb) {
|
|
53
|
+
if (cb) process.nextTick(cb);
|
|
54
|
+
};
|
|
55
|
+
fs.lchownSync = function() {};
|
|
56
|
+
}
|
|
57
|
+
if (platform === "win32") fs.rename = typeof fs.rename !== "function" ? fs.rename : (function(fs$rename) {
|
|
58
|
+
function rename(from, to, cb) {
|
|
59
|
+
var start = Date.now();
|
|
60
|
+
var backoff = 0;
|
|
61
|
+
fs$rename(from, to, function CB(er) {
|
|
62
|
+
if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) {
|
|
63
|
+
setTimeout(function() {
|
|
64
|
+
fs.stat(to, function(stater, st) {
|
|
65
|
+
if (stater && stater.code === "ENOENT") fs$rename(from, to, CB);
|
|
66
|
+
else cb(er);
|
|
67
|
+
});
|
|
68
|
+
}, backoff);
|
|
69
|
+
if (backoff < 100) backoff += 10;
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
if (cb) cb(er);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename);
|
|
76
|
+
return rename;
|
|
77
|
+
})(fs.rename);
|
|
78
|
+
fs.read = typeof fs.read !== "function" ? fs.read : (function(fs$read) {
|
|
79
|
+
function read(fd, buffer, offset, length, position, callback_) {
|
|
80
|
+
var callback;
|
|
81
|
+
if (callback_ && typeof callback_ === "function") {
|
|
82
|
+
var eagCounter = 0;
|
|
83
|
+
callback = function(er, _, __) {
|
|
84
|
+
if (er && er.code === "EAGAIN" && eagCounter < 10) {
|
|
85
|
+
eagCounter++;
|
|
86
|
+
return fs$read.call(fs, fd, buffer, offset, length, position, callback);
|
|
87
|
+
}
|
|
88
|
+
callback_.apply(this, arguments);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return fs$read.call(fs, fd, buffer, offset, length, position, callback);
|
|
92
|
+
}
|
|
93
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read);
|
|
94
|
+
return read;
|
|
95
|
+
})(fs.read);
|
|
96
|
+
fs.readSync = typeof fs.readSync !== "function" ? fs.readSync : (function(fs$readSync) {
|
|
97
|
+
return function(fd, buffer, offset, length, position) {
|
|
98
|
+
var eagCounter = 0;
|
|
99
|
+
while (true) try {
|
|
100
|
+
return fs$readSync.call(fs, fd, buffer, offset, length, position);
|
|
101
|
+
} catch (er) {
|
|
102
|
+
if (er.code === "EAGAIN" && eagCounter < 10) {
|
|
103
|
+
eagCounter++;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
throw er;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
})(fs.readSync);
|
|
110
|
+
function patchLchmod(fs) {
|
|
111
|
+
fs.lchmod = function(path, mode, callback) {
|
|
112
|
+
fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) {
|
|
113
|
+
if (err) {
|
|
114
|
+
if (callback) callback(err);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
fs.fchmod(fd, mode, function(err) {
|
|
118
|
+
fs.close(fd, function(err2) {
|
|
119
|
+
if (callback) callback(err || err2);
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
fs.lchmodSync = function(path, mode) {
|
|
125
|
+
var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode);
|
|
126
|
+
var threw = true;
|
|
127
|
+
var ret;
|
|
128
|
+
try {
|
|
129
|
+
ret = fs.fchmodSync(fd, mode);
|
|
130
|
+
threw = false;
|
|
131
|
+
} finally {
|
|
132
|
+
if (threw) try {
|
|
133
|
+
fs.closeSync(fd);
|
|
134
|
+
} catch (er) {}
|
|
135
|
+
else fs.closeSync(fd);
|
|
136
|
+
}
|
|
137
|
+
return ret;
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
function patchLutimes(fs) {
|
|
141
|
+
if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) {
|
|
142
|
+
fs.lutimes = function(path, at, mt, cb) {
|
|
143
|
+
fs.open(path, constants.O_SYMLINK, function(er, fd) {
|
|
144
|
+
if (er) {
|
|
145
|
+
if (cb) cb(er);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
fs.futimes(fd, at, mt, function(er) {
|
|
149
|
+
fs.close(fd, function(er2) {
|
|
150
|
+
if (cb) cb(er || er2);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
fs.lutimesSync = function(path, at, mt) {
|
|
156
|
+
var fd = fs.openSync(path, constants.O_SYMLINK);
|
|
157
|
+
var ret;
|
|
158
|
+
var threw = true;
|
|
159
|
+
try {
|
|
160
|
+
ret = fs.futimesSync(fd, at, mt);
|
|
161
|
+
threw = false;
|
|
162
|
+
} finally {
|
|
163
|
+
if (threw) try {
|
|
164
|
+
fs.closeSync(fd);
|
|
165
|
+
} catch (er) {}
|
|
166
|
+
else fs.closeSync(fd);
|
|
167
|
+
}
|
|
168
|
+
return ret;
|
|
169
|
+
};
|
|
170
|
+
} else if (fs.futimes) {
|
|
171
|
+
fs.lutimes = function(_a, _b, _c, cb) {
|
|
172
|
+
if (cb) process.nextTick(cb);
|
|
173
|
+
};
|
|
174
|
+
fs.lutimesSync = function() {};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function chmodFix(orig) {
|
|
178
|
+
if (!orig) return orig;
|
|
179
|
+
return function(target, mode, cb) {
|
|
180
|
+
return orig.call(fs, target, mode, function(er) {
|
|
181
|
+
if (chownErOk(er)) er = null;
|
|
182
|
+
if (cb) cb.apply(this, arguments);
|
|
183
|
+
});
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function chmodFixSync(orig) {
|
|
187
|
+
if (!orig) return orig;
|
|
188
|
+
return function(target, mode) {
|
|
189
|
+
try {
|
|
190
|
+
return orig.call(fs, target, mode);
|
|
191
|
+
} catch (er) {
|
|
192
|
+
if (!chownErOk(er)) throw er;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function chownFix(orig) {
|
|
197
|
+
if (!orig) return orig;
|
|
198
|
+
return function(target, uid, gid, cb) {
|
|
199
|
+
return orig.call(fs, target, uid, gid, function(er) {
|
|
200
|
+
if (chownErOk(er)) er = null;
|
|
201
|
+
if (cb) cb.apply(this, arguments);
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function chownFixSync(orig) {
|
|
206
|
+
if (!orig) return orig;
|
|
207
|
+
return function(target, uid, gid) {
|
|
208
|
+
try {
|
|
209
|
+
return orig.call(fs, target, uid, gid);
|
|
210
|
+
} catch (er) {
|
|
211
|
+
if (!chownErOk(er)) throw er;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
function statFix(orig) {
|
|
216
|
+
if (!orig) return orig;
|
|
217
|
+
return function(target, options, cb) {
|
|
218
|
+
if (typeof options === "function") {
|
|
219
|
+
cb = options;
|
|
220
|
+
options = null;
|
|
221
|
+
}
|
|
222
|
+
function callback(er, stats) {
|
|
223
|
+
if (stats) {
|
|
224
|
+
if (stats.uid < 0) stats.uid += 4294967296;
|
|
225
|
+
if (stats.gid < 0) stats.gid += 4294967296;
|
|
226
|
+
}
|
|
227
|
+
if (cb) cb.apply(this, arguments);
|
|
228
|
+
}
|
|
229
|
+
return options ? orig.call(fs, target, options, callback) : orig.call(fs, target, callback);
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
function statFixSync(orig) {
|
|
233
|
+
if (!orig) return orig;
|
|
234
|
+
return function(target, options) {
|
|
235
|
+
var stats = options ? orig.call(fs, target, options) : orig.call(fs, target);
|
|
236
|
+
if (stats) {
|
|
237
|
+
if (stats.uid < 0) stats.uid += 4294967296;
|
|
238
|
+
if (stats.gid < 0) stats.gid += 4294967296;
|
|
239
|
+
}
|
|
240
|
+
return stats;
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
function chownErOk(er) {
|
|
244
|
+
if (!er) return true;
|
|
245
|
+
if (er.code === "ENOSYS") return true;
|
|
246
|
+
if (!process.getuid || process.getuid() !== 0) {
|
|
247
|
+
if (er.code === "EINVAL" || er.code === "EPERM") return true;
|
|
248
|
+
}
|
|
249
|
+
return false;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}));
|
|
253
|
+
//#endregion
|
|
254
|
+
export default require_polyfills();
|
|
255
|
+
export { require_polyfills };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __commonJSMin, __require } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/.pnpm/has-unicode@2.0.1/node_modules/has-unicode/index.js
|
|
3
|
+
var require_has_unicode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
var os = __require("os");
|
|
5
|
+
module.exports = function() {
|
|
6
|
+
if (os.type() == "Windows_NT") return false;
|
|
7
|
+
var isUTF8 = /UTF-?8$/i;
|
|
8
|
+
var ctype = process.env.LC_ALL || process.env.LC_CTYPE || process.env.LANG;
|
|
9
|
+
return isUTF8.test(ctype);
|
|
10
|
+
};
|
|
11
|
+
}));
|
|
12
|
+
//#endregion
|
|
13
|
+
export default require_has_unicode();
|
|
14
|
+
export { require_has_unicode };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_wrappy } from "../../../wrappy@1.0.2/node_modules/wrappy/wrappy.js";
|
|
3
|
+
import { require_once } from "../../../once@1.4.0/node_modules/once/once.js";
|
|
4
|
+
//#region node_modules/.pnpm/inflight@1.0.6/node_modules/inflight/inflight.js
|
|
5
|
+
var require_inflight = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6
|
+
var wrappy = require_wrappy();
|
|
7
|
+
var reqs = Object.create(null);
|
|
8
|
+
var once = require_once();
|
|
9
|
+
module.exports = wrappy(inflight);
|
|
10
|
+
function inflight(key, cb) {
|
|
11
|
+
if (reqs[key]) {
|
|
12
|
+
reqs[key].push(cb);
|
|
13
|
+
return null;
|
|
14
|
+
} else {
|
|
15
|
+
reqs[key] = [cb];
|
|
16
|
+
return makeres(key);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function makeres(key) {
|
|
20
|
+
return once(function RES() {
|
|
21
|
+
var cbs = reqs[key];
|
|
22
|
+
var len = cbs.length;
|
|
23
|
+
var args = slice(arguments);
|
|
24
|
+
try {
|
|
25
|
+
for (var i = 0; i < len; i++) cbs[i].apply(null, args);
|
|
26
|
+
} finally {
|
|
27
|
+
if (cbs.length > len) {
|
|
28
|
+
cbs.splice(0, len);
|
|
29
|
+
process.nextTick(function() {
|
|
30
|
+
RES.apply(null, args);
|
|
31
|
+
});
|
|
32
|
+
} else delete reqs[key];
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function slice(args) {
|
|
37
|
+
var length = args.length;
|
|
38
|
+
var array = [];
|
|
39
|
+
for (var i = 0; i < length; i++) array[i] = args[i];
|
|
40
|
+
return array;
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
//#endregion
|
|
44
|
+
export default require_inflight();
|
|
45
|
+
export { require_inflight };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js
|
|
3
|
+
var require_inherits_browser = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
if (typeof Object.create === "function") module.exports = function inherits(ctor, superCtor) {
|
|
5
|
+
if (superCtor) {
|
|
6
|
+
ctor.super_ = superCtor;
|
|
7
|
+
ctor.prototype = Object.create(superCtor.prototype, { constructor: {
|
|
8
|
+
value: ctor,
|
|
9
|
+
enumerable: false,
|
|
10
|
+
writable: true,
|
|
11
|
+
configurable: true
|
|
12
|
+
} });
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
else module.exports = function inherits(ctor, superCtor) {
|
|
16
|
+
if (superCtor) {
|
|
17
|
+
ctor.super_ = superCtor;
|
|
18
|
+
var TempCtor = function() {};
|
|
19
|
+
TempCtor.prototype = superCtor.prototype;
|
|
20
|
+
ctor.prototype = new TempCtor();
|
|
21
|
+
ctor.prototype.constructor = ctor;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}));
|
|
25
|
+
//#endregion
|
|
26
|
+
export default require_inherits_browser();
|
|
27
|
+
export { require_inherits_browser };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/.pnpm/is-fullwidth-code-point@3.0.0/node_modules/is-fullwidth-code-point/index.js
|
|
3
|
+
var require_is_fullwidth_code_point = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
const isFullwidthCodePoint = (codePoint) => {
|
|
5
|
+
if (Number.isNaN(codePoint)) return false;
|
|
6
|
+
if (codePoint >= 4352 && (codePoint <= 4447 || codePoint === 9001 || codePoint === 9002 || 11904 <= codePoint && codePoint <= 12871 && codePoint !== 12351 || 12880 <= codePoint && codePoint <= 19903 || 19968 <= codePoint && codePoint <= 42182 || 43360 <= codePoint && codePoint <= 43388 || 44032 <= codePoint && codePoint <= 55203 || 63744 <= codePoint && codePoint <= 64255 || 65040 <= codePoint && codePoint <= 65049 || 65072 <= codePoint && codePoint <= 65131 || 65281 <= codePoint && codePoint <= 65376 || 65504 <= codePoint && codePoint <= 65510 || 110592 <= codePoint && codePoint <= 110593 || 127488 <= codePoint && codePoint <= 127569 || 131072 <= codePoint && codePoint <= 262141)) return true;
|
|
7
|
+
return false;
|
|
8
|
+
};
|
|
9
|
+
module.exports = isFullwidthCodePoint;
|
|
10
|
+
module.exports.default = isFullwidthCodePoint;
|
|
11
|
+
}));
|
|
12
|
+
//#endregion
|
|
13
|
+
export default require_is_fullwidth_code_point();
|
|
14
|
+
export { require_is_fullwidth_code_point };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { __commonJSMin, __require } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { require_universalify } from "../../../universalify@2.0.1/node_modules/universalify/index.js";
|
|
3
|
+
import { require_graceful_fs } from "../../../graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js";
|
|
4
|
+
import { require_utils } from "./utils.js";
|
|
5
|
+
//#region node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/index.js
|
|
6
|
+
var require_jsonfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
7
|
+
let _fs;
|
|
8
|
+
try {
|
|
9
|
+
_fs = require_graceful_fs();
|
|
10
|
+
} catch (_) {
|
|
11
|
+
_fs = __require("fs");
|
|
12
|
+
}
|
|
13
|
+
const universalify = require_universalify();
|
|
14
|
+
const { stringify, stripBom } = require_utils();
|
|
15
|
+
async function _readFile(file, options = {}) {
|
|
16
|
+
if (typeof options === "string") options = { encoding: options };
|
|
17
|
+
const fs = options.fs || _fs;
|
|
18
|
+
const shouldThrow = "throws" in options ? options.throws : true;
|
|
19
|
+
let data = await universalify.fromCallback(fs.readFile)(file, options);
|
|
20
|
+
data = stripBom(data);
|
|
21
|
+
let obj;
|
|
22
|
+
try {
|
|
23
|
+
obj = JSON.parse(data, options ? options.reviver : null);
|
|
24
|
+
} catch (err) {
|
|
25
|
+
if (shouldThrow) {
|
|
26
|
+
err.message = `${file}: ${err.message}`;
|
|
27
|
+
throw err;
|
|
28
|
+
} else return null;
|
|
29
|
+
}
|
|
30
|
+
return obj;
|
|
31
|
+
}
|
|
32
|
+
const readFile = universalify.fromPromise(_readFile);
|
|
33
|
+
function readFileSync(file, options = {}) {
|
|
34
|
+
if (typeof options === "string") options = { encoding: options };
|
|
35
|
+
const fs = options.fs || _fs;
|
|
36
|
+
const shouldThrow = "throws" in options ? options.throws : true;
|
|
37
|
+
try {
|
|
38
|
+
let content = fs.readFileSync(file, options);
|
|
39
|
+
content = stripBom(content);
|
|
40
|
+
return JSON.parse(content, options.reviver);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
if (shouldThrow) {
|
|
43
|
+
err.message = `${file}: ${err.message}`;
|
|
44
|
+
throw err;
|
|
45
|
+
} else return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async function _writeFile(file, obj, options = {}) {
|
|
49
|
+
const fs = options.fs || _fs;
|
|
50
|
+
const str = stringify(obj, options);
|
|
51
|
+
await universalify.fromCallback(fs.writeFile)(file, str, options);
|
|
52
|
+
}
|
|
53
|
+
const writeFile = universalify.fromPromise(_writeFile);
|
|
54
|
+
function writeFileSync(file, obj, options = {}) {
|
|
55
|
+
const fs = options.fs || _fs;
|
|
56
|
+
const str = stringify(obj, options);
|
|
57
|
+
return fs.writeFileSync(file, str, options);
|
|
58
|
+
}
|
|
59
|
+
module.exports = {
|
|
60
|
+
readFile,
|
|
61
|
+
readFileSync,
|
|
62
|
+
writeFile,
|
|
63
|
+
writeFileSync
|
|
64
|
+
};
|
|
65
|
+
}));
|
|
66
|
+
//#endregion
|
|
67
|
+
export default require_jsonfile();
|
|
68
|
+
export { require_jsonfile };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region node_modules/.pnpm/jsonfile@6.2.0/node_modules/jsonfile/utils.js
|
|
3
|
+
var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4
|
+
function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) {
|
|
5
|
+
const EOF = finalEOL ? EOL : "";
|
|
6
|
+
return JSON.stringify(obj, replacer, spaces).replace(/\n/g, EOL) + EOF;
|
|
7
|
+
}
|
|
8
|
+
function stripBom(content) {
|
|
9
|
+
if (Buffer.isBuffer(content)) content = content.toString("utf8");
|
|
10
|
+
return content.replace(/^\uFEFF/, "");
|
|
11
|
+
}
|
|
12
|
+
module.exports = {
|
|
13
|
+
stringify,
|
|
14
|
+
stripBom
|
|
15
|
+
};
|
|
16
|
+
}));
|
|
17
|
+
//#endregion
|
|
18
|
+
export default require_utils();
|
|
19
|
+
export { require_utils };
|