Skip to content

Commit

Permalink
Release 1.1.2
Browse files Browse the repository at this point in the history
Lint run
Release 1.1.2
  • Loading branch information
Hexagon committed Feb 13, 2017
1 parent 85e1abd commit 7355e93
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ THE SOFTWARE.

var levenshtein = require("fast-levenshtein"),
msgpack = require("msgpack-lite"),
fs = require('fs');
fs = require("fs");

function index(options) {

Expand Down Expand Up @@ -307,24 +307,24 @@ function index(options) {
toDisk: function (path, callback) {
var binaryData = msgpack.encode(toObject());
fs.writeFile(path, binaryData, function(err) {
if(err) {
callback(err);
} else {
callback();
}
if(err) {
callback(err);
} else {
callback();
}
});
},
fromDisk: function (path, callback) {
fs.readFile(path, function (err, data) {
if (err) {
callback(err);
} else {
try {
fromObject(msgpack.decode(data));
callback();
} catch (e) {
callback(e);
}
if (err) {
callback(err);
} else {
try {
fromObject(msgpack.decode(data));
callback();
} catch (e) {
callback(e);
}
}
});
}
Expand Down

0 comments on commit 7355e93

Please sign in to comment.