Skip to content

Commit

Permalink
Fix detection of <SvG>
Browse files Browse the repository at this point in the history
Closes #38
  • Loading branch information
sindresorhus committed May 14, 2024
1 parent ff6e50e commit cb5bef2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function isSvg(string) {
return false;
}

if (!('svg' in jsonObject)) {
if (!Object.keys(jsonObject).some(x => x.toLowerCase() === 'svg')) {
return false;
}

Expand Down
1 change: 1 addition & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ width="75"
height="75"
version="1.1"
></svg>`));
t.true(isSvg('<SvG version="1.1"></SvG>'));
});

test('invalid SVGs', t => {
Expand Down

0 comments on commit cb5bef2

Please sign in to comment.