Fix preload and add includeData option
This commit is contained in:
parent
4d97bcbc45
commit
dd2fb2c150
|
@ -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": [
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue