import { name, root, version } from "../package.js";
import { createContext } from "../hooks/context.js";
export * from "./env.js";
const ConfigContext = createContext({
    name,
    version,
    root
});
export function getConfig(overrides) {
    if (!overrides)
        return ConfigContext.value;
    return {
        ...ConfigContext.value,
        ...overrides
    };
}
export function withConfig(config, fn) {
    return ConfigContext.run({ ...getConfig(), ...config }, fn);
}
export function setConfig(config) {
    for (const [key, value] of Object.entries(config)) {
        ConfigContext.set(key, value);
    }
}
//# sourceMappingURL=index.js.map