Gathering detailed insights and metrics for @goonism/pseudomap
Gathering detailed insights and metrics for @goonism/pseudomap
Gathering detailed insights and metrics for @goonism/pseudomap
Gathering detailed insights and metrics for @goonism/pseudomap
npm install @goonism/pseudomap
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
21 Stars
17 Commits
16 Forks
2 Watching
12 Branches
2 Contributors
Updated on 07 Mar 2023
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
0%
1
Compared to previous day
Last week
0%
1
Compared to previous week
Last month
20%
6
Compared to previous month
Last year
-31.8%
58
Compared to previous year
1
A thing that is a lot like ES6 Map
, but without iterators, for use
in environments where for..of
syntax and Map
are not available.
If you need iterators, or just in general a more faithful polyfill to ES6 Maps, check out es6-map.
If you are in an environment where Map
is supported, then that will
be returned instead, unless process.env.TEST_PSEUDOMAP
is set.
You can use any value as keys, and any value as data. Setting again with the identical key will overwrite the previous value.
Internally, data is stored on an Object.create(null)
style object.
The key is coerced to a string to generate the key on the internal
data-bag object. The original key used is stored along with the data.
In the event of a stringified-key collision, a new key is generated by appending an increasing number to the stringified-key until finding either the intended key or an empty spot.
Note that because object traversal order of plain objects is not
guaranteed to be identical to insertion order, the insertion order
guarantee of Map.prototype.forEach
is not guaranteed in this
implementation. However, in all versions of Node.js and V8 where this
module works, forEach
does traverse data in insertion order.
Most of the Map API, with the following exceptions:
Map
object is not an iterator.values
, keys
, and entries
methods are not implemented,
because they return iterators.[key, value]
pairs, or a Map
or PseudoMap
object. But, since iterators
aren't used, passing any plain-old iterator won't initialize the
map properly.Use just like a regular ES6 Map.
1var PseudoMap = require('pseudomap') 2 3// optionally provide a pseudomap, or an array of [key,value] pairs 4// as the argument to initialize the map with 5var myMap = new PseudoMap() 6 7myMap.set(1, 'number 1') 8myMap.set('1', 'string 1') 9var akey = {} 10var bkey = {} 11myMap.set(akey, { some: 'data' }) 12myMap.set(bkey, { some: 'other data' })
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/17 approved changesets -- score normalized to 0
Reason
0 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
dependency not pinned by hash detected -- score normalized to 0
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
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
11 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
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