Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: records of pick callback in dns interceptor is a nested object #3961

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

EAGzzyCSL
Copy link

This relates to...

fix d.ts of dns interceptor['pick']

Rationale

the parameter records pass to pick is from this.#records, ref code

ths.#records is a map with type Record<string, {records: {4: { ips: DNSInterceptorRecord[] } , 6: ...}}>, ref code

Status

@@ -20,7 +20,7 @@ declare namespace Interceptors {
maxTTL?: number
maxItems?: number
lookup?: (hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void
pick?: (origin: URL, records: DNSInterceptorOriginRecords, affinity: 4 | 6) => DNSInterceptorRecord
pick?: (origin: URL, records: { records: DNSInterceptorOriginRecords }, affinity: 4 | 6) => DNSInterceptorRecord
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a bug in the implementation rather than the types..

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh no…,what should we do? Change implementation will cause a breaking change but fix types is odd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants