Lodash Internal baseValues Function

3.0.0 · abandoned · verified Tue Apr 21

This package exports the internal `baseValues` function from Lodash v3.0.0 as a standalone Node.js module. It provides a low-level, optimized utility for extracting property values from an object, primarily designed for internal use within the larger Lodash library ecosystem. As a v3 module, it precedes the significant architectural changes introduced in Lodash v4, where modularization strategies shifted towards `lodash-es` and direct path imports from the main `lodash` package for improved tree-shaking and modern JavaScript compatibility. Consequently, `lodash._basevalues` is now largely superseded and is not actively maintained, making it unsuitable for new projects aiming for compatibility with modern Lodash versions or ES module environments. Its release cadence is tied to the legacy Lodash v3 development cycle.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to import and use the `baseValues` function to extract property values from various inputs like objects and arrays, showcasing its direct application.

const baseValues = require('lodash._basevalues');

// Example 1: Extracting values from a plain object
const myObject = {
  id: 101,
  name: 'Widget A',
  price: 29.99,
  available: true,
  tags: ['electronics', 'gadget']
};

const objectValues = baseValues(myObject);
console.log('Values from object:', objectValues);
// Expected output: [101, 'Widget A', 29.99, true, ['electronics', 'gadget']] (order may vary in older JS engines)

// Example 2: Extracting values from an array (treated as an object with numeric keys)
const myArray = ['apple', 'banana', 'cherry'];
const arrayValues = baseValues(myArray);
console.log('Values from array:', arrayValues);
// Expected output: ['apple', 'banana', 'cherry']

// Example 3: Handling non-object inputs (Lodash typically returns an empty array)
console.log('Values from null:', baseValues(null));
console.log('Values from undefined:', baseValues(undefined));

view raw JSON →