CSML-by-Clevy / csml-engine

CSML is an easy-to-use chatbot programming language and framework.

Home Page:https://csml.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

object assign, array flatten

frsechet opened this issue · comments

Is your feature request related to a problem? Please describe.
Merging objects and flattening arrays is a bit difficult in CSML. Simple built-in methods to perform these actions would be great.

do someobj = { "tata": 1 }
do newobj = someobj.assign({ "toto": 123}) // => { tata: 1, toto: 123 })

do somearray = [[4, 5], [6, 7]];
do newarray = somearray.flatten() // => [4, 5, 6, 7]