Installations
npm install orderedmap
Score
100
Supply Chain
89.5
Quality
75.9
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Developer
marijnh
Developer Guide
Module System
ESM
Min. Node Version
Typescript Support
Yes
Node Version
19.7.0
NPM Version
9.6.5
Statistics
39 Stars
37 Commits
9 Forks
6 Watching
1 Branches
7 Contributors
Updated on 07 Sept 2024
Bundle Size
1.57 kB
Minified
638.00 B
Minified + Gzipped
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
139,430,020
Last day
-5%
301,059
Compared to previous day
Last week
1.9%
1,652,704
Compared to previous week
Last month
13.2%
6,937,752
Compared to previous month
Last year
61.5%
61,411,962
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
1
OrderedMap
Persistent data structure representing an ordered mapping from strings to values, with some convenient update methods.
This is not an efficient data structure for large maps, just a minimal helper for cleanly creating and managing small maps in a way that makes their key order explicit and easy to think about.
License: MIT
Reference
The exported value from this module is the class OrderedMap
,
instances of which represent a mapping from strings to arbitrary
values.
OrderedMap.from
(value: ?Object | OrderedMap) → OrderedMap
Return a map with the given content. If null, create an empty map. If
given an ordered map, return that map itself. If given an object,
create a map from the object's properties.
Methods
Instances of OrderedMap
have the following methods and properties:
get
(key: string) → ?any
Retrieve the value stored under key
, or return undefined when
no such key exists.
update
(key: string, value: any, newKey: ?string) → OrderedMap
Create a new map by replacing the value of key
with a new
value, or adding a binding to the end of the map. If newKey
is
given, the key of the binding will be replaced with that key.
remove
(key: string) → OrderedMap
Return a map with the given key removed, if it existed.
addToStart
(key: string, value: any) → OrderedMap
Add a new key to the start of the map.
addToEnd
(key: string, value: any) → OrderedMap
Add a new key to the end of the map.
addBefore
(place: string, key: value: string, value: any) → OrderedMap
Add a key after the given key. If place
is not found, the new
key is added to the end.
forEach
(f: (key: string, value: any))
Call the given function for each key/value pair in the map, in
order.
prepend
(map: Object | OrderedMap) → OrderedMap
Create a new map by prepending the keys in this map that don't
appear in map
before the keys in map
.
append
(map: Object | OrderedMap) → OrderedMap
Create a new map by appending the keys in this map that don't
appear in map
after the keys in map
.
subtract
(map: Object | OrderedMap) → OrderedMap
Create a map containing all the keys in this map that don't
appear in map
.
toObject
() -> Object
Return an object that has the same key/value pairs as the map
.
size
: number
The amount of keys in this map.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 7/27 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
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 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 10 are checked with a SAST tool
Score
3.3
/10
Last Scanned on 2024-11-18
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