WIP - add extractor, generate snippet_data
This commit is contained in:
15
node_modules/is-cwebp-readable/index.js
generated
vendored
Normal file
15
node_modules/is-cwebp-readable/index.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
const fileType = require('file-type');
|
||||
|
||||
module.exports = function isCwebpReadable(buf) {
|
||||
const type = fileType(buf);
|
||||
|
||||
if (!type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const ext = type.ext;
|
||||
|
||||
return ext === 'png' || ext === 'jpg' || ext === 'tif' || ext === 'webp';
|
||||
};
|
||||
Reference in New Issue
Block a user