Skip to content

Commit

Permalink
Removed gzip functionality from NodeDictionaryLoader
Browse files Browse the repository at this point in the history
  • Loading branch information
mikob committed Dec 18, 2018
1 parent 20e2999 commit 310e88e
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/loader/NodeDictionaryLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"use strict";

var fs = require("fs");
var node_zlib = require("zlib");
var DictionaryLoader = require("./DictionaryLoader");

/**
Expand All @@ -38,17 +37,11 @@ NodeDictionaryLoader.prototype = Object.create(DictionaryLoader.prototype);
* @param {NodeDictionaryLoader~onLoad} callback Callback function
*/
NodeDictionaryLoader.prototype.loadArrayBuffer = function (file, callback) {
fs.readFile(file, function (err, buffer) {
fs.readFile(file, function (err, data) {
if(err) {
return callback(err);
}
node_zlib.gunzip(buffer, function (err2, decompressed) {
if(err2) {
return callback(err2);
}
var typed_array = new Uint8Array(decompressed);
callback(null, typed_array.buffer);
});
callback(null, new Uint8Array(data).buffer);
});
};

Expand Down

0 comments on commit 310e88e

Please sign in to comment.