@geekbears/gb-mongoose-keywords-plugin
Version:
A Mongoose plugin for keyword generation
10 lines (9 loc) • 486 B
TypeScript
/**
* Handle keyword generation for a given field value, regardless of its type.
* Supports plain strings, arrays of strings and one-level-deep objects
*
* @param value the source field value.
* @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 extractKeywordsFromField: (value: string | string[] | Record<string, any> | null, omit: string[]) => string[];