everything-dev
Version:
A consolidated product package for building Module Federation apps with oRPC APIs.
23 lines (21 loc) • 717 B
JavaScript
import { resolveExtendsRef } from "../../merge.mjs";
import { readFileSync } from "node:fs";
//#region src/cli/utils/helpers.ts
function getExtendsRef(config) {
if (typeof config.extends === "string") return config.extends;
if (config.extends && typeof config.extends === "object") return resolveExtendsRef(config.extends, "production");
}
function parseBosRef(ref) {
const match = ref.match(/^bos:\/\/([^/]+)\/(.+)$/);
if (!match?.[1] || !match[2]) return null;
return {
account: match[1],
gateway: match[2]
};
}
function readJsonFile(filePath) {
return JSON.parse(readFileSync(filePath, "utf-8"));
}
//#endregion
export { getExtendsRef, parseBosRef, readJsonFile };
//# sourceMappingURL=helpers.mjs.map