Browse Source

Fix lint error

feature/aio
Jerome Wu 6 years ago
parent
commit
080151711b
  1. 6
      .eslintrc
  2. 34
      package-lock.json
  3. 1
      package.json
  4. 2
      src/browser/index.js
  5. 4
      src/browser/worker.js
  6. 3
      src/common/workerUtils.js

6
.eslintrc

@ -3,11 +3,13 @@ @@ -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
package-lock.json generated

@ -381,6 +381,12 @@ @@ -381,6 +381,12 @@
"negotiator": "0.6.1"
}
},
"acorn": {
"version": "6.1.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz",
"integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==",
"dev": true
},
"acorn-dynamic-import": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz",
@ -2549,14 +2555,12 @@ @@ -2549,14 +2555,12 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@ -2571,20 +2575,17 @@ @@ -2571,20 +2575,17 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"core-util-is": {
"version": "1.0.2",
@ -2701,8 +2702,7 @@ @@ -2701,8 +2702,7 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"ini": {
"version": "1.3.5",
@ -2714,7 +2714,6 @@ @@ -2714,7 +2714,6 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@ -2729,7 +2728,6 @@ @@ -2729,7 +2728,6 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@ -2737,14 +2735,12 @@ @@ -2737,14 +2735,12 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@ -2763,7 +2759,6 @@ @@ -2763,7 +2759,6 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@ -2844,8 +2839,7 @@ @@ -2844,8 +2839,7 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
@ -2857,7 +2851,6 @@ @@ -2857,7 +2851,6 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@ -2979,7 +2972,6 @@ @@ -2979,7 +2972,6 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",

1
package.json

@ -25,6 +25,7 @@ @@ -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",

2
src/browser/index.js

@ -88,7 +88,7 @@ const downloadFile = (path, blob) => { @@ -88,7 +88,7 @@ const downloadFile = (path, blob) => {
document.body.removeChild(link);
}
}
}
};
/*
* Default options for browser worker

4
src/browser/worker.js

@ -33,7 +33,7 @@ workerUtils.setAdapter({ @@ -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');
@ -44,7 +44,7 @@ workerUtils.setAdapter({ @@ -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,

3
src/common/workerUtils.js

@ -8,7 +8,6 @@ @@ -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');
@ -117,7 +116,7 @@ const handleOutput = (customParams) => { @@ -117,7 +116,7 @@ const handleOutput = (customParams) => {
}
return files;
}
};
/**
* handleInit

Loading…
Cancel
Save