Cleanup & allow passing fetch function - #19
Open
jdachtera wants to merge 4 commits into
Open
Conversation
jdachtera
commented
Mar 28, 2022
| { | ||
| "compilerOptions": { | ||
| "target": "es5", | ||
| "target": "es2021", |
Author
There was a problem hiding this comment.
Needed to use string.replaceAll here https://github.com/appit-online/youtube-search/pull/19/files#diff-82164b7feebd2bb287f266221d19e985054c7ccf2f3b0e45a6421a5b0ef9e823L23
|
First of all i really need this Second |
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.
Hey @david7117,
thanks for making this useful library.
I worked a bit on cleaning up the code and removing the need for
anytypes. Also I added a first jest test.A probably controversial (and breaking) change is that I removed the dependency to the
gotlibrary and instead allowed to pass your own versionfetchfunction. This makes testing easier and also allows using the library in the browser (e.g. electron) or other environments which are not supported bygot.To get back the
gotfeatures (caching, following redirects, etc) one could easily use https://www.npmjs.com/package/got-fetch and pass it as an option. This makes the library more flexible but also is a breaking change.I would be happy to read your thoughts about this.
Jascha