UNPKG

clone-deep-non-nil

Version:

A package to replicate Lodash's `cloneDeep`/`cloneDeepWith` behavior while also removing any `undefined` or `null` values

53 lines (32 loc) โ€ข 1.97 kB
[![npm version][npm-version-src]][npm-version-href] [![GitHub Actions][github-actions-src]][github-actions-href] [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) <!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] --> <!-- [![Codecov][codecov-src]][codecov-href] --> # clone-deep-non-nil This package provides a function to clone an object deeply, but only if the value is not `null` or `undefined`. ## ๐Ÿงช Testing ```bash pnpm test ``` ## ๐Ÿ“ˆ Changelog Please see our [releases](https://github.com/shadowgate15/clone-deep-non-nil/releases) page for more information on what has changed recently. ## ๐Ÿ’ช๐Ÿผ Contributing Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details. ## ๐Ÿ Community For help, discussion about best practices, or any other conversation that would benefit from being searchable: [Discussions on GitHub](https://github.com/shadowgate15/clone-deep-non-nil/discussions) For casual chit-chat with others using this package: [Join the Open Web Discord Server](https://discord.ow3.org) ## ๐Ÿ“„ License The MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information. Made with โค๏ธ <!-- Badges --> [npm-version-src]: https://img.shields.io/npm/v/clone-deep-non-nil?style=flat-square [npm-version-href]: https://npmjs.com/package/clone-deep-non-nil [npm-downloads-src]: https://img.shields.io/npm/dm/clone-deep-non-nil?style=flat-square [npm-downloads-href]: https://npmjs.com/package/clone-deep-non-nil [github-actions-src]: https://img.shields.io/github/workflow/status/shadowgate15/clone-deep-non-nil/CI/main?style=flat-square [github-actions-href]: https://github.com/shadowgate15/clone-deep-non-nil/actions?query=workflow%3Aci <!-- [codecov-src]: https://img.shields.io/codecov/c/gh/shadowgate15/clone-deep-non-nil/main?style=flat-square [codecov-href]: https://codecov.io/gh/shadowgate15/clone-deep-non-nil -->