Lodash Internal Object Types

2.4.1 · abandoned · verified Wed Apr 22

This package, `lodash._objecttypes`, is an internal utility module extracted from Lo-Dash v2.4.1, released in December 2013. It provided the `objectTypes` variable, an internal structure used by Lo-Dash's core functions for type checking (e.g., `isObject`, `isPlainObject`). It was part of Lo-Dash's modularization strategy in its second major version, where internal components and methods were published as separate npm packages. However, this specific package is not intended for direct external consumption and its internal structure, existence, and API stability were never guaranteed. The main Lodash library has since evolved significantly, with the current stable version being 4.18.1 (as of April 2026), and its internal modularization and distribution methods (like `lodash-es` for ES modules) have changed considerably. This package is no longer maintained as a standalone entity and its functionality is integrated or superseded within modern Lodash versions. Its primary historical differentiator was serving as a foundational internal piece of the Lodash v2 type-checking mechanism.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates the CommonJS import and the structure of the `objectTypes` object, illustrating its internal purpose in Lodash v2.

const objectTypes = require('lodash._objecttypes');

// In Lodash v2, 'objectTypes' was used internally for quick type checks.
// It typically mapped JavaScript's `typeof` results to booleans.
// For example, to check if a value was an 'object' or 'function'.

console.log('--- lodash._objecttypes example ---');
console.log('Object types map:', objectTypes);

// Example of how it might have been used internally (simplified):
function isObjectLike(value) {
  return objectTypes[typeof value] === true;
}

console.log(`isObjectLike(null): ${isObjectLike(null)}`); // null is 'object' via typeof
console.log(`isObjectLike({}): ${isObjectLike({})}`);
console.log(`isObjectLike([]): ${isObjectLike([])}`);
console.log(`isObjectLike(() => {}): ${isObjectLike(() => {})}`);
console.log(`isObjectLike(123): ${isObjectLike(123)}`);

// Note: For actual Lodash usage, always use the main 'lodash' package:
// const _ = require('lodash');
// console.log(`_.isObjectLike({}): ${_.isObjectLike({})}`);

view raw JSON →