diff --git a/index.js b/index.js index 662ee59..1958192 100644 --- a/index.js +++ b/index.js @@ -120,17 +120,28 @@ function check_filters (filters, e, carried_data, or = false) { * @property {RegExp} filter - filter */ +/** + * @typedef FilterFunction + * @type {object} + * @property {function} function - function to test element for match + */ + /** * @typedef FilterOrGroup * @type {object} - * @property {(Filter|FilterOrGroup)[]} or - create an OR group of filters + * @property {FilterType[]} or - create an OR group of filters + */ + +/** + * @typedef FilterType + * @type {Filter|FilterFunction|FilterOrGroup} */ /** * filter nested objects * * @param {Array} input object to filter - * @param {(Filter|FilterOrGroup)[]} filters filters + * @param {FilterType[]} filters filters * @param {string[]} carry carry data to children to match * @param {object} carried_data internal: carried data * @returns {Array} filtered data