# smart-assign

> a smarter version of Object.assign

Latest version **1.0.8** (published 2022-10-26) · ISC license · 0 weekly downloads

## Install

```sh
npm install smart-assign
pnpm add smart-assign
yarn add smart-assign
bun add smart-assign
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2022-10-26 |
| First published | 2017-07-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | seelikes |
| Maintainers | seelikes |

## Links

- npm: https://www.npmjs.com/package/smart-assign
- Repository: https://github.com/seelikes/SmartAssign
- Homepage: https://github.com/seelikes/SmartAssign#readme
- Issues: https://github.com/seelikes/SmartAssign/issues
- npm.io page: https://npm.io/package/smart-assign

## Recent versions

- 1.0.8 (latest) — 2022-10-26
- 1.0.7 — 2022-01-26
- 1.0.6 — 2022-01-18
- 1.0.5 — 2018-09-08
- 1.0.4 — 2018-08-27
- 1.0.3 — 2018-03-27
- 1.0.2 — 2017-11-25
- 1.0.1 — 2017-07-06
- 1.0.0 — 2017-07-06

## README

# SmartAssign
a smarter version of Object.assign.
deep assign when Object.assign is defined, otherwise, it will deep copy every property iteratively.

## install
npm install --save smart-assign

## usage example

<code>
    'use strict'; 

    import smartAssign from '../lib/index';  

    let data = 'data';  

    smartAssign(  
        {},  
        {  
            a: {  
                a1: 'a1',  
                a2: () => {  
                    return 'a2';  
                },  
            },  
            b: {  
                b1: function () {  
                    console.log('b1 enter.')  
                },  
                b2: function () {  
                    return data;  
                },  
            },  
        }  
    ); 
</code>

## tips
Objects without prototype can not be copied, can not be assigned, thus it will never change as the first parameter, and never be copied as other parameters

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