1.0.0 • Published 3 years ago
@jswork/next-try-set-get v1.0.0
next-try-set-get
Try to set value then return the value.
installation
npm install -S @jswork/next-try-set-get
usage
import '@jswork/next-try-set-get';
const obj = { name: 'fei', email: '1290657123@qq.com' };
const res1 = nx.trySetGet(obj, 'name', 'feizheng');
const res2 = nx.trySetGet(obj, 'github', 'afeiship');
// results:
// afei
// afeiship
license
Code released under the MIT license.
1.0.0
3 years ago