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

styled-breakpoints

Package Overview
Dependencies
Maintainers
1
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styled-breakpoints - npm Package Compare versions

Comparing version 12.1.7 to 12.1.8

19

breakpoints/create-breakpoints-api.prod.js
const { calcMaxWidth } = require('./calc-max-width');
exports.createBreakpointsApi = ({ breakpoints }) => {
const keys = Object.keys(Object(breakpoints));
exports.createBreakpointsApi = ({ breakpoints = {} }) => {
const indexMap = {};
const keys = Object.keys(breakpoints);
const getNextKey = (key) => keys[keys.indexOf(key) + 1];
keys.forEach((key, index) => {
indexMap[key] = index;
});

@@ -11,2 +14,10 @@ const up = (min) => breakpoints[min];

const getNextKey = (key) => {
const currentIndex = indexMap[key];
const nextIndex = currentIndex + 1;
const isNotLastIndex = currentIndex < keys.length - 1;
return isNotLastIndex ? keys[nextIndex] : undefined;
};
const between = (min, max) => ({

@@ -18,3 +29,3 @@ min: up(min),

const only = (key) =>
key === keys.at(-1) ? up(key) : between(key, getNextKey(key));
key !== keys.at(-1) ? between(key, getNextKey(key)) : up(key);

@@ -21,0 +32,0 @@ return {

{
"name": "styled-breakpoints",
"version": "12.1.7",
"version": "12.1.8",
"description": "Simple and powerful css breakpoints for styled-components and emotion",

@@ -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