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

@solid-primitives/media

Package Overview
Dependencies
Maintainers
3
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/media - npm Package Compare versions

Comparing version 2.1.4 to 2.1.5

11

dist/index.js

@@ -0,3 +1,4 @@

import { isServer } from 'solid-js/web';
import { makeEventListener } from '@solid-primitives/event-listener';
import { createHydratableSignal, createHydratableStaticStore, entries } from '@solid-primitives/utils';
import { noop, createHydratableSignal, createHydratableStaticStore, entries } from '@solid-primitives/utils';
import { createHydratableSingletonRoot } from '@solid-primitives/rootless';

@@ -7,2 +8,5 @@

function makeMediaQueryListener(query, callback) {
if (isServer) {
return noop;
}
const mql = typeof query === "string" ? window.matchMedia(query) : query;

@@ -12,2 +16,5 @@ return makeEventListener(mql, "change", callback);

function createMediaQuery(query, serverFallback = false) {
if (isServer) {
return () => serverFallback;
}
const mql = window.matchMedia(query);

@@ -32,3 +39,3 @@ const [state, setState] = createHydratableSignal(serverFallback, () => mql.matches);

const fallback = options.fallbackState ?? getEmptyMatchesFromBreakpoints(breakpoints);
if (!window.matchMedia)
if (isServer || !window.matchMedia)
return fallback;

@@ -35,0 +42,0 @@ const { mediaFeature = "min-width", watchChange = true } = options;

49

package.json
{
"name": "@solid-primitives/media",
"version": "2.1.4",
"version": "2.1.5",
"description": "Primitives for media query and device features",

@@ -47,38 +47,7 @@ "author": "David Di Biase <dave.dibiase@gmail.com>",

"type": "module",
"main": "./dist/server.cjs",
"module": "./dist/server.js",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"browser": {
"./dist/server.js": "./dist/index.js",
"./dist/server.cjs": "./dist/index.cjs"
},
"browser": {},
"exports": {
"worker": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/server.js"
},
"require": "./dist/server.cjs"
},
"browser": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": "./dist/index.cjs"
},
"deno": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/server.js"
},
"require": "./dist/server.cjs"
},
"node": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/server.js"
},
"require": "./dist/server.cjs"
},
"import": {

@@ -91,8 +60,8 @@ "types": "./dist/index.d.ts",

"dependencies": {
"@solid-primitives/event-listener": "^2.2.8",
"@solid-primitives/rootless": "^1.3.0",
"@solid-primitives/utils": "^5.5.0"
"@solid-primitives/event-listener": "^2.2.9",
"@solid-primitives/rootless": "^1.3.1",
"@solid-primitives/utils": "^5.5.1"
},
"peerDependencies": {
"solid-js": "^1.6.0"
"solid-js": "^1.6.12"
},

@@ -103,3 +72,3 @@ "typesVersions": {},

"page": "vite build dev",
"build": "jiti ../../scripts/build.ts --ssr",
"build": "jiti ../../scripts/build.ts",
"test": "vitest -c ../../configs/vitest.config.ts",

@@ -106,0 +75,0 @@ "test:ssr": "pnpm run test --mode ssr"

Sorry, the diff of this file is not supported yet

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