# organic-dna-cellmodes

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

Latest version **1.0.1** (published 2021-12-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install organic-dna-cellmodes
pnpm add organic-dna-cellmodes
yarn add organic-dna-cellmodes
bun add organic-dna-cellmodes
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2021-12-06 |
| First published | 2014-09-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Boris Filipov |
| Maintainers | outbounder |

## Links

- npm: https://www.npmjs.com/package/organic-dna-cellmodes
- Repository: https://github.com/node-organic/organic-dna-cellmodes
- Issues: https://github.com/node-organic/organic-dna-cellmodes/issues
- npm.io page: https://npm.io/package/organic-dna-cellmodes

## Dependencies (3)

- [lodash.has](https://npm.io/package/lodash.has.md) ^4.5.2
- [organic-dna-fold](https://npm.io/package/organic-dna-fold.md) ^1.0.0
- [organic-dna-branches](https://npm.io/package/organic-dna-branches.md) ^1.0.0

## Recent versions

- 1.0.1 (latest) — 2021-12-06
- 1.0.0 — 2019-09-10
- 0.1.1 — 2017-10-17
- 0.1.0 — 2016-05-18
- 0.0.2 — 2015-02-23
- 0.0.1 — 2014-09-15

## README

# organic-dna-cellmodes

Simple utility function to [fold and merge](https://github.com/node-organic/organic-dna-fold) 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"
})
```

---
_Source: https://npm.io/package/organic-dna-cellmodes · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
