include node_modules so release .zip is deployable
This commit is contained in:
Generated
Vendored
+25
@@ -0,0 +1,25 @@
|
||||
export const createConfigValueProvider = (configKey, canonicalEndpointParamKey, config) => {
|
||||
const configProvider = async () => {
|
||||
const configValue = config[configKey] ?? config[canonicalEndpointParamKey];
|
||||
if (typeof configValue === "function") {
|
||||
return configValue();
|
||||
}
|
||||
return configValue;
|
||||
};
|
||||
if (configKey === "endpoint" || canonicalEndpointParamKey === "endpoint") {
|
||||
return async () => {
|
||||
const endpoint = await configProvider();
|
||||
if (endpoint && typeof endpoint === "object") {
|
||||
if ("url" in endpoint) {
|
||||
return endpoint.url.href;
|
||||
}
|
||||
if ("hostname" in endpoint) {
|
||||
const { protocol, hostname, port, path } = endpoint;
|
||||
return `${protocol}//${hostname}${port ? ":" + port : ""}${path}`;
|
||||
}
|
||||
}
|
||||
return endpoint;
|
||||
};
|
||||
}
|
||||
return configProvider;
|
||||
};
|
||||
Reference in New Issue
Block a user