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

@thi.ng/distance

Package Overview
Dependencies
Maintainers
1
Versions
200
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thi.ng/distance - npm Package Compare versions

Comparing version 2.0.1 to 2.0.3

16

CHANGELOG.md

@@ -6,2 +6,18 @@ # Change Log

## [2.0.3](https://github.com/thi-ng/umbrella/compare/@thi.ng/distance@2.0.2...@thi.ng/distance@2.0.3) (2021-10-15)
**Note:** Version bump only for package @thi.ng/distance
## [2.0.2](https://github.com/thi-ng/umbrella/compare/@thi.ng/distance@2.0.1...@thi.ng/distance@2.0.2) (2021-10-15)
**Note:** Version bump only for package @thi.ng/distance
## [2.0.1](https://github.com/thi-ng/umbrella/compare/@thi.ng/distance@2.0.0...@thi.ng/distance@2.0.1) (2021-10-13)

@@ -8,0 +24,0 @@

1

eucledian.js
import { dist, dist2, dist3 } from "@thi.ng/vectors/dist";
export class Eucledian {
metric;
constructor(metric) {

@@ -5,0 +4,0 @@ this.metric = metric;

@@ -21,11 +21,2 @@ import { assert } from "@thi.ng/errors/assert";

export class KNearest {
dist;
target;
k;
sorted;
radius;
_currR;
_heap = new Heap(null, {
compare: (a, b) => b[0] - a[0],
});
constructor(dist, target, k, radius = Infinity, sorted = false) {

@@ -36,2 +27,5 @@ this.dist = dist;

this.sorted = sorted;
this._heap = new Heap(null, {
compare: (a, b) => b[0] - a[0],
});
assert(k > 0, `invalid k (must be > 0)`);

@@ -38,0 +32,0 @@ this.radius = clamp0(radius);

@@ -45,5 +45,2 @@ import { distManhattan, distManhattan2, distManhattan3, } from "@thi.ng/vectors/dist-manhattan";

export class Manhattan {
dim;
metric;
_invD;
constructor(dim, metric) {

@@ -50,0 +47,0 @@ this.dim = dim;

@@ -12,7 +12,2 @@ import { clamp0 } from "@thi.ng/math/interval";

export class Nearest {
dist;
target;
radius;
_currR;
value;
constructor(dist, target, radius = Infinity) {

@@ -19,0 +14,0 @@ this.dist = dist;

{
"name": "@thi.ng/distance",
"version": "2.0.1",
"version": "2.0.3",
"description": "N-dimensional distance metrics & K-nearest neighborhoods for point queries",

@@ -37,11 +37,11 @@ "type": "module",

"dependencies": {
"@thi.ng/api": "^8.0.1",
"@thi.ng/checks": "^3.0.1",
"@thi.ng/errors": "^2.0.1",
"@thi.ng/heaps": "^2.0.1",
"@thi.ng/math": "^5.0.1",
"@thi.ng/vectors": "^7.0.1"
"@thi.ng/api": "^8.0.3",
"@thi.ng/checks": "^3.0.3",
"@thi.ng/errors": "^2.0.3",
"@thi.ng/heaps": "^2.0.3",
"@thi.ng/math": "^5.0.3",
"@thi.ng/vectors": "^7.0.3"
},
"devDependencies": {
"@thi.ng/testament": "^0.1.1"
"@thi.ng/testament": "^0.1.3"
},

@@ -108,3 +108,3 @@ "keywords": [

},
"gitHead": "2e6b3d7c0f4c5686c1e9bdb4902ed7d3f90bcc19"
"gitHead": "1fb38cac74d6c009d96855c28784a267a81badf1"
}

@@ -32,3 +32,3 @@ <!-- This file is generated - DO NOT EDIT! -->

The package provides the
[`IDistance`](https://github.com/thi-ng/umbrella/blob/develop/packages/distance/src/api.ts)
[`IDistance`](https://docs.thi.ng/umbrella/distance/interfaces/IDistance.html)
interface for custom distance metric implementations & conversions from/to raw

@@ -62,3 +62,3 @@ distance values. The following preset metrics are provided too:

Custom neighborhood selections can be defined via the
[`INeighborhood`](https://github.com/thi-ng/umbrella/blob/develop/packages/distance/src/api.ts)
[`INeighborhood`](https://docs.thi.ng/umbrella/distance/interfaces/INeighborhood.html)
interface. Currently, there are two different implementations available, each

@@ -124,3 +124,3 @@ providing several factory functions to instantiate and provide defaults for

Package sizes (gzipped, pre-treeshake): ESM: 1.16 KB
Package sizes (gzipped, pre-treeshake): ESM: 1.13 KB

@@ -127,0 +127,0 @@ ## Dependencies

import { distSq, distSq2, distSq3 } from "@thi.ng/vectors/distsq";
export class Squared {
metric;
constructor(metric) {

@@ -5,0 +4,0 @@ this.metric = metric;

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