Skip to content

Commit

Permalink
chore: back to old logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ovflowd authored Nov 3, 2024
1 parent 5b65fa8 commit 5c90fb4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ async function determineCurrentReleasePhase(now, dates = {}) {
async function parseOptions(options) {
// set up our defaults
const parsedOptions = {
fetch: globalThis.fetch,
now: DateTime.now(),
urls: {
index: 'https://nodejs.org/dist/index.json',
Expand All @@ -233,7 +234,9 @@ async function parseOptions(options) {
};

// allow the end-user to replace our fetch implementation with another one they prefer.
parsedOptions.fetch = await Promise.resolve(options?.fetch ?? globalThis.fetch);
if (options?.fetch) {
parsedOptions.fetch = options.fetch;
}

// allow the end-user to provide a custom DateTime. This is particularly useful for tests.
if (options?.now) {
Expand Down

0 comments on commit 5c90fb4

Please sign in to comment.