
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@types/skmeans
Advanced tools
npm install --save @types/skmeans
This package contains type definitions for skmeans (https://github.com/solzimer/skmeans).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/skmeans.
// Type definitions for skmeans 0.11
// Project: https://github.com/solzimer/skmeans
// Definitions by: Adam Zerella <https://github.com/adamzerella>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
type CentroidValues = number[] | number[][] | 'kmrand' | 'kmpp' | null;
interface Data {
it: number;
k: number;
centroids: number[] | number[][];
idxs: number[];
test: (x: number, point?: (x1: number, x2: number) => number) => void;
}
/**
* Calculates unidimiensional and multidimensional k-means clustering on data.
*
* @param data Unidimiensional or multidimensional array of values to be clustered.
* @param k Number of clusters.
* @param centroids Initial centroid values.
* @param iterations Maximum number of iterations. If not provided, it will be set to 10000.
* @param distance Custom distance function. Takes two points as arguments and returns a scalar number.
*/
declare function skmeans(
data: number[] | number[][],
k: number,
centroids?: CentroidValues,
iterations?: number | null,
distance?: (x: number, y: number) => number
): Data;
export = skmeans;
These definitions were written by Adam Zerella.
FAQs
TypeScript definitions for skmeans
The npm package @types/skmeans receives a total of 4,151 weekly downloads. As such, @types/skmeans popularity was classified as popular.
We found that @types/skmeans 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
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.