Fix preload and add includeData option

This commit is contained in:
moos 2019-12-31 14:53:24 -08:00
parent 4d97bcbc45
commit dd2fb2c150
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "wordpos",
"version": "2.0.0-beta.13",
"version": "2.0.0-beta.14",
"description": "wordpos is a set of part-of-speech utilities for Node.js & browser using the WordNet database.",
"author": "Moos <mooster@42at.com>",
"keywords": [

View File

@ -35,6 +35,8 @@ class BaseFile {
load() {
if (this.loadError) return Promise.reject(this.loadError);
if (this.loaded) return this.loaded;
this.options.debug && console.time('index load ' + this.posName);
let promise = isTest
@ -42,7 +44,7 @@ class BaseFile {
: ES6_IMPORT(`${this.filePath}`); // prevent parcel from clobbering dynamic import
this.options.debug && console.timeEnd('index load ' + this.posName)
return promise
return this.loaded = promise
.then(exports => {
this.file = exports.default;
return this;