-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(typedefs): added typedefs #37
base: main
Are you sure you want to change the base?
Conversation
added type definitions to the results for MRZ as well as consolidated all the types into a singular file and exported them from the index.ts file for ease of use with developers. also added comments and documentation where possible and some mild lint clean up
} | ||
|
||
/** | ||
* It takes a string and returns a string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description is not helpful (just describes what already is understandable from the type anotations)
|
||
/** | ||
* It takes a string and returns a string | ||
* @param {string} char - The character to convert. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The params don't need type annotations in JS doc since they are available from the TS types.
- The param description doesn't add helpful context (the function name
letterToNumber
already says it converts a char.
/** | ||
* It takes a string and returns a string | ||
* @param {string} char - The character to convert. | ||
* @returns A function that takes a string and returns a string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The return value does to need type annotation with JS doc since already available from TS
- The description is not helpful
corrected: string; | ||
} | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove those (autogenerated?) comments all over the PR.
They add a lot of unnecessary noise.
* @param {string[]} lines - An array of strings, each string representing a line of the MRZ. | ||
* @param {ParseMRZOptions} options - ParseMRZOptions | ||
* @returns the result of the getResult function. | ||
*/ | ||
export default function parseTD1(lines: string[], options: ParseMRZOptions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add types in return values to all the parsers (this one but also TD2, TD3 etc...)
added type definitions to the results for MRZ as well as consolidated all the types into a singular file and exported them from the index.ts file for ease of use with developers.
also added comments and documentation where possible and some mild lint clean up