Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
ECMAScript Map
like class.
It has same API with Map - JavaScript | MDN.
It is tiny library - 1.5kB(gzip).
✈ bundle-size map-like
map-like@1.0.3
env bundle minify gzip
-- 5.73 kB 3.08 kB 1.5 kB
Symbol.Iterator
- it means MapLike
is not iterable.toString()
Install with npm:
npm install map-like
const { MapLike } = require("map-like");
const map = new MapLike(["key", "value"]);
const value = map.get("key");
map.set("newKey", "newValue");
MapLike
ES6 Map like object. See Map - JavaScript | MDN
size
return map size
Returns: Number
entries(): Array
entries [[key, value], [key, value]] value
Returns: Array
keys(): Array
get keys
Returns: Array
values(): Array
get values
Returns: Array
get(key: Any): Any
Parameters
key
: Any - The key of the element to return from the Map object.Returns: Any
has(key: Any): boolean
has value of key
Parameters
key
: Any - The key of the element to return from the Map object.Returns: boolean
set(key: Any, value: Any): MapLike
set value for key
Parameters
key
: Any - The key of the element to return from the Map object.value
: AnyReturns: MapLike
delete(key: Any): boolean
delete value for key
Parameters
key
: Any - The key of the element to return from the Map object.Returns: boolean
clear(): MapLike
clear defined key,value
Returns: MapLike
forEach(handler: function (value, key, map), thisArg: [Any])
forEach map
Parameters
handler
: function (value, key, map)thisArg
: [Any]See Releases page.
Install devDependencies and Run npm test
:
npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © azu
Test MapLike
with test-case of https://github.com/Financial-Times/polyfill-service/blob/master/polyfills/Map/tests.js.
FAQs
ECMAScript Map like object.
We found that map-like 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.