Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
fantasy-dict
Advanced tools
A dictionary implementing the fantasy-land Monoid, Functor, Foldable and Traversable specifications.
Use this when a plain old javascript object as a map won't do, because you want to combine it with some fantasy-land compatible library like Ramda.
Apart from the fantasy-land required methods, the following methods are supported:
Dict :: { k: * } -> Dict *
Create a dictionary from a plain javascript object.
Dict.singleton :: String -> x -> Dict x
Create a dictionary with a single key,value pair.
Dict.prototype.insert :: Dict * ~> String -> x -> Dict *
Returns a new dictionary equal to the previous dictionary with the passed in key,value pair inserted.
Dict.prototype.delete :: Dict * ~> String -> Dict *
Returns a new dictionary equal to the previous dictionary with the passed in key removed.
Dict.prototype.reduceWithKey :: Dict * ~> (a -> String -> b -> a) -> a -> a
Like the normal reduce, with the difference that the reducer function is also passed the key of each dictionary entry.
Dict.prototype.mapWithKey :: Dict a ~> (String -> a -> b) -> Dict b
Like the normal reduce, with the difference that the reducer function is also passed the key of each dictionary entry.
Dict.prototype.lookup :: Dict * ~> String -> *
Returns the value in the dictionary for the given key. Returns undefined
if the passed in key is not in the dictionary.
Dict.prototype.keys :: Dict * ~> [ String ]
Returns an array containing the dictionary's keys.
Dict.prototype.values :: Dict * ~> [ * ]
Returns an array containing the dictionary's values.
Dict.prototype.toObject :: Dict * ~> { k: * }
Returns the plain old javascript object equivalent of a dictionary.
FAQs
Fantasy-land compatible dictionary.
The npm package fantasy-dict receives a total of 4 weekly downloads. As such, fantasy-dict popularity was classified as not popular.
We found that fantasy-dict 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.