Skip to content

Split out util.js to a separate file #796

@jdmarshall

Description

@jdmarshall

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy