You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We used to do this with the config file, too, but refactored our code to create and use a getConfig() function instead. This function only parses the config file once, and just returns the already-parsed version if it has it. That way, we can call the getConfig() function anywhere we need config values without a performance hit.
We should do essentially the same thing for the package.json file data, via a function called getPackageFile().
We'll probably also want to create a get-package-file.test.ts file with appropriate tests.
The text was updated successfully, but these errors were encountered:
Right now, we retrieve the
package.json
file's contents in theindex.ts
file and then thread that object through to steps that need it. Here's where we retrieve it, and here's where we thread it through.We used to do this with the config file, too, but refactored our code to create and use a
getConfig()
function instead. This function only parses the config file once, and just returns the already-parsed version if it has it. That way, we can call thegetConfig()
function anywhere we need config values without a performance hit.We should do essentially the same thing for the
package.json
file data, via a function calledgetPackageFile()
.We'll probably also want to create a
get-package-file.test.ts
file with appropriate tests.The text was updated successfully, but these errors were encountered: