Skip to content

Commit

Permalink
name arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
sabrenner committed Feb 18, 2025
1 parent 0430d54 commit 4680c2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions initialize.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ const brokenLoaders = NODE_MAJOR === 18 && NODE_MINOR === 0
const iitmExclusions = [/langsmith/, /openai\/_shims/, /openai\/resources\/chat\/completions\/messages/]

export async function load (...args) {
const iitmExclusionsMatch = iitmExclusions.some((exclusion) => exclusion.test(args[0]))
const loadHook = (brokenLoaders || iitmExclusionsMatch) ? args[args.length - 1] : origLoad
const url = args[0]
const nextLoad = args[args.length - 1]

const iitmExclusionsMatch = iitmExclusions.some((exclusion) => exclusion.test(url))
const loadHook = (brokenLoaders || iitmExclusionsMatch) ? nextLoad : origLoad
return insertInit(await loadHook(...args))
}

Expand Down

0 comments on commit 4680c2e

Please sign in to comment.