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 4.3.2 to 4.4.0

9

index.js
'use strict';
const parser = require('fast-xml-parser');
const {XMLParser, XMLValidator} = require('fast-xml-parser');

@@ -9,4 +9,3 @@ const isSvg = input => {

// TODO: Remove the `.replace` call when using `fast-xml-parser@4` which has fixed the bug.
input = input.toString().trim().replace(/\n/g, ' ');
input = input.toString().trim();

@@ -18,3 +17,3 @@ if (input.length === 0) {

// Has to be `!==` as it can also return an object with error info.
if (parser.validate(input) !== true) {
if (XMLValidator.validate(input) !== true) {
return false;

@@ -24,2 +23,4 @@ }

let jsonObject;
const parser = new XMLParser();
try {

@@ -26,0 +27,0 @@ jsonObject = parser.parse(input);

{
"name": "is-svg",
"version": "4.3.2",
"version": "4.4.0",
"description": "Check if a string or buffer is SVG",

@@ -40,3 +40,3 @@ "license": "MIT",

"dependencies": {
"fast-xml-parser": "^3.19.0"
"fast-xml-parser": "^4.1.3"
},

@@ -43,0 +43,0 @@ "devDependencies": {

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