Gathering detailed insights and metrics for svg-classlist-polyfill
Gathering detailed insights and metrics for svg-classlist-polyfill
Gathering detailed insights and metrics for svg-classlist-polyfill
Gathering detailed insights and metrics for svg-classlist-polyfill
Polyfills classList methods (contains, add, remove and toggle) on SVG elements
npm install svg-classlist-polyfill
Typescript
Module System
Node Version
NPM Version
JavaScript (81.77%)
HTML (18.23%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
3 Stars
11 Commits
2 Forks
1 Watchers
1 Branches
3 Contributors
Updated on Jul 02, 2023
Latest Version
1.1.0
Package Id
svg-classlist-polyfill@1.1.0
Unpacked Size
2.73 kB
Size
1.33 kB
File Count
3
NPM Version
9.7.2
Node Version
18.16.1
Published on
Jul 02, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Polyfill for classList methods (contains, add, remove, toggle) on SVG elements which aren't supported on IE11 and other older browsers.
npm install svg-classlist-polyfill
import 'svg-classlist-polyfill'
That's it, polyfill will only be added if current environment doesn't already support the methods. Here is how regular usage afterwards might look like:
1const icon = document.querySelector('svg.icon') 2 3icon.classList.add('icon--blue') 4icon.classList.toggle('icon--rotate') 5icon.classList.remove('icon--blue') 6icon.classList.contains('icon--blue') === false
Avoid setting the class with icon.className = 'icon icon--blue'
as this isn't properly supported in IE11 and will not work together with the polyfill.
There are a few test cases available in test.js
. Serve a simple website with npm test
opening this in a browser will run a few test cases quickly indicating whether the polyfill is working well.
Sourcecode partially taken from this Gist.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 2/11 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More