Comparing version 4.3.2 to 4.4.0
'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": { |
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
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
3966
+ Addedfast-xml-parser@4.5.0(transitive)
- Removedfast-xml-parser@3.21.1(transitive)
Updatedfast-xml-parser@^4.1.3