loockeeer / deno-deepmerge

This is a deno module for merging two objects/array deeply. This is NOT the same as deepmerge npm package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deno DeepMerge

This is a deno module for merging two objects/array deeply. This is NOT the same as deepmerge npm package

How to use

import { deepmerge } from "https://deno.land/x/deepmerge@VERSION/mod.ts"

const a = {
    foo: {
        bar: "somestring"
    }
}

const b = {
    foo: {
        baz: "something else"
    }
}

const output = deepmerge(a, b) // You can even merge three or 10, maybe 100 objects !

console.log(output)
/*
{
    foo: {
        bar: "somestring"
        baz: "something else"
    }
}
*/

/!\ You cannot merge Arrays, only Objects are currently supported /!\

Documentation

// Merges objects from sources into another (target) object
function deepmerge(target: any, ...sources: any[]): any

Full doc can be found at https://doc.deno.land/x/deepmerge@VERSION/mod.ts

About

This is a deno module for merging two objects/array deeply. This is NOT the same as deepmerge npm package

License:MIT License


Languages

Language:TypeScript 100.0%