You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getSheetId fails with an error when called without an argument. #654
hf.getSheetId throws the Cannot read property 'toLowerCase' of undefined, when called without an argument.
It also fails with sheetDisplayName.toLowerCase is not a function if called with a number as an argument.
In TS, but JS allows undefined args. We may do better here and return undefined assuming that such sheet name does not exist. One if (typeof sheetName === 'string') WDYT?
When I look closer at the other functions similar to this I can see there's basically no type validation anywhere, so it's an issue with many of the methods.
Is this intentional?
When I look closer and the other functions similar to this I can see there's basically no type validation anywhere, so it's an issue with many of the methods.
Is this intentional?
Yes, in the sense that the code was written with TS-mindset in mind, not with JS-mindset.
In TS, but JS allows undefined args. We may do better here and return undefined assuming that such sheet name does not exist. One if (typeof sheetName === 'string') WDYT?
To be consistent it would require to add basic typechecking to all the API functions. We can do it, but it's a little bit more of an effort.
Activity
izulin commentedon Apr 26, 2021
It is explicitly stated as a function taking
stringas an argument in the docs.wojciechczerniak commentedon Apr 26, 2021
In TS, but JS allows undefined args. We may do better here and return
undefinedassuming that such sheet name does not exist. Oneif (typeof sheetName === 'string')WDYT?jansiegel commentedon Apr 27, 2021
When I look closer at the other functions similar to this I can see there's basically no type validation anywhere, so it's an issue with many of the methods.
Is this intentional?
izulin commentedon Apr 27, 2021
Yes, in the sense that the code was written with TS-mindset in mind, not with JS-mindset.
izulin commentedon Apr 27, 2021
To be consistent it would require to add basic typechecking to all the API functions. We can do it, but it's a little bit more of an effort.
Move #654 to unreleased.
Update changelog with unreleased changes. (#683)