Open
Conversation
1cc342f to
09f47f1
Compare
ogonkov
reviewed
Nov 10, 2020
| return content.includes('<svg'); | ||
| } | ||
|
|
||
| exports.isImage = isImage; |
There was a problem hiding this comment.
This module file name (is-file-type) is misleading. I would expect that it exports single function (isFileType), but it actually the set of utilities to detect file type.
I guess that this file should be renamed to something more appropriate, or, this exports should be split as separate modules.
ogonkov
reviewed
Nov 10, 2020
|
|
||
| /** | ||
| * detect whether content is an image | ||
| * @param {Buffer} content |
|
|
||
| /** | ||
| * detect whether content is an image | ||
| * @param {string} content |
|
|
||
| module.exports.NAMESPACE = NAMESPACE; | ||
|
|
||
| module.exports.raw = true; |
Contributor
Author
There was a problem hiding this comment.
What is purpose of this change?
this will make the first argument of loader become a Buffer from a string, so that we can detect whether it is an valid image file using image-size. (image-size is also required by svg-baker so I chose it for detecting image)
09f47f1 to
3dd3e4c
Compare
3dd3e4c to
16af42a
Compare
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.
What kind of change does this PR introduce? (bugfix, feature, docs update, improvement)
improvement.
What is the current behavior? (You can also link to an open issue here)
Not support raster image.
What is the new behavior (if this is a feature change)?
Support raster image. Close #179
Does this PR introduce a breaking change?
No.
Please check if the PR fulfills contributing guidelines