Use utils.flat() for older node version
This commit is contained in:
parent
dd2fb2c150
commit
19c075a8d2
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "wordpos",
|
"name": "wordpos",
|
||||||
"version": "2.0.0-beta.14",
|
"version": "2.0.0-beta.15",
|
||||||
"description": "wordpos is a set of part-of-speech utilities for Node.js & browser using the WordNet database.",
|
"description": "wordpos is a set of part-of-speech utilities for Node.js & browser using the WordNet database.",
|
||||||
"author": "Moos <mooster@42at.com>",
|
"author": "Moos <mooster@42at.com>",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
* Released under MIT license
|
* Released under MIT license
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const { stopwords, prepText, makeStopwordString } = require('../util');
|
const { stopwords, prepText, makeStopwordString, flat } = require('../util');
|
||||||
const { is, get, getPOS, lookup, seek, lookupPOS } = require('../common');
|
const { is, get, getPOS, lookup, seek, lookupPOS } = require('../common');
|
||||||
const { randX, rand } = require('../rand');
|
const { randX, rand } = require('../rand');
|
||||||
const IndexFile = require('./indexFile');
|
const IndexFile = require('./indexFile');
|
||||||
|
@ -69,7 +69,7 @@ class WordPOS {
|
||||||
let promise = this._preload(this.indexFiles, pos);
|
let promise = this._preload(this.indexFiles, pos);
|
||||||
if (this.options.includeData) {
|
if (this.options.includeData) {
|
||||||
promise = Promise.all([].concat(promise, this._preload(this.dataFiles, pos)))
|
promise = Promise.all([].concat(promise, this._preload(this.dataFiles, pos)))
|
||||||
.then(res => res.flat());
|
.then(res => flat(res));
|
||||||
}
|
}
|
||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue