is-cwebp-readable
Advanced tools
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" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1
4676
7
10
1
+ Addedfile-type@^2.0.4
+ Addedarray-find-index@1.0.2(transitive)
+ Addedcamelcase@2.1.1(transitive)
+ Addedcamelcase-keys@2.1.0(transitive)
+ Addedcurrently-unhandled@0.4.1(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedfile-type@2.12.0(transitive)
+ Addedfind-up@1.1.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-stdin@4.0.1(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedindent-string@2.1.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-finite@1.1.0(transitive)
+ Addedis-utf8@0.2.1(transitive)
+ Addedload-json-file@1.1.0(transitive)
+ Addedloud-rejection@1.6.0(transitive)
+ Addedmap-obj@1.0.1(transitive)
+ Addedmeow@3.7.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@2.1.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@1.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpinkie@2.0.4(transitive)
+ Addedpinkie-promise@2.0.1(transitive)
+ Addedread-chunk@1.0.1(transitive)
+ Addedread-pkg@1.1.0(transitive)
+ Addedread-pkg-up@1.0.1(transitive)
+ Addedredent@1.0.0(transitive)
+ Addedrepeating@2.0.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedstrip-bom@2.0.0(transitive)
+ Addedstrip-indent@1.0.1(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtrim-newlines@1.0.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
- Removedis-jpg@^1.0.0
- Removedis-png@^1.0.0
- Removedis-tif@^1.0.0
- Removedis-webp@^1.0.0
- Removedis-jpg@1.0.1(transitive)
- Removedis-png@1.1.0(transitive)
- Removedis-tif@1.0.1(transitive)
- Removedis-webp@1.0.1(transitive)