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

bootstrap-detect-breakpoint

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootstrap-detect-breakpoint - npm Package Compare versions

Comparing version 1.0.2 to 1.0.4

9

package.json
{
"name": "bootstrap-detect-breakpoint",
"version": "1.0.2",
"version": "1.0.4",
"description": "Detect the current Bootstrap 4 breakpoint in JavaScript",

@@ -25,3 +25,8 @@ "main": "index.js",

},
"homepage": "https://github.com/shaack/bootstrap-detect-breakpoint#readme"
"homepage": "https://github.com/shaack/bootstrap-detect-breakpoint#readme",
"devDependencies": {
"bootstrap": "^4.4.1",
"jquery": "^3.5.1",
"popper.js": "^1.16.1"
}
}

@@ -16,3 +16,3 @@ # bootstrap-detect-breakpoint

```js
DetectBreakpoint.current()
var currentBreakpoint = bootstrapDetectBreakpoint()
```

@@ -29,2 +29,2 @@ which will return an object with the current breakpoint name and index,

The index goes fro 0-4, where 0 is "xs" and 4 is "xl".
The index goes from 0 to 4, where 0 is "xs" and 4 is for "xl".

@@ -1,2 +0,2 @@

const DetectBreakpoint = (function () {
const bootstrapDetectBreakpoint = function () {
const breakpointNames = ["xl", "lg", "md", "sm", "xs"]

@@ -7,14 +7,10 @@ let breakpointValues = []

}
return {
current: () => {
let i = breakpointNames.length
for (const breakpointName of breakpointNames) {
i--
if (window.matchMedia("(min-width: " + breakpointValues[breakpointName] + ")").matches) {
return {name: breakpointName, index: i}
}
}
return null
let i = breakpointNames.length
for (const breakpointName of breakpointNames) {
i--
if (window.matchMedia("(min-width: " + breakpointValues[breakpointName] + ")").matches) {
return {name: breakpointName, index: i}
}
}
})()
return null
}

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