Pure Javascript OCR for more than 100 Languages 📖🎉🖥
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
133 KiB

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){(function(process){function AbstractChainedBatch(db){this._db=db;this._operations=[];this._written=false}AbstractChainedBatch.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")};AbstractChainedBatch.prototype.put=function(key,value){this._checkWritten();var err=this._db._checkKeyValue(key,"key",this._db._isBuffer);if(err)throw err;err=this._db._checkKeyValue(value,"value",this._db._isBuffer);if(err)throw err;if(!this._db._isBuffer(key))key=String(key);if(!this._db._isBuffer(value))value=String(value);if(typeof this._put=="function")this._put(key,value);else this._operations.push({type:"put",key:key,value:value});return this};AbstractChainedBatch.prototype.del=function(key){this._checkWritten();var err=this._db._checkKeyValue(key,"key",this._db._isBuffer);if(err)throw err;if(!this._db._isBuffer(key))key=String(key);if(typeof this._del=="function")this._del(key);else this._operations.push({type:"del",key:key});return this};AbstractChainedBatch.prototype.clear=function(){this._checkWritten();this._operations=[];if(typeof this._clear=="function")this._clear();return this};AbstractChainedBatch.prototype.write=function(options,callback){this._checkWritten();if(typeof options=="function")callback=options;if(typeof callback!="function")throw new Error("write() requires a callback argument");if(typeof options!="object")options={};this._written=true;if(typeof this._write=="function")return this._write(callback);if(typeof this._db._batch=="function")return this._db._batch(this._operations,options,callback);process.nextTick(callback)};module.exports=AbstractChainedBatch}).call(this,require("_process"))},{_process:31}],2:[function(require,module,exports){(function(process){function AbstractIterator(db){this.db=db;this._ended=false;this._nexting=false}AbstractIterator.prototype.next=function(callback){var self=this;if(typeof callback!="function")throw new Error("next() requires a callback argument");if(self._ended)return callback(new Error("cannot call next() after end()"));if(self._nexting)return callback(new Error("cannot call next() before previous next() has completed"));self._nexting=true;if(typeof self._next=="function"){return self._next(function(){self._nexting=false;callback.apply(null,arguments)})}process.nextTick(function(){self._nexting=false;callback()})};AbstractIterator.prototype.end=function(callback){if(typeof callback!="function")throw new Error("end() requires a callback argument");if(this._ended)return callback(new Error("end() already called on iterator"));this._ended=true;if(typeof this._end=="function")return this._end(callback);process.nextTick(callback)};module.exports=AbstractIterator}).call(this,require("_process"))},{_process:31}],3:[function(require,module,exports){(function(Buffer,process){var xtend=require("xtend"),AbstractIterator=require("./abstract-iterator"),AbstractChainedBatch=require("./abstract-chained-batch");function AbstractLevelDOWN(location){if(!arguments.length||location===undefined)throw new Error("constructor requires at least a location argument");if(typeof location!="string")throw new Error("constructor requires a location string argument");this.location=location}AbstractLevelDOWN.prototype.open=function(options,callback){if(typeof options=="function")callback=options;if(typeof callback!="function")throw new Error("open() requires a callback argument");if(typeof options!="object")options={};if(typeof this._open=="function")return this._open(options,callback);process.nextTick(callback)};AbstractLevelDOWN.prototype.close=function(callback){if(typeof callback!="