Lodash wrapper providing Immutable.JS support
Full API documentation - Learn about each method
npm install --save mudash
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 } }
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.
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.
$ claude mcp add mudash \
-- python -m otcore.mcp_server <graph>