Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@assortment/darkmodejs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@assortment/darkmodejs - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

24

index.js

@@ -16,19 +16,21 @@ module.exports = ({ onChange = () => {} }) => {

if (!isSupported) {
return onChange(themes.NO_SUPP, themes);
if (isSupported) {
if (darkQuery.matches) onChange(themes.DARK, themes);
if (lightQuery.matches) onChange(themes.LIGHT, themes);
if (noPrefQuery.matches) onChange(themes.NO_PREF, themes);
darkQuery.addListener(darkQueryListener);
lightQuery.addListener(lightQueryListener);
} else {
onChange(themes.NO_SUPP, themes);
}
if (darkQuery.matches) onChange(themes.DARK, themes);
if (lightQuery.matches) onChange(themes.LIGHT, themes);
if (noPrefQuery.matches) onChange(themes.NO_PREF, themes);
darkQuery.addListener(darkQueryListener);
lightQuery.addListener(lightQueryListener);
return {
removeListeners: () => {
darkQuery.removeListener(darkQueryListener);
lightQuery.removeListener(lightQueryListener);
if (isSupported) {
darkQuery.removeListener(darkQueryListener);
lightQuery.removeListener(lightQueryListener);
}
}
}
};
{
"name": "@assortment/darkmodejs",
"version": "1.0.0",
"version": "1.0.1",
"description": "Utility package for managing Dark Mode on the web",

@@ -5,0 +5,0 @@ "main": "index.js",

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