tesseract-vue
Advanced tools
Comparing version 0.1.3 to 0.1.4
/** | ||
* tesseract-vue v0.1.3 | ||
* tesseract-vue v0.1.4 | ||
* (c) 2018 Simon Kunz | ||
@@ -19,4 +19,3 @@ * @license MIT | ||
var vue = null, | ||
tesseract = null, | ||
optimizer = null; | ||
tesseract = null; | ||
@@ -34,3 +33,3 @@ var vueTesseract = { | ||
var $tesseract = { | ||
version: '0.1.3', | ||
version: '0.1.4', | ||
create: function create(paths) { | ||
@@ -42,4 +41,6 @@ if ( paths === void 0 ) paths = {}; | ||
recognize: function recognize(image) { | ||
return tesseract.recognize(image, options = {}); | ||
recognize: function recognize(image, options) { | ||
if ( options === void 0 ) options = {}; | ||
return tesseract.recognize(image, options); | ||
}, | ||
@@ -51,8 +52,8 @@ | ||
optimize: function optimize(image) { | ||
if (optimizer && typeof optimizer === 'function') { | ||
return tesseract.bind(optimizer(image)); | ||
preOptimize: function preOptimize(image, preOptimizer) { | ||
if (preOptimizer && typeof preOptimizer === 'function') { | ||
return optimizerFunction(image); | ||
} | ||
return tesseract; | ||
return false; | ||
}, | ||
@@ -70,3 +71,2 @@ }; | ||
tesseract = (options && options.tesseract) || Tesseract; | ||
optimizer = options && options.optimizer; | ||
Vue.options = Vue.util.mergeOptions(Vue.options, vueTesseract); | ||
@@ -73,0 +73,0 @@ }, |
{ | ||
"name": "tesseract-vue", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Tesseract bindings for Vue.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -1,3 +0,3 @@ | ||
# Pouch Vue | ||
# Tesseract Vue | ||
https://github.com/naptha/tesseract.js#tesseractjs |
@@ -22,4 +22,4 @@ (function() { | ||
recognize(image) { | ||
return tesseract.recognize(image, options = {}); | ||
recognize(image, options = {}) { | ||
return tesseract.recognize(image, options); | ||
}, | ||
@@ -31,8 +31,8 @@ | ||
optimize(image) { | ||
if (optimizer && typeof optimizer === 'function') { | ||
return tesseract.bind(optimizer(image)); | ||
preOptimize(image, preOptimizer) { | ||
if (preOptimizer && typeof preOptimizer === 'function') { | ||
return optimizerFunction(image); | ||
} | ||
return tesseract; | ||
return false; | ||
}, | ||
@@ -45,6 +45,2 @@ }; | ||
function myFunction() { | ||
} | ||
let api = { | ||
@@ -55,4 +51,2 @@ mixin: vueTesseract, | ||
tesseract = (options && options.tesseract) || Tesseract; | ||
optimizer = options && options.optimizer; | ||
myFunction(); | ||
Vue.options = Vue.util.mergeOptions(Vue.options, vueTesseract); | ||
@@ -59,0 +53,0 @@ }, |
5598
136