{"library":"lodash._basematches","title":"Lodash Internal baseMatches Module","description":"This package, `lodash._basematches`, exposes an internal utility function from Lodash v3, specifically `baseMatches`. It's part of Lodash's legacy modularization strategy (pre-v4) where core internal functions were published as individual npm packages. The `baseMatches` function itself is used internally by Lodash to create a predicate function for deep object comparison, similar to how `_.matches` works in the public API. This module is stable at version 3.2.0, which corresponds to the Lodash v3 release line. It is not actively maintained as a standalone module and is considered superseded by the main `lodash` package (v4.x and later) or `lodash-es` for modern usage. Its primary differentiation was being a single-purpose, highly optimized internal primitive available separately, though this approach is now largely deprecated in favor of comprehensive bundles and tree-shakable ES modules.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install lodash._basematches"],"cli":null},"imports":["const baseMatches = require('lodash._basematches');","const baseMatches = require('lodash._basematches');"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const baseMatches = require('lodash._basematches');\n\n// baseMatches takes a source object and returns a predicate function.\n// The predicate function checks if an object has properties matching the source.\n\nconst source = { a: 1, b: 'test' };\nconst predicate = baseMatches(source);\n\nconsole.log('Predicate function created:', typeof predicate === 'function');\n\nconst object1 = { a: 1, b: 'test', c: 3 };\nconst object2 = { a: 1, b: 'wrong' };\nconst object3 = { a: 1 };\n\nconsole.log('Matching object1:', predicate(object1)); // Expected: true\nconsole.log('Matching object2:', predicate(object2)); // Expected: false\nconsole.log('Matching object3:', predicate(object3)); // Expected: false\n\nconst nestedSource = { user: { id: 123, name: 'Alice' } };\nconst nestedPredicate = baseMatches(nestedSource);\n\nconst data1 = { id: 1, user: { id: 123, name: 'Alice', email: 'a@example.com' } };\nconst data2 = { id: 2, user: { id: 456, name: 'Bob' } };\n\nconsole.log('Matching data1 (nested):', nestedPredicate(data1)); // Expected: true\nconsole.log('Matching data2 (nested):', nestedPredicate(data2)); // Expected: false\n","lang":"javascript","description":"Demonstrates how to import and use the `baseMatches` function to create a predicate for object property matching.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}