Skip to content

Commit

Permalink
Always import compressed version of dictionary-data, whether in Node …
Browse files Browse the repository at this point in the history
…or Browser
  • Loading branch information
Hopding committed Dec 18, 2018
1 parent 40d0b9d commit cd0984d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions dec/dictionary-browser.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
var base64 = require('base64-js');
var fs = require('fs');

/**
* The normal dictionary-data.js is quite large, which makes it
* unsuitable for browser usage. In order to make it smaller,
* The normal dictionary-data.js is quite large, which makes it
* unsuitable for browser usage. In order to make it smaller,
* we read dictionary.bin, which is a compressed version of
* the dictionary, and on initial load, Brotli decompresses
* the dictionary, and on initial load, Brotli decompresses
* it's own dictionary. 😜
*/
exports.init = function() {
Expand Down
2 changes: 1 addition & 1 deletion dec/dictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Collection of static dictionary words.
*/

var data = require('./dictionary-data');
var data = require('./dictionary-browser');
exports.init = function() {
exports.dictionary = data.init();
};
Expand Down

0 comments on commit cd0984d

Please sign in to comment.