CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
conforms.js36 linesDownload Raw Back to lodash
1var baseClone = require('./_baseClone'),2    baseConforms = require('./_baseConforms');3 4/** Used to compose bitmasks for cloning. */5var CLONE_DEEP_FLAG = 1;6 7/**8 * Creates a function that invokes the predicate properties of `source` with9 * the corresponding property values of a given object, returning `true` if10 * all predicates return truthy, else `false`.11 *12 * **Note:** The created function is equivalent to `_.conformsTo` with13 * `source` partially applied.14 *15 * @static16 * @memberOf _17 * @since 4.0.018 * @category Util19 * @param {Object} source The object of property predicates to conform to.20 * @returns {Function} Returns the new spec function.21 * @example22 *23 * var objects = [24 *   { 'a': 2, 'b': 1 },25 *   { 'a': 1, 'b': 2 }26 * ];27 *28 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));29 * // => [{ 'a': 1, 'b': 2 }]30 */31function conforms(source) {32  return baseConforms(baseClone(source, CLONE_DEEP_FLAG));33}34 35module.exports = conforms;36 
basant307/AI_Governance_Project · CoolFace