@667/ghost-storage-github
Advanced tools
Comparing version 1.1.5 to 1.1.6
@@ -98,9 +98,9 @@ const https = require('https') | ||
const { fileTypeFromBuffer } = await import('file-type') | ||
const { mime } = await fileTypeFromBuffer(buffer) | ||
const filetype = await fileTypeFromBuffer(buffer) | ||
if (!/image/.test(mime)) { | ||
if (!filetype?.mime || !/image/.test(filetype.mime)) { | ||
// return non image files as-is | ||
return { buffer: buffer.toString('base64') } | ||
} | ||
if (/image/.test(mime) && mime.match(/image\/(.*)/)[1] !== this.imageFormat) { | ||
if (/image/.test(filetype.mime) && filetype.mime.match(/image\/(.*)/)[1] !== this.imageFormat) { | ||
const originalExt = file.ext | ||
@@ -107,0 +107,0 @@ const newExt = `.${this.imageFormat}` |
{ | ||
"name": "@667/ghost-storage-github", | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"description": "Save Ghost Blog Content to Github", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
16537