Skip to content

fix: improve null support#40

Merged
mnahkies merged 6 commits into
masterfrom
mn/fix/improve-null-support
Apr 22, 2023
Merged

fix: improve null support#40
mnahkies merged 6 commits into
masterfrom
mn/fix/improve-null-support

Conversation

@mnahkies

Copy link
Copy Markdown
Owner
  • avoid double/redundant null in types
  • handle nullable numbers better
  • extract some helper functions for common type operations, and consolidate some codepaths


export type t_code_scanning_default_setup = {
languages?: "javascript" | "python" | "ruby"[]
languages?: ("javascript" | "python" | "ruby")[]

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Previously we erroneously made this property accept some javascript/python or an array of the string ruby only 🤦 - with the new helper functions we do a better job of adding ()

readonly first_patched_version: {
readonly identifier: string
} | null | null
} | null

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Other main change is to remove these redundant null types

message?: string
resource?: string
value?: string | null | number | string[]
value?: (string | null) | (number | null) | string[]

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Technically these () are superfluous, but probably not worth trying to change right now

@mnahkies
mnahkies marked this pull request as ready for review April 22, 2023 09:19
@mnahkies
mnahkies merged commit c2c3c1f into master Apr 22, 2023
@mnahkies
mnahkies deleted the mn/fix/improve-null-support branch April 22, 2023 09:20
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.

1 participant