Gathering detailed insights and metrics for map-obj
Gathering detailed insights and metrics for map-obj
Gathering detailed insights and metrics for map-obj
Gathering detailed insights and metrics for map-obj
@f/map-obj
Map for objects.
obj-walker
Walk or map over objects in a depth-first preorder or postorder manner.
@types/map-obj
Stub TypeScript definitions entry for map-obj, which provides its own types definitions
typechecker
Utilities to get and check variable types (isString, isPlainObject, isRegExp, etc)
npm install map-obj
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.8
Supply Chain
99.5
Quality
75.7
Maintenance
100
Vulnerability
100
License
JavaScript (79.68%)
TypeScript (20.32%)
Total Downloads
6,399,684,678
Last Day
1,522,120
Last Week
26,284,971
Last Month
115,816,382
Last Year
1,228,477,500
MIT License
213 Stars
49 Commits
43 Forks
5 Watchers
1 Branches
11 Contributors
Updated on Jun 01, 2025
Minified
Minified + Gzipped
Latest Version
5.0.2
Package Id
map-obj@5.0.2
Unpacked Size
9.18 kB
Size
3.02 kB
File Count
5
NPM Version
8.3.2
Node Version
12.22.1
Cumulative downloads
Total Downloads
Last Day
-14.7%
1,522,120
Compared to previous day
Last Week
-9.9%
26,284,971
Compared to previous week
Last Month
6%
115,816,382
Compared to previous month
Last Year
-0.8%
1,228,477,500
Compared to previous year
Map object keys and values into a new object
1npm install map-obj
1import mapObject, {mapObjectSkip} from 'map-obj'; 2 3const newObject = mapObject({foo: 'bar'}, (key, value) => [value, key]); 4//=> {bar: 'foo'} 5 6const newObject = mapObject({FOO: true, bAr: {bAz: true}}, (key, value) => [key.toLowerCase(), value]); 7//=> {foo: true, bar: {bAz: true}} 8 9const newObject = mapObject({FOO: true, bAr: {bAz: true}}, (key, value) => [key.toLowerCase(), value], {deep: true}); 10//=> {foo: true, bar: {baz: true}} 11 12const newObject = mapObject({one: 1, two: 2}, (key, value) => value === 1 ? [key, value] : mapObjectSkip); 13//=> {one: 1}
Type: object
The source object to copy properties from.
Type: (sourceKey, sourceValue, source) => [targetKey, targetValue, mapperOptions?] | mapObjectSkip
A mapping function.
Type: object
Type: boolean
Default: true
Whether targetValue
should be recursed.
Requires deep: true
.
Type: object
Type: boolean
Default: false
Recurse nested objects and objects in arrays.
Type: object
Default: {}
The target object to map properties on to.
Return this value from a mapper
function to exclude the key from the new object.
1import mapObject, {mapObjectSkip} from 'map-obj'; 2 3const object = {one: 1, two: 2} 4const mapper = (key, value) => value === 1 ? [key, value] : mapObjectSkip 5const result = mapObject(object, mapper); 6 7console.log(result); 8//=> {one: 1}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 9/30 approved changesets -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
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 More