zenika-open-source / immutadot

immutadot is a JavaScript library to deal with nested immutable structures.

Home Page:https://immutadot.zenika.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add init function

ebriand opened this issue · comments

Prerequisites

Description

To be able to init an object with a value in a path, we have to use

set({}, 'path.to.value', 'value')

If there was an init function, the syntax will be

init('path.to.value', 'value')

Expected behavior

The following call

init('path.to.value', 'value') 

should return

{ "path": { "to": { "value": "value" } } }

(equivalent to set({}, 'path.to.value', 'value'))

closed by #288