/** * Checks whether the given data object complies or not with the given filter. * * The filter format must be full (i.e. with the properties logic and conditions) such as * seen in the function bbn.fn.search and can be generated by the function bbn.fn.filterToConditions. * * @method compareConditions * @global * @example * ```javascript * let item = {name: "Raiders of the lost ark", director: "Steven Spielberg", year: 1981, id: 589}; * bbn.fn.compareConditions(item, { * logic: "AND", * conditions: [ * { * field: "director", * value: "Steven Spielberg" * } * ] * }); * // true * bbn.fn.compareConditions(item, bbn.fn.filterToConditions({director: "Steven Soderberg"})); * // false * bbn.fn.compareConditions(item, bbn.fn.filterToConditions({director: "Steven Spielberg"})); * // true * bbn.fn.compareConditions(item, bbn.fn.filterToConditions({year: 1980}, ">")); * // true * bbn.fn.compareConditions(item, { * logic: "AND", * conditions: [ * { * field: "year", * operator: "<", * value: 1980 * } * ] * }); * // false * ``` * @memberof bbn.fn * @param {Object} data * @param {Object} filter * @returns {Boolean} */ export default function compareConditions(data: any, filter: any): boolean;