forked from lnp2pBot/bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Continue JS -> TS conversion (lnp2pBot#435)
* logger: convert js to ts * db_connect: convert js to ts * models: convert index.js to index.ts Also replace "require" with "import" and "module.exports" with "export". * app: convert js to ts We need to enable esModuleInterop to solve error TS1192: ``` error TS1192: Module '"tls"' has no default export. ``` * bot/messages: fixing types & import/exports * ln: convert js to ts * 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. * 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. * bot/start: fixing types & import/exports * 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. ``` * refactor: correcting a bad practice * refactor: there's no need for isInt()
- Loading branch information
Showing
37 changed files
with
441 additions
and
312 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
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.