Socket
Socket
Sign inDemoInstall

is-cwebp-readable

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-cwebp-readable - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

19

index.js

@@ -1,12 +0,15 @@

/*!
* is-webp-readable | MIT (c) Shinnosuke Watanabe
* https://github.com/shinnn/is-webp-readable
*/
'use strict';
var fileType = require('file-type');
module.exports = function isCwebpReadable(buf) {
return require('is-png')(buf) ||
require('is-jpg')(buf) ||
require('is-tif')(buf) ||
require('is-webp')(buf);
var type = fileType(buf);
if (!type) {
return false;
}
var ext = type.ext;
return ext === 'png' || ext === 'jpg' || ext === 'tif' || ext === 'webp';
};
{
"name": "is-cwebp-readable",
"version": "1.0.0",
"version": "1.0.1",
"description": "Check if a Buffer/Uint8Array is available for cwebp image source",

@@ -11,2 +11,3 @@ "repository": "shinnn/is-cwebp-readable",

"scripts": {
"bench": "matcha benchmark/runner.js",
"pretest": "jscs *.js && eslint *.js",

@@ -42,6 +43,3 @@ "test": "node test.js | tap-spec",

"dependencies": {
"is-jpg": "^1.0.0",
"is-png": "^1.0.0",
"is-tif": "^1.0.0",
"is-webp": "^1.0.0"
"file-type": "^2.0.4"
},

@@ -53,2 +51,3 @@ "devDependencies": {

"jscs": "^1.10.0",
"matcha": "^0.6.0",
"tap-spec": "^2.2.0",

@@ -55,0 +54,0 @@ "tape": "^3.4.0"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc