UNPKG

yoastseo

Version:

Yoast client-side content analysis

19 lines (18 loc) 611 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = flattenSortLength; var _lodash = require("lodash"); /** * Returns combined list of strings/words, sorted by length (descending). * * @param {Object} dataWords The words data that is going to be sorted. * * @returns {Array<string>} All words, sorted by length (descending). */ function flattenSortLength(dataWords) { const allWords = (0, _lodash.flatten)(Object.values(dataWords)); return allWords.sort((a, b) => b.length - a.length || a.localeCompare(b)); } //# sourceMappingURL=flattenSortLength.js.map