Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@ function createHook (meta) {
return url
}

// If the file is referencing itself, we need to skip adding the iitm search params
if (url.url === parentURL) {
return {
url: url.url,
shortCircuit: true,
format: url.format
}
}

specifiers.set(url.url, specifier)

return {
Expand Down
8 changes: 8 additions & 0 deletions test/fixtures/cyclical-self.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// File generated from our OpenAPI spec by Stainless.
import * as BatchesAPI from './cyclical-self.mjs'
export class Batches {}
export class BatchesPage {}
(function (Batches) {
Batches.BatchesPage = BatchesAPI.BatchesPage
// eslint-disable-next-line no-class-assign
})(Batches || (Batches = {}))
4 changes: 4 additions & 0 deletions test/hook/cyclical-self.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { Batches, BatchesPage } from '../fixtures/cyclical-self.mjs'
import { strictEqual } from 'assert'

strictEqual(Batches.BatchesPage, BatchesPage)