This PR enhances the enumeration function types to accept both mutable (string[]) and immutable (readonly string[]) string arrays. This allows for better compatibility with as const syntax and provides a more flexible API for users.
Fixes #1314.
Changes
Updated the type signatures in the enumeration function to handle both readonly string[] and string[].
Added new test cases to verify support for readonly string[] as well as maintaining support for string[].
Impact
These changes enable developers to use as const syntax with the enumeration function without any type errors, providing a smoother development experience.
Testing
New tests have been added to ensure that both readonly and plain string arrays are handled correctly. Note that tests don't seem to fail even when the typescript changes haven't been implemented, but there is a type error in the test in VS Code that goes away once this is implemented.
Overview
This PR enhances the enumeration function types to accept both mutable (string[]) and immutable (readonly string[]) string arrays. This allows for better compatibility with
as const
syntax and provides a more flexible API for users.Fixes #1314.
Changes
readonly string[]
andstring[]
.readonly string[]
as well as maintaining support forstring[]
.Impact
These changes enable developers to use as const syntax with the enumeration function without any type errors, providing a smoother development experience.
Testing
New tests have been added to ensure that both readonly and plain string arrays are handled correctly. Note that tests don't seem to fail even when the typescript changes haven't been implemented, but there is a type error in the test in VS Code that goes away once this is implemented.