INNER CODE UNIT · TypeScript
matchingEnvVars
getwud/wud · app/configuration/index.ts:17
const matchingEnvVars = Object.keys(env).filter((envKey) =>
envKey.startsWith(envVarPattern),
);
matchingEnvVars.forEach((matchingEnvVar) => {
const envVarValue = env[matchingEnvVar];
const matchingPropPath = matchingEnvVar
.replace(/_/g, '.')
.toLowerCase();
const matchingPropPathWithoutPrefix = matchingPropPath.replace(
`${prop}.`,
'',
);
setValue(object, matchingPropPathWithoutPrefix, envVarValue);
});
return object;
}
/**