os-filter-obj

v2.0.0
Filter an array of objects to a specific OS
arch filter obj object os

os-filter-obj Build Status

Filter an array of objects to a specific OS

Install

$ npm install os-filter-obj

Usage

const osFilterObj = require('os-filter-obj');

const objects = [{
    os: 'linux',
    arch: 'x64',
    foo: 'unicorn',
    bar: 'cow'
}, {
    os: 'darwin',
    arch: 'x64',
    foo: 'unicorn',
    bar: 'cow'
},{
    os: 'win32',
    arch: 'x64',
    foo: 'unicorn',
    bar: 'cow'
}];

osFilterObj(objects);
/*
    [{
        os: 'linux',
        arch: 'x64',
        foo: 'unicorn',
        bar: 'cow'
    }];
*/

API

osFilterObj(objects)

Returns an Array with the filtered objects.

objects

Type: Array

The Array to filter.

License

MIT © Kevin Mårtensson

npm i os-filter-obj

Metadata

  • MIT
  • >=4
  • Kevin Mårtensson
  • released 7/25/2017

Downloads

Maintainers