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(common): type def for cors delegated callback function option #12817

Merged
merged 1 commit into from
Dec 18, 2023

Conversation

micalevisk
Copy link
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: closes #12816

What is the new behavior?

we can now supply null to the callback as the cors docs suggests

A better definition would be:

export interface CorsOptionsCallback {
  (error: Error): void;
  (error: null, options: CorsOptions): void;
}

but I believe this would introduce a breaking change

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@coveralls
Copy link

Pull Request Test Coverage Report for Build defe7298-93b2-4ba1-87d9-404616e425af

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.258%

Totals Coverage Status
Change from base Build 28622249-a4a3-41da-b843-b4a9abe03767: 0.0%
Covered Lines: 6697
Relevant Lines: 7259

💛 - Coveralls

@micalevisk micalevisk changed the title fix(common): type def for cors callback function fix(common): type def for cors delegated callback function option Nov 23, 2023
@kamilmysliwiec kamilmysliwiec merged commit 91cedae into nestjs:master Dec 18, 2023
5 checks passed
@kamilmysliwiec
Copy link
Member

lgtm

@micalevisk micalevisk deleted the fix/issue-12816 branch December 18, 2023 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CorsOptionsCallback type - Error should be nullable when TS strict=true
3 participants