Use utils.flat() for older node version

This commit is contained in:
moos 2019-12-31 15:09:13 -08:00
parent dd2fb2c150
commit 19c075a8d2
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"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.",
"author": "Moos <mooster@42at.com>",
"keywords": [

View File

@ -7,7 +7,7 @@
* 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 { randX, rand } = require('../rand');
const IndexFile = require('./indexFile');
@ -69,7 +69,7 @@ class WordPOS {
let promise = this._preload(this.indexFiles, pos);
if (this.options.includeData) {
promise = Promise.all([].concat(promise, this._preload(this.dataFiles, pos)))
.then(res => res.flat());
.then(res => flat(res));
}
return promise;
}