uhop / node-re2

node.js bindings for RE2: fast, safe alternative to backtracking regular expression engines.
Other
495 stars 53 forks source link

Add typecheck as tests. #134

Closed kachick closed 1 year ago

kachick commented 2 years ago

This PR based on #133

When I digging above issue, I found https://github.com/uhop/node-re2/pull/101#issuecomment-829322113 So tried to add typecheckers. Similar ways are used in https://github.com/octokit/types.ts/blob/725c32e3a3827d8e89a232fc09c7225fdaea84e0/test.ts.

kachick commented 2 years ago

Thanks for your review!

moving it to a separate directory, e.g., ts-tests, and adding a different command to run it, e.g., npm run ts-test

How about this change? https://github.com/uhop/node-re2/pull/134/commits/e380c1879074f75604bbb26639248abc3574dacb

uhop commented 2 years ago

Thank you, I plan to review it in the coming days.

uhop commented 1 year ago

The code is in https://github.com/uhop/node-re2/tree/kachick-add-ts-tests branch. It includes the minimal fix from #141. It fails to compile with the latest Typescript.

I am not sure how to handle a type expansion in TS correctly. I am proposing a way in my next commit to this branch. Please review because I am not a TS programmer and can make stupid mistakes. ;-)

uhop commented 1 year ago

Moving the development to #142.