Socket
Socket
Sign inDemoInstall

is-svg

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-svg - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

license

16

index.js
'use strict';
function isBinary(buf) {
var isBuf = Buffer.isBuffer(buf);
for (var i = 0; i < 24; i++) {
var charCode = isBuf ? buf[i] : buf.charCodeAt(i);
if (charCode === 65533 || charCode <= 8) {
return true;
}
}
return false;
}
module.exports = function (buf) {
return /<svg[^>]*>/.test(buf);
return !isBinary(buf) && /<svg[^>]*>/.test(buf);
};

2

package.json
{
"name": "is-svg",
"version": "1.0.1",
"version": "1.0.2",
"description": "Check if a String/Buffer is SVG",

@@ -5,0 +5,0 @@ "license": "MIT",

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