From 27fa9156ad088636635da2046f69902f2176ff93 Mon Sep 17 00:00:00 2001 From: Trevor Healy Date: Tue, 24 Jan 2017 10:58:47 -0800 Subject: [PATCH] fix(webpack/error): create not found error when compiled with webpack --- src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 1f8651d..5359974 100644 --- a/src/index.js +++ b/src/index.js @@ -3,7 +3,7 @@ const circularize = require('./common/circularize.js') const TesseractJob = require('./common/job'); const version = require('../package.json').version; -function create(workerOptions = {}){ +const create = function(workerOptions = {}){ var worker = new TesseractWorker(Object.assign({}, adapter.defaultOptions, workerOptions)); worker.create = create; worker.version = version; @@ -22,7 +22,7 @@ class TesseractWorker { return this._delay(job => { if (typeof options === 'string') options = {lang: options} options.lang = options.lang || 'eng'; - + job._send('recognize', { image, options, workerOptions: this.workerOptions }); }) } @@ -32,7 +32,7 @@ class TesseractWorker { }) } - terminate(){ + terminate(){ if(this.worker) adapter.terminateWorker(this); this.worker = null; this._currentJob = null;