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

@collaborne/authorized-image

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@collaborne/authorized-image - npm Package Compare versions

Comparing version 2.0.0 to 2.0.2

.eslintrc.json

8

authorized-fetch-mixin.js

@@ -0,5 +1,11 @@

/* eslint-disable valid-jsdoc */
/**
* Mixin that allows fetching with authorization through the browser cache and providing the result through a data: URL.
*
* @template T type of parent class
* @param {T} parent parent class
* @returns {T & AuthorizedFetchMixin} parent with this mixed in
*/
export const AuthorizedFetchMixin = parent => class extends parent {
/* eslint-enable valid-jsdoc */
export const AuthorizedFetchMixin = parent => class extends parent { // eslint-disable-line padded-blocks
/**

@@ -6,0 +12,0 @@ * Fetch the given `src` by authorizing with the given bearer token `token`.

49

authorized-image.js

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

import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
import '@polymer/iron-image/iron-image.js';
import {PolymerElement, html} from '@polymer/polymer/polymer-element.js';
import { AuthorizedFetchMixin } from './authorized-fetch-mixin.js';
import {AuthorizedFetchMixin} from './authorized-fetch-mixin.js';

@@ -57,3 +57,17 @@ /**

_ironImageError: Boolean,
_supportsIntersectionObserver: {
readOnly: true,
type: Boolean,
value: typeof IntersectionObserver === 'function',
},
/**
* Whether this image was visible according to the intersection observer.
*
* This value is only valid when the component is "ready" and _supportsIntersectionObserver is true.
*/
_visible: Boolean,
/**
* Whether this image was ever visible.

@@ -66,13 +80,2 @@ * This property is used to delay the internal "fetch" request for invisible images, but avoid

},
/**
* Whether this image was visible according to the intersection observer.
*
* This value is only valid when the component is "ready" and _supportsIntersectionObserver is true.
*/
_visible: Boolean,
_supportsIntersectionObserver: {
value: typeof IntersectionObserver === 'function',
readOnly: true,
type: Boolean,
},

@@ -108,6 +111,6 @@ alt: String,

token: String,
mode: {
token: String, // eslint-disable-line sort-keys
mode: { // eslint-disable-line sort-keys
type: String,
value: 'cors',
type: String,
},

@@ -125,6 +128,6 @@ };

if (this._supportsIntersectionObserver) {
this._observer = new IntersectionObserver(entries => {
this._observer = new IntersectionObserver(entries => { // eslint-disable-line no-unused-vars
// See https://stackoverflow.com/a/38873788/196315
// XXX: Can we instead look at the entries, specifically 'isIntersecting'?
this._visible = !!(this.offsetHeight || this.offsetWidth || this.getClientRects().length > 0);
this._visible = Boolean(this.offsetHeight || this.offsetWidth || this.getClientRects().length > 0);
});

@@ -152,3 +155,3 @@ this._observer.observe(this);

_computeError(ironImageError, displayed) {
return Boolean(ironImageError || displayed && displayed.dataUrl === '');
return Boolean(ironImageError) || Boolean(displayed && displayed.dataUrl === '');
}

@@ -199,3 +202,7 @@

// Prevent loading when either the user requested that, or when we cannot actually display things.
return preventLoad || (displayed && displayed.dataUrl === '');
if (preventLoad) {
return true;
}
return Boolean(displayed && displayed.dataUrl === '');
}

@@ -208,2 +215,4 @@

}
return undefined;
}

@@ -210,0 +219,0 @@

{
"name": "@collaborne/authorized-image",
"version": "2.0.2",
"description": "A component that allows to show images that require authorization using a bearer token.",
"homepage": "https://github.com/collaborne/authorized-image",
"name": "@collaborne/authorized-image",
"version": "2.0.0",
"resolutions": {
"inherits": "2.0.3",
"samsam": "1.1.3",
"supports-color": "3.1.2",
"type-detect": "1.0.0"
"author": "Collaborne B.V.",
"homepage": "https://github.com/Collaborne/authorized-image",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/Collaborne/authorized-image/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Collaborne/authorized-image.git"
},
"main": "authorized-image.js",
"author": "collaborne",
"license": "Apache-2.0",
"scripts": {
"lint": "eslint . && polymer lint",
"test": "npm run lint && echo 'No tests yet'"
},
"dependencies": {

@@ -21,7 +26,9 @@ "@polymer/polymer": "^3.0.0",

"@polymer/iron-demo-helpers": "^3.0.0",
"@polymer/paper-checkbox": "^3.0.0",
"@polymer/paper-input": "^3.0.0",
"@polymer/paper-checkbox": "^3.0.0",
"wct-browser-legacy": "^1.0.1",
"@webcomponents/webcomponentsjs": "^2.0.0"
"@webcomponents/webcomponentsjs": "^2.0.0",
"eslint": "^5.12.1",
"eslint-config-collaborne": "^1.5.0",
"polymer-cli": "^1.9.5"
}
}

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

# `<authorized-image>`
# `<authorized-image>` [![Build Status](https://travis-ci.com/Collaborne/authorized-image.svg?branch=master)](https://travis-ci.com/Collaborne/authorized-image)

@@ -8,3 +8,3 @@ A component that allows to show images that require authorization using a bearer token.

```sh
npm install Collaborne/authorized-image --save
npm install @collaborne/authorized-image --save
```

@@ -11,0 +11,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