-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert JS to TS (commits 7-13 of PR435) - attempt#2 (#585)
* util/index: convert js to ts The languageModel & fiatModel interface created to type-check the data and ensure that it conforms to the expected structure and format. This can help you avoid errors and bugs when working with the data in your code. This commit enables resolveJsonModule to import module with '.json' extension. Co-authored-by: webwarrior <[email protected]> * jobs: convert js to ts The --downlevelIteration flag is a TypeScript compiler option that enables support for iterating over new concepts like Map, Set, or Generator in older JavaScript runtimes. By default, TypeScript targets ES3, which does not support these features. If you use a for...of loop or a spread operator on an iterable object, you may get an error. Use Date instead of Date.toISOString cause paid_at has type Date and during the conversion from js to ts, we got compilation errors. Co-authored-by: webwarrior <[email protected]> * bot/start: fixing types & import/exports Co-authored-by: webwarrior <[email protected]> * bot/validation: convert js to ts Using null instead of a boolean/undefined type is better. * lnurl/lnurl-pay: convert js to ts I had to change the '|', otherwise typescript would complain this error msg: ``` The '|' operator is not allowed for boolean types. Consider using '||' instead. ``` Co-authored-by: webwarrior <[email protected]> * refactor: correcting a bad practice * refactor: there's no need for isInt() * bot: fix bugs in validations.ts Fix bugs in validations.ts introduced in d36a6b7 when porting to TypeScript. * bot,util: fix bug in validateAdmin Fixed bug in validateAdmin that would throw an error when community is null even though null value is valid in this case. * bot: fix date comparison in isValidInvoice Don't convert dates to strings in isValidInvoice. * WIP: added some debug logging Added debug logging for case when `Invoice expiry is too short` error is encountered. * WIP: more debug logging Added debug logging of message that caused error when taking dispute in community. * bot,util,locales,tests: don't use objects in locales Don't use object properties inside locales, as it doesn't work and leads to parse errors. --------- Co-authored-by: Mehrshad <[email protected]>
- Loading branch information
1 parent
2ee0fce
commit a46260d
Showing
29 changed files
with
427 additions
and
311 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.