Skip to content

node-organic/organic-dna-cellmodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

organic-dna-cellmodes

Simple utility function to fold and merge DNA structure based on given value.

usage

install

npm i organic-dna-cellmodes

api

selectedModes(dna, value) : Boolean

  • dna is a tree-like organic-dna structure
  • value 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
  • returns Boolean (true || false) indicating successful fold

example

const dna = {
  myModeX: {
    property: "value42"
  },
  property: "value"
}

var selectModes = require("organic-dna-cellmodes")
selectModes(dna, 'myModeX')

expect(dna).toBeDeepEqual({
  myModeX: {
    property: "value42"
  },
  property: "value42"
})

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published