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

bounds

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

bounds - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

13

index.js

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

const clone = require('clone-component');
class Bounds {

@@ -75,8 +73,9 @@

restrict(v) {
const { _min, _max } = this;
if (this.reversed()) {
if(this.after(v) && this.before(v)) {
// select closer bound
return (this._distance(this._max, v) < this._distance(v, this._min)) ?
clone(this._max) :
clone(this._min);
return (this._distance(_max, v) < this._distance(v, _min)) ?
_max:
_min;
}

@@ -86,6 +85,6 @@ return v;

if(this.before(v)) {
return clone(this._min);
return _min;
}
if(this.after(v)) {
return clone(this._max);
return _max;
}

@@ -92,0 +91,0 @@ return v;

{
"name": "bounds",
"version": "2.0.0",
"version": "3.0.0",
"description": "Mixin for checking if value is inside or outside of bounds",

@@ -19,10 +19,7 @@ "main": "index.js",

"jshint": "~2",
"mocha": "~5"
"mocha": "~9"
},
"files": [
"index.js"
],
"dependencies": {
"clone-component": "^0.2.2"
}
]
}

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

[![Build Status](https://secure.travis-ci.org/pirxpilot/bounds.png)](http://travis-ci.org/pirxpilot/bounds)
[![NPM version][npm-image]][npm-url]
[![Build Status][build-image]][build-url]

@@ -65,1 +66,7 @@ # bounds

MIT
[npm-url]: https://npmjs.org/package/bounds
[npm-image]: https://img.shields.io/npm/v/bounds.svg
[build-url]: https://github.com/pirxpilot/bounds/actions/workflows/check.yaml
[build-image]: https://img.shields.io/github/workflow/status/pirxpilot/bounds/check
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