Object fields, retrieve fields (and values) of an object
yarn add @aegenet/belt-ofields@^2.0.0
# or
npm i @aegenet/belt-ofields@^2.0.0
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'],
// ]