Installations
npm install filter-object-array
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
16.13.0
NPM Version
8.1.0
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Developer
circa10a
Download Statistics
Total Downloads
5,582
Last Day
3
Last Week
9
Last Month
50
Last Year
571
GitHub Statistics
4 Stars
23 Commits
1 Forks
4 Watching
1 Branches
1 Contributors
Bundle Size
30.09 kB
Minified
8.33 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.3.6
Package Id
filter-object-array@0.3.6
Unpacked Size
7.61 kB
Size
2.86 kB
File Count
6
NPM Version
8.1.0
Node Version
16.13.0
Total Downloads
Cumulative downloads
Total Downloads
5,582
Last day
50%
3
Compared to previous day
Last week
80%
9
Compared to previous week
Last month
212.5%
50
Compared to previous month
Last year
-11.2%
571
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
filter-object-array
A small library to make filtering array of objects easier
Installation
1npm install filter-object-array
Usage
1const filterObjectArray = require('filter-object-array'); 2 3const arr = [ 4 { 5 car: 'toyota', 6 color: 'blue', 7 year: 2010, 8 trans: 'auto', 9 warrantyEnd: '2013', 10 }, 11 { 12 car: 'toyota', 13 condition: 'good', 14 color: 'green', 15 year: 2010, 16 trans: 'manual', 17 warrantyEnd: '2013', 18 }, 19 { 20 car: 'ford', 21 color: 'yellow', 22 year: 2012, 23 trans: 'auto', 24 warrantyEnd: '2015', 25 }, 26]; 27 28// Filter using same data types 29const sameDataType = async () => { 30 const filtersMatchType = { 31 color: 'blue', 32 year: 2010, 33 }; 34 console.log(await filterObjectArray({ array: arr, objFilter: filtersMatchType })); 35}; 36 37// Filter array using different data types 38const diffDataType = async () => { 39 const filtersDiffType = { 40 warrantyEnd: 2015, 41 }; 42 console.log(await filterObjectArray({ array: arr, objFilter: filtersDiffType, ignoreDataType: true })); 43}; 44 45sameDataType(); 46/* [ { car: 'toyota', 47 color: 'blue', 48 year: 2010, 49 trans: 'auto', 50 warrantyEnd: '2013' } ] */ 51 52diffDataType(); 53/* [ { car: 'ford', 54 color: 'yellow', 55 year: '2012', 56 trans: 'auto', 57 warrantyEnd: '2015' } ] */
Tests
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/circa10a/filter-object-array/publish.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/circa10a/filter-object-array/publish.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/circa10a/filter-object-array/publish.yaml/main?enable=pin
- Info: 0 out of 3 GitHub-owned GitHubAction dependencies pinned
- Info: 1 out of 1 npmCommand dependencies pinned
Reason
Found 0/17 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/publish.yaml:1
- Info: no jobLevel write permissions found
Reason
project is archived
Details
- Warn: Repository is archived.
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 7 are checked with a SAST tool
Reason
18 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Score
2.6
/10
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to filter-object-array
os-filter-obj
Filter an array of objects to a specific OS
object.omit
Return a copy of an object excluding the given key, or array of keys. Also accepts an optional filter function as the last argument.
obop
MongoDB-style object operators makes array manipulation easy: where/order/update/view
object-array-filter
Filters an array of objects by matching a field's value in each object to a search term. Returns filtered array