Code Monkey home page Code Monkey logo

mergejson's Introduction

Hi there, I'm Guillaume ๐Ÿ‘‹

I'm currently responsible for technology at Peaks.


githubstats

mergejson's People

Contributors

dependabot[bot] avatar jonathankeebler avatar jrodri2001 avatar khezen avatar svtokarevsv avatar

Stargazers

 avatar

Watchers

 avatar  avatar

mergejson's Issues

add option to prevent the use of combine-lists for arrays

For arrays, sometimes a user would like to remove items from the array, but with current merge it is not possible, only adding elements present on both (dominant and recessive params).

The idea is to allow passing an option that will take the dominant array and use it in the merge, allowing the recessive values to be overwriten.

for example:
var ob1 = { meta: ["one","two","three"] }

var ob2 = { meta: ["two"] }

using:
merge(ob2, ob1, true);

output
{ meta: ["two"] }

Converts merged arrays into objects

Example:

var mergejson = require("mergejson");

console.log(mergejson(
    {
        list: ["a", "b"]
    },
    {
        list: ["c"]
    }
));

Outputs:

{ list: { '0': 'a', '1': 'b' } }

Expected:

{ list: ["a", "b", "c"] }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.