-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Refactor svg stringifier #1593
Refactor svg stringifier #1593
Conversation
TrySound
commented
Oct 1, 2021
- rewrote prototype class with functions
- covered with tsdoc
- added a few TODOs for v3
- rewrote prototype class with functions - covered with tsdoc - added a few TODOs for v3
lib/stringifier.js
Outdated
* @typedef {{ | ||
* doctypeStart: string, | ||
* doctypeEnd: string, | ||
* procInstStart: string, | ||
* procInstEnd: string, | ||
* tagOpenStart: string, | ||
* tagOpenEnd: string, | ||
* tagCloseStart: string, | ||
* tagCloseEnd: string, | ||
* tagShortStart: string, | ||
* tagShortEnd: string, | ||
* attrStart: string, | ||
* attrEnd: string, | ||
* commentStart: string, | ||
* commentEnd: string, | ||
* cdataStart: string, | ||
* cdataEnd: string, | ||
* textStart: string, | ||
* textEnd: string, | ||
* indent: string, | ||
* regEntities: RegExp, | ||
* regValEntities: RegExp, | ||
* encodeEntity: (char: string) => string, | ||
* pretty: boolean, | ||
* useShortTags: boolean | ||
* eol: 'lf' | 'crlf', | ||
* finalNewline: boolean, | ||
* }} Options |
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.
Can't we replace that with @typedef {Required<StringifyOptions>} Options
?
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.
indent types are different but maybe easier to store it in state instead
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.
Much better, huh?)
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.
Looks good!