UNPKG

obj-chain-core

Version:

fluent chaining for obj with dot-prop access

51 lines (44 loc) 1.55 kB
// build up objects with file operations that store .current // might be overlapping with flow const InstructionsPlugin = { // https://lodash.com/docs/4.17.4#find // https://lodash.com/docs/4.17.4#attempt // diff & snapshot // https://lodash.com/docs/4.17.4#cloneDeep // https://lodash.com/docs/4.17.4#differenceWith // https://lodash.com/docs/4.17.4#omit // https://lodash.com/docs/4.17.4#mapValues // https://lodash.com/docs/4.17.4#forOwn // // https://lodash.com/docs/4.17.4#toArray // https://lodash.com/docs/4.17.4#castArray // https://lodash.com/docs/4.17.4#concat // https://lodash.com/docs/4.17.4#flatten // https://lodash.com/docs/4.17.4#head first // https://lodash.com/docs/4.17.4#slice // https://lodash.com/docs/4.17.4#sortedIndexBy // https://lodash.com/docs/4.17.4#tail last // https://lodash.com/docs/4.17.4#remove // // limit args like call until less than 5 times // https://lodash.com/docs/4.17.4#before // https://lodash.com/docs/4.17.4#after // like what I did with the debug lib, calling `()()` // https://lodash.com/docs/4.17.4#curry // https://lodash.com/docs/4.17.4#mapKeys mapKeys() {}, } /** * * ... I suppose this is kind of what lodash chain does... * * obj * .chain() // start .current * .when() // start condition builder * .get('bah') // get it * .eq('ha') // check previous with this * .set('deep.dat', true) // set value if needed * .end() // go back to parent (obj), maybe do the actual op here * .get('deep.dat') * */