# @vlr/object-tools

> Set of DRY tools to work with object. Typescript style.

Latest version **2.1.0** (published 2019-02-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vlr/object-tools
pnpm add @vlr/object-tools
yarn add @vlr/object-tools
bun add @vlr/object-tools
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2019-02-03 |
| First published | 2017-12-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 24.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vladimir Repin |
| Maintainers | vlr |

## Links

- npm: https://www.npmjs.com/package/@vlr/object-tools
- Repository: https://gitlab.com/vlr/object-tools
- Homepage: https://gitlab.com/vlr/object-tools#readme
- Issues: https://gitlab.com/vlr/object-tools/issues
- npm.io page: https://npm.io/package/@vlr/object-tools

## Recent versions

- 2.1.0 (latest) — 2019-02-03
- 2.0.0 — 2019-02-03
- 1.0.6 — 2018-09-07
- 1.0.5 — 2018-08-10
- 1.0.4 — 2018-05-26
- 1.0.3 — 2018-02-05
- 1.0.2 — 2018-01-29
- 1.0.1 — 2017-12-24

## README

# object-tools-ts
Set of DRY tools to work with object. Typescript style.

# isString isObject isNumber and isFunction
There are similar functions in util package, but those are marked deprecated. For isString there are notes to use typeof x === 'string' instead, and for other function there are similar notes. This lib is created to encapsulate that recommended code

# forIn
Iterates over fields of the object.

```
let a = { b: '1' };

forIn(a, (item, field) => console.log(item, field)); // b 1
```

# nullObject
Produces object which has null prototype

# extend
Copies fields onto new null object

```
const result = extend({ a: 1}, { b: 2}); // { a: 1, b: 2}
```

# sanitize and parse
sanitize removes prototype from object and all its fields recursively

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