Socket
Socket
Sign inDemoInstall

tesseract.js

Package Overview
Dependencies
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tesseract.js - npm Package Compare versions

Comparing version 2.0.0-alpha.15 to 2.0.0-alpha.16

types/index.d.ts

6

package.json
{
"name": "tesseract.js",
"version": "2.0.0-alpha.15",
"version": "2.0.0-alpha.16",
"description": "Pure Javascript Multilingual OCR",
"main": "src/index.js",
"types": "types/index.d.ts",
"unpkg": "dist/tesseract.min.js",

@@ -57,6 +58,5 @@ "jsdelivr": "dist/tesseract.min.js",

"is-url": "1.2.2",
"node-fetch": "^2.3.0",
"opencollective-postinstall": "^2.0.2",
"resolve-url": "^0.2.1",
"tesseract.js-core": "^2.0.0-beta.11",
"tesseract.js-core": "^2.0.0-beta.12",
"tesseract.js-utils": "^1.0.0-beta.8"

@@ -63,0 +63,0 @@ },

@@ -57,3 +57,3 @@ <p align="center">

<!-- v2 -->
<script src='https://unpkg.com/tesseract.js@v2.0.0-alpha.13/dist/tesseract.min.js'></script>
<script src='https://unpkg.com/tesseract.js@v2.0.0-alpha.16/dist/tesseract.min.js'></script>

@@ -60,0 +60,0 @@ <!-- v1 -->

@@ -127,6 +127,7 @@ /**

* @param {string} options.workerPath - worker script path
* @param {boolean} options.workerBlobURL - Use a blob:// URL for the worker script
*/
exports.spawnWorker = (instance, { workerPath }) => {
exports.spawnWorker = (instance, { workerPath, workerBlobURL }) => {
let worker;
if (Blob && URL) {
if (Blob && URL && workerBlobURL) {
const blob = new Blob([`importScripts("${workerPath}");`], {

@@ -133,0 +134,0 @@ type: 'application/javascript',

@@ -11,2 +11,6 @@ const { OEM, PSM } = require('./types');

langPath: 'https://tessdata.projectnaptha.com/4.0.0',
/*
* Use BlobURL for worker script by default
*/
workerBlobURL: true,
},

@@ -13,0 +17,0 @@ /*

@@ -35,2 +35,3 @@ /**

* In Node.js environment, this option is not used as the worker script is in local.
* @param {boolean} [options.workerBlobURL=true] - Use a blob: URL for the worker script
* @param {string} options.corePath -

@@ -37,0 +38,0 @@ * A remote path to load tesseract.js-core script.

@@ -16,2 +16,4 @@ /**

const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
/*

@@ -234,3 +236,3 @@ * Tesseract Module returned by TesseractCore.

.catch((e) => {
if (e instanceof DOMException) {
if (isBrowser && e instanceof DOMException) {
/*

@@ -237,0 +239,0 @@ * For some reason google chrome throw DOMException in loadLang,

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

Sorry, the diff of this file is not supported yet

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

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