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

object-fit-images

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-fit-images - npm Package Compare versions

Comparing version 0.5.3 to 0.5.4

10

ofi.js

@@ -20,6 +20,12 @@ 'use strict';

function fixOne (el, src, fit) {
fit = el.currentStyle['object-fit'];
// `fill` is the default behavior for <img>
// Absolutely no work necessary
if (fit === 'fill') {
return;
}
src = src || el.src;
fit = el.currentStyle['object-fit'];
el.style.backgroundImage = 'url('+src+')';
el.style.backgroundSize = fit === 'fill'?'100% 100%':fit; // fit=none is ignored by CSS and that's the correct behavior
el.style.backgroundSize = fit; // fit=none is ignored by CSS and that's the correct behavior
el.style.backgroundPosition = el.currentStyle['object-position'];

@@ -26,0 +32,0 @@

2

package.json
{
"name": "object-fit-images",
"version": "0.5.3",
"version": "0.5.4",
"description": "Adds support to object-fit to images on IE9, IE10, IE11 and Edge. (untested)",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -16,3 +16,5 @@ 100% untested at the moment. Will test soon

Support | object-fit-images _(this)_ | [tonipinel/object-fit-polyfill](https://github.com/tonipinel/object-fit-polyfill) | [jonathantneal/fitie](https://github.com/jonathantneal/fitie)
### Support
| | object-fit-images | [tonipinel/object-fit-polyfill](https://github.com/tonipinel/object-fit-polyfill) | [jonathantneal/fitie](https://github.com/jonathantneal/fitie)
:--- | :--- | :--- | :---

@@ -27,3 +29,5 @@ Browsers | IE 9-11, Edge | "All browsers" | IE 8-11, Edge

Performance | object-fit-images _(this)_ | [tonipinel/object-fit-polyfill](https://github.com/tonipinel/object-fit-polyfill) | [jonathantneal/fitie](https://github.com/jonathantneal/fitie)
### Performance
| | object-fit-images | [tonipinel/object-fit-polyfill](https://github.com/tonipinel/object-fit-polyfill) | [jonathantneal/fitie](https://github.com/jonathantneal/fitie)
:--- | :--- | :--- | :---

@@ -36,3 +40,5 @@ Size | 1.2KB | 1.8KB | 1.5KB

Ease of use | object-fit-images _(this)_ | [tonipinel/object-fit-polyfill](https://github.com/tonipinel/object-fit-polyfill) | [jonathantneal/fitie](https://github.com/jonathantneal/fitie)
### Ease of use
| | object-fit-images | [tonipinel/object-fit-polyfill](https://github.com/tonipinel/object-fit-polyfill) | [jonathantneal/fitie](https://github.com/jonathantneal/fitie)
:--- | :--- | :--- | :---

@@ -39,0 +45,0 @@ Object-fit definition | 💚 Automatic in CSS | 💔 Via `data` attribute in HTML (`data-object-fit="cover"`) | 💔 Via class in HTML (`class="cover"`)

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