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

2.2.0 • Public • Published

just-values

Part of a library of zero-dependency npm modules that do just do one thing. Guilt-free utilities for every occasion.

🍦 Try it

npm install just-values
yarn add just-values

Return property values as an array

const values = require('just-values');

values({a: 4, c: 8}); // [4, 8]
values({a: {aa: 2}, b: {bb: 4}}); // [{aa: 2}, {bb: 4}]
values({}); // []
values([1, 2, 3]); // [1, 2, 3]
values(function(a, b) {return a + b;}); // []
values(new String('hello')); // ['h', 'e', 'l', 'l', 'o']
values(1); // throws exception
values(true); // throws exception
values(undefined); // throws exception
values(null); // throws exception

Package Sidebar

Install

npm i just-values

Weekly Downloads

306

Version

2.2.0

License

MIT

Unpacked Size

5.79 kB

Total Files

9

Last publish

Collaborators

  • angus-c