Simple utility function to fold and merge DNA structure based on given value.
npm i organic-dna-cellmodes
dna
is a tree-likeorganic-dna
structurevalue
is a string- it can contain a
+
character which will trigger multiple folding operations - it can contain a
.
character which will trigger a folding operation on a sub-branch - both
+
and.
can be combined infinitely
- it can contain a
- returns Boolean (true || false) indicating successful fold
const dna = {
myModeX: {
property: "value42"
},
property: "value"
}
var selectModes = require("organic-dna-cellmodes")
selectModes(dna, 'myModeX')
expect(dna).toBeDeepEqual({
myModeX: {
property: "value42"
},
property: "value42"
})