Repository navigation
Declare the missing options in the AlaSQLOptions type - #3085
Open
zzoraemon043 wants to merge 1 commit into
Open
zzoraemon043 wants to merge 1 commit into
zzoraemon043 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
alasql.optionshas six options thatAlaSQLOptionsintypes/alasql.d.tsdoes not declare, so TypeScript rejects code that sets them:The same goes for
csvStringToNumber,joinstar,loopbreak,maxCteIterationsandprogress. All six are in the defaults insrc/17alasql.jsand read by the engine.Types added:
dateAsString: boolean,csvStringToNumber: booleanjoinstar: 'overwrite' | 'underscore' | 'json', the values424select.jschecksloopbreak: number(SEARCH),maxCteIterations: number(recursive CTE)progress: false | ((a: number, b: number) => void). The two async batch forms pass the arguments in different orders (The progress option gets different arguments from the array and string forms of alasql.promise #2978), so the type only says two numbers.Only the declaration file changes. Checked with
tsc --stricton a file that sets each option: 8 errors before, none after, and@ts-expect-errorstill catchesjoinstar = 'dots'anddateAsString = 'no'.yarn test-onlyafterbuild.sh: 2657 pass, and the same 9 tests fail before and after (Test 107-B Excel files and two CLI pipe tests, on Windows).