
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
OrderedDict is a data structure that preservers order of inserted keys. And is a sub-class of a regular object/dictionary. In addition it provides couple of convenient methods to push elements to start or end of a dict.
As an example: this data structure can be used to implement LRU-cache.
let OrderedDict = require("adict");
let dict = new OrderedDict();
dict.set(1, 2);
OrderedDict is a data structure that preservers order of inserted keys. And is a sub-class of a regular object/dictionary. Implementation is inspired by python's OrderedDict and this particular gist: https://gist.github.com/joequery/12332f410a05e6c7c949
Kind: class
let dict = new OrderedDict();
OrderedDict
boolean
undefined
any
| undefined
boolean
undefined
| any
undefined
| any
boolean
boolean
Iterator
Iterator
Iterator
OrderedDict
Add a new key-value pair to an ordered dict.
Kind: instance method of OrderedDict
Param | Type |
---|---|
key | string | number |
value | any |
boolean
Delete a key from an ordered dict.
Kind: instance method of OrderedDict
Param | Type |
---|---|
key | string | number |
undefined
Clear ordered dict.
Kind: instance method of OrderedDict
any
| undefined
Retrieve a key from an ordered dict.
Kind: instance method of OrderedDict
Param | Type |
---|---|
key | string | number |
boolean
Check if key exists in an ordered dict.
Kind: instance method of OrderedDict
Param | Type |
---|---|
key | string | number |
undefined
| any
Remove and return last element from an ordered dict.
Kind: instance method of OrderedDict
undefined
| any
Remove and return first element from an ordered dict.
Kind: instance method of OrderedDict
boolean
Move an existing element to the start of an ordered dict.
Kind: instance method of OrderedDict
Param | Type |
---|---|
key | string | number |
boolean
Move an existing element to the end of an ordered dict.
Kind: instance method of OrderedDict
Param | Type |
---|---|
key | string | number |
Iterator
Returns new Iterator object that contains all keys of an ordered dict.
Kind: instance method of OrderedDict
Iterator
Returns new Iterator object that contains all values of an ordered dict.
Kind: instance method of OrderedDict
Iterator
Returns new Iterator object that contains all key-value pairs of an ordered dict.
Kind: instance method of OrderedDict
Object
Kind: global typedef Properties
Name | Type |
---|---|
value | any |
prev | LinkedListNode | null |
next | LinkedListNode | null |
FAQs
Implementation of an OrderedDict data structure.
The npm package adict receives a total of 6 weekly downloads. As such, adict popularity was classified as not popular.
We found that adict demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.