New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

filter-map

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filter-map - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

35

package.json
{
"name": "filter-map",
"version": "1.0.0",
"description": "A filter function for Maps.",
"version": "2.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "node test"
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/matthewlucock/filter-map.git"
"url": "git+https://github.com/npm/deprecate-holder.git"
},
"author": {
"name": "Matt Lucock",
"email": "matthewlucock@icloud.com",
"url": "https://github.com/matthewlucock"
},
"license": "MIT",
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/matthewlucock/filter-map/issues"
"url": "https://github.com/npm/deprecate-holder/issues"
},
"homepage": "https://github.com/matthewlucock/filter-map",
"keywords": [
"map",
"maps",
"filter",
"filtering",
"keys",
"values",
"collection",
"es6"
],
"devDependencies": {
"chai": "^3.5.0",
"eslint": "^3.14.0",
"mocha": "^3.2.0"
}
"homepage": "https://github.com/npm/deprecate-holder#readme"
}

@@ -1,28 +0,5 @@

# filter-map
# Deprecated Package
[![npm](https://img.shields.io/npm/v/filter-map.svg)](https://www.npmjs.com/package/filter-map) [![npm](https://img.shields.io/npm/l/filter-map.svg)](https://opensource.org/licenses/MIT) [![Build Status](https://travis-ci.org/matthewlucock/filter-map.svg?branch=master)](https://travis-ci.org/matthewlucock/filter-map)
This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.
A filter function for JavaScript [Maps](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Map). Constructs a new Map with every key-value pair from the given map that satisfies a given function.
You can get it with `npm i filter-map`.
```javascript
const filterMap = require("filter-map");
const exampleMap = new Map([
["a", 1],
["b", 2],
["c", 3],
["d", 4]
]);
// Filter even-numbered values out of the Map.
const filteredMap = filterMap(exampleMap, (key, value) => value % 2);
filteredMap.has("a"); // true
filteredMap.has("b"); // false
filteredMap.has("c"); // true
filteredMap.has("d"); // false
```
`filterMap` takes a Map and a filtering function, and returns the newly constructed Map. The filtering function takes a key and a value, and can return any value, which is then casted to a Boolean to determine whether to filter the key-value pair.
Please contact support@npmjs.com if you have questions about this package.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc