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

document-viewer-ts

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

document-viewer-ts - npm Package Compare versions

Comparing version 0.3.1-legacy to 0.3.2-legacy

19

dist/es2015/base.js

@@ -26,5 +26,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

const handleError = (containerDiv) => (err) => {
const errorDiv = document.createElement('div');
errorDiv.textContent = `There was an error fetching your document. Please try again later. Error: ${err}`;
containerDiv.append(errorDiv);
renderErrorMessage(containerDiv)(`There was an error fetching your document. Please try again later. Error: ${err}`);
};

@@ -198,2 +196,8 @@ const pdfScale = 10;

};
const renderErrorMessage = (containerDiv) => (errorMessage) => {
const errorDiv = document.createElement('div');
errorDiv.className = 'error-message';
errorDiv.textContent = errorMessage;
containerDiv.appendChild(errorDiv);
};
export const renderDocument = (containerDiv) => {

@@ -210,3 +214,10 @@ var _a;

case 'pdf':
renderPDF(containerDiv, documentUrl);
try {
(() => globalThis)();
new File([], 'test.txt');
renderPDF(containerDiv, documentUrl);
}
catch (err) {
renderErrorMessage(containerDiv)('Your browser does not support showing PDF previews. Click the download button to view this document.');
}
return;

@@ -213,0 +224,0 @@ case 'doc':

@@ -29,5 +29,3 @@ "use strict";

const handleError = (containerDiv) => (err) => {
const errorDiv = document.createElement('div');
errorDiv.textContent = `There was an error fetching your document. Please try again later. Error: ${err}`;
containerDiv.append(errorDiv);
renderErrorMessage(containerDiv)(`There was an error fetching your document. Please try again later. Error: ${err}`);
};

@@ -202,2 +200,8 @@ const pdfScale = 10;

};
const renderErrorMessage = (containerDiv) => (errorMessage) => {
const errorDiv = document.createElement('div');
errorDiv.className = 'error-message';
errorDiv.textContent = errorMessage;
containerDiv.appendChild(errorDiv);
};
const renderDocument = (containerDiv) => {

@@ -214,3 +218,10 @@ var _a;

case 'pdf':
(0, exports.renderPDF)(containerDiv, documentUrl);
try {
(() => globalThis)();
new File([], 'test.txt');
(0, exports.renderPDF)(containerDiv, documentUrl);
}
catch (err) {
renderErrorMessage(containerDiv)('Your browser does not support showing PDF previews. Click the download button to view this document.');
}
return;

@@ -217,0 +228,0 @@ case 'doc':

{
"name": "document-viewer-ts",
"version": "0.3.1-legacy",
"version": "0.3.2-legacy",
"description": "PDF and MS Doc viewer written in TypeScript for React and vanilla JavaScript",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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