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

reddit-wallpapers

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reddit-wallpapers - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

5

core.js

@@ -11,3 +11,3 @@ // Core functions

const CheckImg = (url) => {
const CheckImg = (url, checkDim=false) => {
// Promise function to check if image is valid and loadable

@@ -24,3 +24,4 @@ return new Promise((resolve, reject) => {

img.onload = (e) => {
resolve(e)
if (checkDim === 'true' && screen.height > img.height || screen.width > img.width) reject(e)
else resolve(e)
}

@@ -27,0 +28,0 @@ img.onerror = (e) => {

@@ -33,3 +33,4 @@ import {

isAnimated: options.isAnimated || 'true', // to use jQuery animation
defaultImg: options.defaultImg || '' // default image to use if failed
defaultImg: options.defaultImg || '', // default image to use if failed
checkDim: options.checkDim || 'true', // make sure img dimensions larger than screen dimensions
}

@@ -65,3 +66,3 @@

let image = defaultImage ? self.options.defaultImg : self.data[self.index].data.url
CheckImg(image).then(() => {
CheckImg(image, self.options.checkDim).then(() => {
let sstyle = {

@@ -68,0 +69,0 @@ 'background-size': 'cover',

2

package.json
{
"name": "reddit-wallpapers",
"version": "0.0.4",
"version": "0.0.5",
"description": "to help fetching wallpapers with reddit api and loop setting them",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is too big to display

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