1.0.1 • Published 2 years ago

@jswork/next-try-set v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

next-try-set

Try to set value then return the value.

version license size download

installation

npm install -S @jswork/next-try-set

usage

import '@jswork/next-try-set';

const obj = { name: 'fei', email: '1290657123@qq.com' };
const res1 = nx.trySet(obj, 'name', 'feizheng');
const res2 = nx.trySet(obj, 'github', 'afeiship');

// results:

// afei
// afeiship

license

Code released under the MIT license.