MCPcopy Index your code
hub / github.com/brianneisler/mudash

github.com/brianneisler/mudash @v0.10.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.10.0 ↗ · + Follow
484 symbols 1,786 edges 570 files 0 documented · 0% updated 9y ago★ 10855 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

mudash

Lodash wrapper providing Immutable.JS support

Benefits

  • All the benefits of Lodash brought to Immutable.JS
  • Supports both standard mutable values and Immutable.JS data types
  • Converts types based on data hinting
  • Supports mixed nested data types making it easier to process values of mixed Immutable.JS/mutable data objects
  • All Lodash methods have been rewritten to be fully immutable operations (for both mutable and Immutable.JS data types)
  • Supports lodash/fp bringing functional programming to Immutable.JS

Build Status

npm version

Build Status

NPM

Documentation

Full API documentation - Learn about each method

Install

npm install --save mudash

Usage

import _ from 'mudash'
import fp from 'mudash/fp'
import Immutable from 'immutable'

// Immutable example
const map = Immutable.Map({ a:1, b:2 })
_.set(map, 'c.d', 3)    // returns Map { "a": 1, "b": 2, "c": Map { "d": 3 } }
fp.set('c.d', 3)(map)   // returns Map { "a": 1, "b": 2, "c": Map { "d": 3 } }


// Mutable example
const obj = { a:1, b:2 }
_.set(obj, 'c.d', 3)    // returns { "a": 1, "b": 2, "c": { "d": 3 } }
fp.set('c.d', 3)(obj)   // returns { "a": 1, "b": 2, "c": { "d": 3 } }

Gotchas

Some Immutable.JS methods conflict with Lodash methods (mudash chooses Lodash)

For example, Immutable's merge is the equivalent of Lodash's assign and Lodash's merge is the equivalent of Immutable's mergeDeep. In order to reconcile this we have opted for Lodash's signature over Immutable's. Therefore, for this example, use assign for a shallow merge and merge for a deep merge.

Lodash has methods that mutate values (mudash does not)

In a few cases Lodash mutates values. In the case of mutable values that are passed to these methods in mudash the method will no longer mutate the value. This has resulted in a slight change to the signature of a few methods.

Core symbols most depended-on inside this repo

Shape

Function 426
Method 42
Class 16

Languages

TypeScript100%

Modules by API surface

src/core/__tests__/util/setupTest.js27 symbols
src/core/deftype.js17 symbols
src/core/__tests__/recompose/withMultipleTypeInputs.js9 symbols
src/core/cache/Stack.js8 symbols
src/core/cache/MapCache.js8 symbols
src/core/cache/ListCache.js8 symbols
src/core/cache/Hash.js8 symbols
src/core/__tests__/includes.test.js8 symbols
src/core/defprotocol.js7 symbols
src/core/cache/SetCache.js6 symbols
src/core/__tests__/isEqual.test.js4 symbols
src/core/base/baseSet.js3 symbols

For agents

$ claude mcp add mudash \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page