QubitProducts / slapdash

A lightweight JavaScript utility belt with native method override protection
http://npmjs.org/packages/slapdash
MIT License
3 stars 1 forks source link

Make set always set #54

Closed alanclarke closed 6 years ago

alanclarke commented 6 years ago

Currently, if a path does not exist, slapdash set silently does nothing.

This causes bugs, because people using set expect it to work like lodash or underscore.

For example, using it to create a window variable and all the intermediary parts:


// before:
_.set(window, 'namespace.thing.subthing', {}) // does nothing

// after:
_.set(window, 'namespace.thing.subthing', {}) // sets the subthing
KidkArolis commented 6 years ago

Shall we release as new major or not really?

If not really, we should only release in January.

KidkArolis commented 6 years ago

But looks good, and an important fix!

alanclarke commented 6 years ago

I think this is a bug fix to be honest, not a major api change. All the existing tests still pass, just added some new ones