https://github.com/afeiship/next-safe-assign
Safe assign for next.
https://github.com/afeiship/next-safe-assign
assign mix next safe
Last synced: about 1 month ago
JSON representation
Safe assign for next.
- Host: GitHub
- URL: https://github.com/afeiship/next-safe-assign
- Owner: afeiship
- License: mit
- Created: 2020-01-15T11:04:20.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-22T07:02:12.000Z (over 5 years ago)
- Last Synced: 2025-09-11T01:55:51.147Z (9 months ago)
- Topics: assign, mix, next, safe
- Language: JavaScript
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-safe-assign
> Safe assign for next.
[![version][version-image]][version-url]
[![license][license-image]][license-url]
[![size][size-image]][size-url]
[![download][download-image]][download-url]
## installation
```bash
npm install -S @jswork/next-safe-assign
```
## usage
```js
import '@jswork/next-safe-assign';
const res = safeAssign(
{ a: 1, b: 2 },
{ c: 2, a: '' },
(key, value) => {
// you can customize your ignore function
return value == null;
}
);
// { a: '', b: 2, c: 2 }
```
## resources
- https://github.com/zmen/safe-assign
## license
Code released under [the MIT license](https://github.com/afeiship/next-safe-assign/blob/master/LICENSE.txt).
[version-image]: https://img.shields.io/npm/v/@jswork/next-safe-assign
[version-url]: https://npmjs.org/package/@jswork/next-safe-assign
[license-image]: https://img.shields.io/npm/l/@jswork/next-safe-assign
[license-url]: https://github.com/afeiship/next-safe-assign/blob/master/LICENSE.txt
[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/next-safe-assign
[size-url]: https://github.com/afeiship/next-safe-assign/blob/master/dist/next-safe-assign.min.js
[download-image]: https://img.shields.io/npm/dm/@jswork/next-safe-assign
[download-url]: https://www.npmjs.com/package/@jswork/next-safe-assign