feat: better media types detection for JSON, XML and HTML lenses (#1438)

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
Co-authored-by: Liyas Thomas <liyascthomas@gmail.com>
This commit is contained in:
Kévin Dunglas
2021-01-26 05:27:11 +01:00
committed by GitHub
parent d2dfb4c8df
commit 07f370d6d2
9 changed files with 37 additions and 45 deletions

View File

@@ -1,14 +1,7 @@
const imageLens = {
lensName: "Image",
supportedContentTypes: [
"image/gif",
"image/jpeg",
"image/png",
"image/bmp",
"image/svg+xml",
"image/x-icon",
"image/vnd.microsoft.icon",
],
isSupportedContentType: (contentType) =>
/\bimage\/(?:gif|jpeg|png|bmp|svg\+xml|x-icon|vnd\.microsoft\.icon)\b/i.test(contentType),
renderer: "imageres",
rendererImport: () => import("~/components/lenses/renderers/ImageLensRenderer"),
}