Permalink
Cannot retrieve contributors at this time
35 lines (32 sloc)
978 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/lodash/conforms.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var baseClone = require('./_baseClone'), | |
baseConforms = require('./_baseConforms'); | |
/** Used to compose bitmasks for cloning. */ | |
var CLONE_DEEP_FLAG = 1; | |
/** | |
* Creates a function that invokes the predicate properties of `source` with | |
* the corresponding property values of a given object, returning `true` if | |
* all predicates return truthy, else `false`. | |
* | |
* **Note:** The created function is equivalent to `_.conformsTo` with | |
* `source` partially applied. | |
* | |
* @static | |
* @memberOf _ | |
* @since 4.0.0 | |
* @category Util | |
* @param {Object} source The object of property predicates to conform to. | |
* @returns {Function} Returns the new spec function. | |
* @example | |
* | |
* var objects = [ | |
* { 'a': 2, 'b': 1 }, | |
* { 'a': 1, 'b': 2 } | |
* ]; | |
* | |
* _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); | |
* // => [{ 'a': 1, 'b': 2 }] | |
*/ | |
function conforms(source) { | |
return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); | |
} | |
module.exports = conforms; |