1.0.0 • Published 3 years ago

@jswork/next-try-set-get v1.0.0

Weekly downloads
1
License
MIT
Repository
-
Last release
3 years ago

next-try-set-get

Try to set value then return the value.

version license size download

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.