Socket
Socket
Sign inDemoInstall

mnemonist

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mnemonist - npm Package Compare versions

Comparing version 0.33.1 to 0.34.0

4

CHANGELOG.md
# Changelog
## 0.34.0
* Adding `set.overlap`.
## 0.33.1

@@ -4,0 +8,0 @@

@@ -262,2 +262,4 @@ /**

*/
// TODO: can do better by improving upon static-kdtree here
KDTree.prototype.kNearestNeighbors = function(k, query) {

@@ -264,0 +266,0 @@ if (k <= 0)

3

package.json
{
"name": "mnemonist",
"version": "0.33.1",
"version": "0.34.0",
"description": "Curated collection of data structures for the JavaScript language.",

@@ -85,2 +85,3 @@ "scripts": {

"seedrandom": "^3.0.5",
"static-kdtree": "^1.0.2",
"typescript": "^3.8.2"

@@ -87,0 +88,0 @@ },

@@ -64,2 +64,3 @@ [![Build Status](https://travis-ci.org/Yomguithereal/mnemonist.svg)](https://travis-ci.org/Yomguithereal/mnemonist)

* [Static IntervalTree](https://yomguithereal.github.io/mnemonist/static-interval-tree)
* [KD-Tree](https://yomguithereal.github.io/mnemonist/kd-tree)

@@ -66,0 +67,0 @@ **Metric space indexation**

@@ -18,1 +18,2 @@ /**

export function jaccard<T>(a: Set<T>, b:Set<T>): number;
export function overlap<T>(a: Set<T>, b: Set<T>): number;

@@ -280,2 +280,3 @@ /**

* @param {Set} B - Second set.
* @return {number}
*/

@@ -316,2 +317,3 @@ exports.intersectionSize = function(A, B) {

* @param {Set} B - Second set.
* @return {number}
*/

@@ -329,2 +331,3 @@ exports.unionSize = function(A, B) {

* @param {Set} B - Second set.
* @return {number}
*/

@@ -341,1 +344,17 @@ exports.jaccard = function(A, B) {

};
/**
* Function returning the overlap coefficient between A & B.
*
* @param {Set} A - First set.
* @param {Set} B - Second set.
* @return {number}
*/
exports.overlap = function(A, B) {
var I = exports.intersectionSize(A, B);
if (I === 0)
return 0;
return I / Math.min(A.size, B.size);
};
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