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

react-pdf-js

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-pdf-js - npm Package Compare versions

Comparing version 1.0.16 to 1.0.17

9

lib/Pdf.js

@@ -82,3 +82,7 @@ 'use strict';

if (newProps.file && newProps.file !== this.props.file || newProps.content && newProps.content !== this.props.content) {
var newDocInit = newProps.documentInitParameters;
var docInit = this.props.documentInitParameters;
if (newProps.file && newProps.file !== this.props.file || newProps.content && newProps.content !== this.props.content || newDocInit && newDocInit !== docInit || newDocInit && docInit && newDocInit.url !== docInit.url) {
this.loadPDFDocument(newProps);

@@ -148,2 +152,4 @@ }

this.loadByteArray(byteArray);
} else if (!!props.documentInitParameters) {
return window.PDFJS.getDocument(props.documentInitParameters).then(this.onDocumentComplete);
} else {

@@ -190,2 +196,3 @@ throw new Error('react-pdf-js works with a file(URL) or (base64)content. At least one needs to be provided!');

file: _react2.default.PropTypes.string,
documentInitParameters: _react2.default.PropTypes.object,
loading: _react2.default.PropTypes.any,

@@ -192,0 +199,0 @@ page: _react2.default.PropTypes.number,

8

package.json
{
"name": "react-pdf-js",
"version": "1.0.16",
"version": "1.0.17",
"description": "A React component to wrap PDF.js",

@@ -33,6 +33,6 @@ "main": "./lib/index.js",

"dependencies": {
"pdfjs-dist": "1.5.292"
"pdfjs-dist": "1.5.294"
},
"devDependencies": {
"babel-cli": "6.9.0",
"babel-cli": "6.10.1",
"babel-core": "6.9.1",

@@ -51,3 +51,3 @@ "babel-eslint": "6.0.4",

"eslint-plugin-react": "5.1.1",
"eslint-plugin-jsx-a11y": "1.4.0",
"eslint-plugin-jsx-a11y": "1.4.2",
"react": "15.1.0",

@@ -54,0 +54,0 @@ "rifraf": "2.0.2",

@@ -19,4 +19,10 @@ import React from 'react';

const { pdf } = this.state;
const newDocInit = newProps.documentInitParameters;
const docInit = this.props.documentInitParameters;
if ((newProps.file && newProps.file !== this.props.file) ||
(newProps.content && newProps.content !== this.props.content)) {
(newProps.content && newProps.content !== this.props.content) ||
(newDocInit && newDocInit !== docInit) ||
(newDocInit && docInit && newDocInit.url !== docInit.url)) {
this.loadPDFDocument(newProps);

@@ -73,2 +79,5 @@ }

this.loadByteArray(byteArray);
} else if (!!props.documentInitParameters) {
return window.PDFJS.getDocument(props.documentInitParameters)
.then(this.onDocumentComplete);
} else {

@@ -102,2 +111,3 @@ throw new Error('react-pdf-js works with a file(URL) or (base64)content. At least one needs to be provided!');

file: React.PropTypes.string,
documentInitParameters: React.PropTypes.object,
loading: React.PropTypes.any,

@@ -104,0 +114,0 @@ page: React.PropTypes.number,

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

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