Installations
npm install @goonism/pseudomap
Releases
Unable to fetch releases
Developer
isaacs
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
14.17.5
NPM Version
6.14.14
Statistics
21 Stars
17 Commits
16 Forks
2 Watching
12 Branches
2 Contributors
Updated on 07 Mar 2023
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
284
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
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
1
pseudomap
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.
API
Most of the Map API, with the following exceptions:
- A
Map
object is not an iterator. values
,keys
, andentries
methods are not implemented, because they return iterators.- The argument to the constructor can be an Array of
[key, value]
pairs, or aMap
orPseudoMap
object. But, since iterators aren't used, passing any plain-old iterator won't initialize the map properly.
USAGE
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
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: ISC License: LICENSE:0
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
- Warn: no topLevel permission defined: .github/workflows/ci.yml:1
- Warn: no topLevel permission defined: .github/workflows/isaacs-makework.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/isaacs/pseudomap/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/isaacs/pseudomap/ci.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/isaacs-makework.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/isaacs/pseudomap/isaacs-makework.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/isaacs-makework.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/isaacs/pseudomap/isaacs-makework.yml/main?enable=pin
- Info: 0 out of 4 GitHub-owned GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
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
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
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 1 are checked with a SAST tool
Reason
11 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-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-rxrc-rgv4-jpvx
- 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-3h5v-q93c-6h6q
Score
2.5
/10
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