upick
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

μpick

A typescript pick utility.

Features

  • returns an object with a subset of keys and values from a given object
  • type safe.
  • smallest possible size and lightest cpu load

Usage

install

npm i upick

import

import upick from 'upick'

use μpick

Give μpick an object and the desired keys to pick.

const object = {
	a: 'a',
	b: 'b',
	c: 'c'
};

const result = upick(object, ['a', 'c']);

expect(result).toStrictEqual({
	a: 'a',
	c: 'c'
});

Package Sidebar

Install

npm i upick

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.46 kB

Total Files

6

Last publish

Collaborators

  • xkore