-
Notifications
You must be signed in to change notification settings - Fork 504
Description
Config.get returns an object that still has access to all of the util features, which is why Config.util uses a lot of bind() calls in order to work.
But some of the functions like loadFileConfigs() should probably be hoisted out of there, and possibly deprecated (recursive setModuleDefaults might make sense, but does loadFileConfigs()?)
At present if you call it, the returned values don't end up in the config data, however all of the local variables like NODE_CONFIG_PARSER, and configSources get updated which is wrong.
There might be a better way to do all of this since 'this' isn't actually used that often. Perhaps something with a closure, as a replacement for the overbroad attachProtoDeep(). I'm not sure what the right solution is but what we have is not it.
So it would be useful if someone could clever out how to split the shared state between config.js and the embedded util and extract it.