Socket
Socket
Sign inDemoInstall

os-filter-obj

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

license

14

index.js
'use strict';
/**
* Filter an array of objects to a specific OS
*
* @param {Array} arr
* @api public
*/
module.exports = function (arr) {

@@ -14,2 +7,6 @@ var arch = process.arch === 'x64' ? 'x64' : process.arch === 'arm' ? 'arm' : 'x86';

if (!arr.length) {
return null;
}
return arr.filter(function (obj) {

@@ -23,2 +20,5 @@ if (obj.os === platform && obj.arch === arch) {

return obj;
} else if (obj.arch === arch && !obj.os) {
delete obj.arch;
return obj;
} else if (!obj.os && !obj.arch) {

@@ -25,0 +25,0 @@ return obj;

{
"name": "os-filter-obj",
"version": "1.0.0",
"version": "1.0.1",
"description": "Filter an array of objects to a specific OS",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc