Skip to content

Commit

Permalink
Fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromewu committed May 22, 2019
1 parent 269629d commit 0801517
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 31 deletions.
6 changes: 4 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
"env": {
"browser": true,
"node": true,
"mocha": true
"mocha": true,
"worker": true
},
"rules": {
"no-underscore-dangle": 0,
"no-console": 0,
"global-require": 0
"global-require": 0,
"camelcase": 0
}
}
34 changes: 13 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
],
"license": "Apache-2.0",
"devDependencies": {
"acorn": "^6.1.1",
"cors": "^2.8.5",
"eslint": "^5.9.0",
"eslint-config-airbnb": "^17.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/browser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const readFromBlobOrFile = (blob, res) => {
* string: URL string, can be relative path
* img HTMLElement: extract image source from src attribute
* video HTMLElement: extract image source from poster attribute
* canvas HTMLElement: extract image data by converting to Blob
* canvas HTMLElement: extract image data by converting to Blob
* File instance: data from <input type="file" />
* @returns {array} binary image in array format
*/
Expand Down Expand Up @@ -88,7 +88,7 @@ const downloadFile = (path, blob) => {
document.body.removeChild(link);
}
}
}
};

/*
* Default options for browser worker
Expand Down
4 changes: 2 additions & 2 deletions src/browser/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ workerUtils.setAdapter({
*/
if (check.not.undefined(global.TesseractCoreWASM) && typeof WebAssembly === 'object') {
global.TesseractCore = global.TesseractCoreWASM;
} else if (check.not.undefined(global.TesseractCoreASM)){
} else if (check.not.undefined(global.TesseractCoreASM)) {
global.TesseractCore = global.TesseractCoreASM;
} else {
throw Error('Failed to load TesseractCore');
Expand All @@ -44,7 +44,7 @@ workerUtils.setAdapter({
},
b64toU8Array: s => new Uint8Array(atob(s).split('').map(c => c.charCodeAt(0))),
writeFile: (path, data, type) => {
self.postMessage({
postMessage({
jobId: 'Download',
path,
data,
Expand Down
7 changes: 3 additions & 4 deletions src/common/workerUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
* @author Jerome Wu <jeromewus@gmail.com>
*/
const { readImage, loadLang } = require('tesseract.js-utils');
const check = require('check-types');
const pdfTTF = require('./pdf-ttf');
const dump = require('./dump');
const { defaultParams } = require('./options');
Expand Down Expand Up @@ -59,7 +58,7 @@ const setImage = (image) => {
* @name handleParams
* @function hanlde params from users
* @access private
* @param {string} lang - lang string for Init()
* @param {string} lang - lang string for Init()
* @param {object} customParams - an object of params
*/
const handleParams = (lang, customParams) => {
Expand Down Expand Up @@ -110,14 +109,14 @@ const handleOutput = (customParams) => {
if (pdf_bin) {
files = { pdf: data, ...files };
}

if (pdf_auto_download) {
adapter.writeFile(`${pdf_name}.pdf`, data, 'application/pdf');
}
}

return files;
}
};

/**
* handleInit
Expand Down

0 comments on commit 0801517

Please sign in to comment.