@aegenet/belt-ofields
TypeScript icon, indicating that this package has built-in type declarations

1.5.0 • Public • Published

npm version

@aegenet/belt-ofields

Object fields, retrieve fields (and values) of an object

💾 Installation

yarn add @aegenet/belt-ofields@^1.4.0
# or
npm i @aegenet/belt-ofields@^1.4.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'],
// ]

Package Sidebar

Install

npm i @aegenet/belt-ofields

Weekly Downloads

0

Version

1.5.0

License

MIT

Unpacked Size

4.25 kB

Total Files

7

Last publish

Collaborators

  • agenet