Skip to content

Commit

Permalink
name arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrenner committed Feb 20, 2025
1 parent 855473f commit 22cec44
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions initialize.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,10 @@ const [NODE_MAJOR, NODE_MINOR] = process.versions.node.split('.').map(x => +x)
const brokenLoaders = NODE_MAJOR === 18 && NODE_MINOR === 0
const iitmExclusions = [/langsmith/, /openai\/_shims/, /openai\/resources\/chat\/completions\/messages/]

export async function load (...args) {
const url = args[0]
const nextLoad = args[args.length - 1]

export async function load (url, context, nextLoad) {
const iitmExclusionsMatch = iitmExclusions.some((exclusion) => exclusion.test(url))
const loadHook = (brokenLoaders || iitmExclusionsMatch) ? nextLoad : origLoad
return insertInit(await loadHook(...args))
return insertInit(await loadHook(url, context, nextLoad))
}

export const resolve = brokenLoaders ? undefined : origResolve
Expand Down

0 comments on commit 22cec44

Please sign in to comment.