Add customWindow argument to parse#10
Open
hgenru wants to merge 1 commit intothomasthiebaud:masterfrom
Open
Conversation
Author
|
Yeah, tests failed because DefinitelyTyped/DefinitelyTyped#35890 isn't merged. The open source is complicated. |
Owner
|
Still not merged, I'll check again later |
Author
|
Okay, let's wait. |
That add ability to use the lib in NodeJS
Author
|
MR is merged 🔥🔥🔥 |
| "dompurify": "1.0.10" | ||
| "@types/jsdom": "12.2.3", | ||
| "dompurify": "1.0.10", | ||
| "jsdom": "15.1.1" |
Owner
There was a problem hiding this comment.
jsdom should be a devDependency no?
| import * as htmlStringToReact from '../src/index'; | ||
|
|
||
| describe('Public NodeJS API', () => { | ||
| it('should convert a string to an array of react nodes with custom window', () => { |
Owner
There was a problem hiding this comment.
Can we add a test with no custom window to test if it is getting the default window correctly?
Owner
|
@hgenru I added few comments, can you please review them? |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
That add ability to use the lib in NodeJS
I want to use you library in NodeJS environment. But dompurify uses global window by default.
Last dompurify version has ability to pass custom window. I think you library should have similar ability.
Note that this PR should be merged after PR to DOMPurify typing (DefinitelyTyped/DefinitelyTyped#35890)