@aegenet/belt-ofields
v2.3.0
Published
Object fields, retrieve fields (and values) of an object
Downloads
36
Readme
@aegenet/belt-ofields
Object fields, retrieve fields (and values) of an object
💾 Installation
yarn add @aegenet/belt-ofields@^2.0.0
# or
npm i @aegenet/belt-ofields@^2.0.0
📝 Usage
import { ofields } from '@aegenet/belt-ofields';
const result = ofields({ id: 5 }, { fields: ['id'] });
// result = [['id', 5]]
const result = odiff({
id: 5,
code: 'Trotro',
another: 1,
}, { fields: ['id', 'code'] });
// result = [
// ['id', 5],
// ['code', 'Trotro'],
// ]