# fill-keys

> Fill keys in a destination that are defined on the source

Latest version **2.0.0** (published 2022-10-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install fill-keys
pnpm add fill-keys
yarn add fill-keys
bun add fill-keys
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-10-14 |
| First published | 2015-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 16 |
| Dependencies | 2 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ben Drucker |
| Maintainers | bendrucker |
| Keywords | keys, object, copy |

## Links

- npm: https://www.npmjs.com/package/fill-keys
- Repository: https://github.com/bendrucker/fill-keys
- Homepage: https://github.com/bendrucker/fill-keys#readme
- Issues: https://github.com/bendrucker/fill-keys/issues
- npm.io page: https://npm.io/package/fill-keys

## Dependencies (2)

- [is-object](https://npm.io/package/is-object.md) ~1.0.2
- [merge-descriptors](https://npm.io/package/merge-descriptors.md) ~1.0.1

## Recent versions

- 2.0.0 (latest) — 2022-10-14
- 1.0.2 — 2015-10-05
- 1.0.1 — 2015-06-02
- 1.0.0 — 2015-05-19

## README

# fill-keys

> Fill keys in a destination that are defined on the source. Copies descriptors so properties like `enumerable` will persist. 


## Install

```
$ npm install --save fill-keys
```


## Usage

```js
const fillKeys = require('fill-keys')

fillKeys(destination, source);
//=> missing destination keys in source are copied
```

fill-keys will copy descriptors. It will also copy the `source.prototype` properties onto `destination.prototype` if both `destination` and `source` are functions. 

## API

#### `fillKeys(destination, source)` -> `destination`

#### `destination`

*Required*  
Type: `any`

The destination object where keys from `source` will be added.

#### source

*Required*  
Type: `any`

The source object from which to copy properties.

## License

MIT © [Ben Drucker](http://bendrucker.me)

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