summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/cli-table2/node_modules/lodash/utility/matches.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/cli-table2/node_modules/lodash/utility/matches.js')
-rw-r--r--deps/npm/node_modules/cli-table2/node_modules/lodash/utility/matches.js33
1 files changed, 33 insertions, 0 deletions
diff --git a/deps/npm/node_modules/cli-table2/node_modules/lodash/utility/matches.js b/deps/npm/node_modules/cli-table2/node_modules/lodash/utility/matches.js
new file mode 100644
index 0000000000..a182637bdb
--- /dev/null
+++ b/deps/npm/node_modules/cli-table2/node_modules/lodash/utility/matches.js
@@ -0,0 +1,33 @@
+var baseClone = require('../internal/baseClone'),
+ baseMatches = require('../internal/baseMatches');
+
+/**
+ * Creates a function that performs a deep comparison between a given object
+ * and `source`, returning `true` if the given object has equivalent property
+ * values, else `false`.
+ *
+ * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+ * numbers, `Object` objects, regexes, and strings. Objects are compared by
+ * their own, not inherited, enumerable properties. For comparing a single
+ * own or inherited property value see `_.matchesProperty`.
+ *
+ * @static
+ * @memberOf _
+ * @category Utility
+ * @param {Object} source The object of property values to match.
+ * @returns {Function} Returns the new function.
+ * @example
+ *
+ * var users = [
+ * { 'user': 'barney', 'age': 36, 'active': true },
+ * { 'user': 'fred', 'age': 40, 'active': false }
+ * ];
+ *
+ * _.filter(users, _.matches({ 'age': 40, 'active': false }));
+ * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
+ */
+function matches(source) {
+ return baseMatches(baseClone(source, true));
+}
+
+module.exports = matches;