1
0
Fork 0
docsearch/src/lib/utils.js
2015-11-26 16:10:06 +01:00

15 lines
350 B
JavaScript

import values from 'lodash/object/values';
import flatten from 'lodash/array/flatten';
let utils = {
// Flatten all values into one array, marking the first element with
// `flagName`
flattenObject(o, flagName) {
values(o).map((value) => {
value[0][flagName] = true;
});
return flatten(values);
}
};
export default utils;