New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

css-box-model

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-box-model - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

8

dist/css-box-model.js

@@ -9,3 +9,3 @@ (function (global, factory) {

var index = function index(condition, message) {
function invariant(condition, message) {
if (condition) {

@@ -18,3 +18,3 @@ return;

}
};
}

@@ -101,5 +101,5 @@ var getRect = function getRect(_ref) {

var suffix = raw.slice(-2);
!(suffix === 'px') ? index(false, "Expected value to be a pixel value.\n Expected form: 10px\n Actual value: " + raw + "\n ") : void 0;
!(suffix === 'px') ? invariant(false, "Expected value to be a pixel value.\n Expected form: 10px\n Actual value: " + raw + "\n ") : void 0;
var result = Number(value);
!!isNaN(result) ? index(false, "Could not parse value [raw: " + raw + ", without suffix: " + value + "]") : void 0;
!!isNaN(result) ? invariant(false, "Could not parse value [raw: " + raw + ", without suffix: " + value + "]") : void 0;
return result;

@@ -106,0 +106,0 @@ };

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

!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o(t.cssBoxModel={})}(this,function(t){"use strict";var e=function(t,o){if(!t)throw new Error("Invariant failed")},b=function(t){var o=t.top,r=t.right,e=t.bottom,i=t.left;return{top:o,right:r,bottom:e,left:i,width:r-i,height:e-o,x:i,y:o,center:{x:(r+i)/2,y:(e+o)/2}}},m=function(t,o){return{top:t.top-o.top,left:t.left-o.left,bottom:t.bottom+o.bottom,right:t.right+o.right}},u=function(t,o){return{top:t.top+o.top,left:t.left+o.left,bottom:t.bottom-o.bottom,right:t.right-o.right}},h={top:0,right:0,bottom:0,left:0},a=function(t){var o=t.borderBox,r=t.margin,e=void 0===r?h:r,i=t.border,n=void 0===i?h:i,d=t.padding,f=void 0===d?h:d,g=b(m(o,e)),a=b(u(o,n)),p=b(u(a,f));return{marginBox:g,borderBox:b(o),paddingBox:a,contentBox:p,margin:e,border:n,padding:f}},n=function(t){var o=t.slice(0,-2);"px"!==t.slice(-2)&&e(!1);var r=Number(o);return isNaN(r)&&e(!1),r},r=function(t,o){var r,e,i=t.borderBox,n=t.border,d=t.margin,f=t.padding,g=(e=o,{top:(r=i).top+e.y,left:r.left+e.x,bottom:r.bottom+e.y,right:r.right+e.x});return a({borderBox:g,border:n,margin:d,padding:f})},i=function(t,o){var r={top:n(o.marginTop),right:n(o.marginRight),bottom:n(o.marginBottom),left:n(o.marginLeft)},e={top:n(o.paddingTop),right:n(o.paddingRight),bottom:n(o.paddingBottom),left:n(o.paddingLeft)},i={top:n(o.borderTopWidth),right:n(o.borderRightWidth),bottom:n(o.borderBottomWidth),left:n(o.borderLeftWidth)};return a({borderBox:t,margin:r,padding:e,border:i})};t.getRect=b,t.expand=m,t.shrink=u,t.createBox=a,t.offset=r,t.withScroll=function(t,o){return void 0===o&&(o={x:window.pageXOffset,y:window.pageYOffset}),r(t,o)},t.calculateBox=i,t.getBox=function(t){var o=t.getBoundingClientRect(),r=window.getComputedStyle(t);return i(o,r)},Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports):"function"==typeof define&&define.amd?define(["exports"],o):o(t.cssBoxModel={})}(this,function(t){"use strict";function e(t,o){if(!t)throw new Error("Invariant failed")}var b=function(t){var o=t.top,r=t.right,e=t.bottom,i=t.left;return{top:o,right:r,bottom:e,left:i,width:r-i,height:e-o,x:i,y:o,center:{x:(r+i)/2,y:(e+o)/2}}},m=function(t,o){return{top:t.top-o.top,left:t.left-o.left,bottom:t.bottom+o.bottom,right:t.right+o.right}},u=function(t,o){return{top:t.top+o.top,left:t.left+o.left,bottom:t.bottom-o.bottom,right:t.right-o.right}},h={top:0,right:0,bottom:0,left:0},a=function(t){var o=t.borderBox,r=t.margin,e=void 0===r?h:r,i=t.border,n=void 0===i?h:i,d=t.padding,f=void 0===d?h:d,g=b(m(o,e)),a=b(u(o,n)),p=b(u(a,f));return{marginBox:g,borderBox:b(o),paddingBox:a,contentBox:p,margin:e,border:n,padding:f}},n=function(t){var o=t.slice(0,-2);"px"!==t.slice(-2)&&e(!1);var r=Number(o);return isNaN(r)&&e(!1),r},r=function(t,o){var r,e,i=t.borderBox,n=t.border,d=t.margin,f=t.padding,g=(e=o,{top:(r=i).top+e.y,left:r.left+e.x,bottom:r.bottom+e.y,right:r.right+e.x});return a({borderBox:g,border:n,margin:d,padding:f})},i=function(t,o){var r={top:n(o.marginTop),right:n(o.marginRight),bottom:n(o.marginBottom),left:n(o.marginLeft)},e={top:n(o.paddingTop),right:n(o.paddingRight),bottom:n(o.paddingBottom),left:n(o.paddingLeft)},i={top:n(o.borderTopWidth),right:n(o.borderRightWidth),bottom:n(o.borderBottomWidth),left:n(o.borderLeftWidth)};return a({borderBox:t,margin:r,padding:e,border:i})};t.getRect=b,t.expand=m,t.shrink=u,t.createBox=a,t.offset=r,t.withScroll=function(t,o){return void 0===o&&(o={x:window.pageXOffset,y:window.pageYOffset}),r(t,o)},t.calculateBox=i,t.getBox=function(t){var o=t.getBoundingClientRect(),r=window.getComputedStyle(t);return i(o,r)},Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "css-box-model",
"version": "1.1.0",
"version": "1.1.1",
"description": "Get accurate and well named css box model information about an Element 📦",

@@ -44,4 +44,4 @@ "author": "Alex Reardon <alexreardon@gmail.com>",

"devDependencies": {
"@babel/core": "^7.1.2",
"@babel/preset-env": "^7.1.0",
"@babel/core": "^7.1.5",
"@babel/preset-env": "^7.1.5",
"@babel/preset-flow": "^7.0.0",

@@ -51,7 +51,7 @@ "babel-core": "7.0.0-bridge.0",

"babel-plugin-dev-expression": "^0.2.1",
"flow-bin": "^0.83.0",
"flow-bin": "^0.85.0",
"jest": "^23.6.0",
"prettier": "1.14.3",
"prettier": "1.15.0",
"rimraf": "^2.6.2",
"rollup": "^0.66.6",
"rollup": "^0.67.0",
"rollup-plugin-babel": "^4.0.3",

@@ -64,4 +64,4 @@ "rollup-plugin-commonjs": "^9.2.0",

"dependencies": {
"tiny-invariant": "^1.0.1"
"tiny-invariant": "^1.0.3"
}
}
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