Skip to content
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

Merged
merged 4 commits into from Oct 7, 2021
Merged

Refactor svg stringifier #1593

merged 4 commits into from Oct 7, 2021

Conversation

TrySound
Copy link
Member

@TrySound 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
Comment on lines 27 to 54
* @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
Copy link
Collaborator

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?

Copy link
Member Author

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much better, huh?)

Copy link
Collaborator

@omgovich omgovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@TrySound TrySound merged commit 65b6bf4 into master Oct 7, 2021
@TrySound TrySound deleted the stringifier branch October 7, 2021 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants