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 3.0.0-0 to 3.0.1

dist/ofi.js

6

dist/ofi.common-js.js

@@ -162,3 +162,3 @@ /*! npm.im/object-fit-images */

function getOfiImageMaybe(el, name) {
return el[OFI] && (name === 'src' || name === 'srcset') ? el[OFI].img : el;
return el[OFI] && el[OFI].img && (name === 'src' || name === 'srcset') ? el[OFI].img : el;
}

@@ -186,3 +186,3 @@ if (!supportsObjectPosition) {

if (typeof imgs === 'string') {
imgs = document.querySelectorAll('img');
imgs = document.querySelectorAll(imgs);
} else if (!('length' in imgs)) {

@@ -225,2 +225,2 @@ imgs = [imgs];

module.exports = fix;
module.exports = fix;

@@ -160,3 +160,3 @@ /*! npm.im/object-fit-images */

function getOfiImageMaybe(el, name) {
return el[OFI] && (name === 'src' || name === 'srcset') ? el[OFI].img : el;
return el[OFI] && el[OFI].img && (name === 'src' || name === 'srcset') ? el[OFI].img : el;
}

@@ -184,3 +184,3 @@ if (!supportsObjectPosition) {

if (typeof imgs === 'string') {
imgs = document.querySelectorAll('img');
imgs = document.querySelectorAll(imgs);
} else if (!('length' in imgs)) {

@@ -223,2 +223,2 @@ imgs = [imgs];

export default fix;
export default fix;
{
"name": "object-fit-images",
"version": "3.0.0-0",
"version": "3.0.1",
"description": "Polyfill object-fit and object-position on images on IE9, IE10, IE11, Edge, Safari, ...",

@@ -40,3 +40,3 @@ "license": "MIT",

"jsfix": "xo --fix",
"watch:server": "browser-sync start --startPath demo --no-ghost-mode --reload-delay 300 --no-open --server --files 'dist/*.browser.js,demo/**'",
"watch:server": "browser-sync start --startPath demo --no-ghost-mode --reload-delay 300 --no-open --server --files 'dist/*.min.js,demo/**'",
"watch:build": "onchange 'index.js' --initial -- npm run build -- --continue-on-error",

@@ -48,3 +48,3 @@ "watch": "npm-run-all --parallel --silent watch:*",

"devDependencies": {
"bfred-npm-bundler": "^7.1.2",
"bfred-npm-bundler": "^8.0.1",
"browser-sync": "^2.17.5",

@@ -51,0 +51,0 @@ "npm-run-all": "^4.0.0",

@@ -5,3 +5,3 @@ # object-fit-images

[![gzipped size](https://badges.herokuapp.com/size/github/bfred-it/object-fit-images/master/dist/ofi.browser.js?gzip=true&label=gzipped%20size)](#readme) [![Travis build status](https://api.travis-ci.org/bfred-it/object-fit-images.svg)](https://travis-ci.org/bfred-it/object-fit-images) [![npm version](https://img.shields.io/npm/v/object-fit-images.svg)](https://www.npmjs.com/package/object-fit-images)
[![gzipped size](https://badges.herokuapp.com/size/github/bfred-it/object-fit-images/master/dist/ofi.min.js?gzip=true&label=gzipped%20size)](#readme) [![Travis build status](https://api.travis-ci.org/bfred-it/object-fit-images.svg)](https://travis-ci.org/bfred-it/object-fit-images) [![npm version](https://img.shields.io/npm/v/object-fit-images.svg)](https://www.npmjs.com/package/object-fit-images)

@@ -14,7 +14,7 @@ This adds support for `object-fit` and `object-position` to **IEdge 9-13, Android < 5, Safari < 10** and skips browsers that already support them.

- CPU-light code
- Fast and lightweight
- No additional elements are created or necessary
- Once set, position is taken care by the browser
- You can normally get and set the `<img>`'s `src` attribute: `img.src = 'other-image.jpg'`
- `srcset` support
- You can still access/change `src` and `srcset` properties and attributes: `img.src = 'other-image.jpg'`

@@ -73,3 +73,3 @@ ## Comparison table with alternative solutions

0. the activation call before `</body>`, or _on DOM ready_
0. <a name="activation"></a> the activation call before `</body>`, or _on DOM ready_

@@ -142,3 +142,3 @@ ```js

```html
<script src="dist/ofi.browser.js"></script>
<script src="dist/ofi.min.js"></script>
```

@@ -149,3 +149,3 @@

```html
<script src="https://unpkg.com/object-fit-images@VERSION/dist/ofi.browser.js"></script>
<script src="https://unpkg.com/object-fit-images@VERSION/dist/ofi.min.js"></script>
```

@@ -152,0 +152,0 @@

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