# deep-shallow

> An object convert between shallow and deep

Latest version **0.1.2** (published 2018-06-23) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install deep-shallow
pnpm add deep-shallow
yarn add deep-shallow
bun add deep-shallow
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2018-06-23 |
| First published | 2018-02-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 2 |
| Unpacked size | 171.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | nju33 |
| Maintainers | nju33 |
| Keywords | object |

## Links

- npm: https://www.npmjs.com/package/deep-shallow
- Repository: git@github.com:nju33/deep-shallow
- npm.io page: https://npm.io/package/deep-shallow

## Dependencies (2)

- [lodash](https://npm.io/package/lodash.md) ^4.17.10
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.110

## Recent versions

- 0.1.2 (latest) — 2018-06-23
- 0.1.1 — 2018-06-23
- 0.1.0 — 2018-02-16
- 0.0.1 — 2018-02-09

## README

# deep-shallow

An object convert between shallow and deep.

[![npm: deep-shallow](https://img.shields.io/npm/v/deep-shallow.svg)](https://www.npmjs.com/package/deep-shallow)
[![CircleCI](https://circleci.com/gh/nju33/deep-shallow.svg?style=svg)](https://circleci.com/gh/nju33/deep-shallow)
[![Coverage Status](https://coveralls.io/repos/github/nju33/deep-shallow/badge.svg?branch=master)](https://coveralls.io/github/nju33/deep-shallow?branch=master)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
![license: mit](https://img.shields.io/packagist/l/doctrine/orm.svg)

## Install

```bash
yarn add [-d] deep-shallow
```

## Usage

```js
import {toDeep, toShallow} from 'deep-shallow';

const deepObj = {
  foo: {
    a: 'a',
    b: 'b',
    c: 'c',
    d: 'd',
  },
  bar: {
    x: 'x',
    y: 'y',
    z: 'z',
  },
  arr: [1, 2, 3, 4],
};

const shallowObj = toShallow(deepObj);
// {
//   'foo.a': 'a'
//   'foo.b': 'b'
//   'foo.c': 'c'
//   'foo.d': 'd',
//   'bar.x': 'x',
//   'bar.y': 'y',
//   'bar.z': 'z'
//    arr: [1, 2, 3, 4],
// }

toDeep(shallowObj);
// {
//   foo: {
//     a: 'a',
//     b: 'b',
//     c: 'c',
//     d: 'd',
//   },
//   bar: {
//     x: 'x',
//     y: 'y',
//     z: 'z',
//   },
//   arr: [1, 2, 3, 4],
// };
```

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