@geekbears/gb-mongoose-keywords-plugin
Version:
A Mongoose plugin for keyword generation
10 lines (9 loc) • 516 B
TypeScript
/**
* Generates a set of keywords from a populated field, ie. an object
*
* @param field the source field value
* @param path the path to the property from which keywords should be generated
* @param omit a set of words to be omitted from the resulting keywords
* @returns the resulting set of keywords, and an empty set if the value is null
*/
export declare const extractKeywordsFromPopulatedField: (field: Record<string, any> | Array<Record<string, any>> | null, path: string, omit: string[]) => string[];