ml-nearest-vector
Advanced tools
Comparing version 1.0.1 to 2.0.0
@@ -0,1 +1,15 @@ | ||
<a name="2.0.0"></a> | ||
# [2.0.0](https://github.com/mljs/nearest-vector/compare/v1.0.1...v2.0.0) (2018-08-15) | ||
* convert to typescript ([058976c](https://github.com/mljs/nearest-vector/commit/058976c)) | ||
### BREAKING CHANGES | ||
* two functions are now exproted, one that returns the nearest vector's | ||
index, the other the nearest vector itself | ||
<a name="1.0.1"></a> | ||
@@ -2,0 +16,0 @@ ## [1.0.1](https://github.com/mljs/nearest-vector/compare/v1.0.0...v1.0.1) (2016-10-20) |
{ | ||
"name": "ml-nearest-vector", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Find the nearest point to a sample point", | ||
@@ -11,9 +11,27 @@ "main": "./src/index.js", | ||
"scripts": { | ||
"eslint": "eslint src test", | ||
"eslint-fix": "npm run eslint -- --fix", | ||
"test": "npm run test-mocha && npm run eslint", | ||
"test-cov": "istanbul cover node_modules/.bin/_mocha -- --require should --reporter dot --recursive", | ||
"test-travis": "istanbul cover node_modules/.bin/_mocha --report lcovonly -- --require should --reporter dot --recursive", | ||
"test-mocha": "mocha --require should --reporter mocha-better-spec-reporter" | ||
"clean": "rimraf lib lib-es6", | ||
"prepublishOnly": "npm run tsc", | ||
"test": "npm run test-only && npm run tslint", | ||
"test-only": "jest", | ||
"tsc": "npm run clean && npm run tsc-es5 && npm run tsc-es6", | ||
"tsc-es5": "tsc", | ||
"tsc-es6": "tsc --project tsconfig.es6.json", | ||
"tslint": "tslint --project tsconfig.base.json", | ||
"tslint-fix": "npm run tslint -- --fix" | ||
}, | ||
"jest": { | ||
"testEnvironment": "node", | ||
"transform": { | ||
"^.+\\.tsx?$": "ts-jest" | ||
}, | ||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json", | ||
"node" | ||
] | ||
}, | ||
"repository": { | ||
@@ -41,13 +59,13 @@ "type": "git", | ||
"devDependencies": { | ||
"eslint": "^3.4.0", | ||
"eslint-config-cheminfo": "^1.2.0", | ||
"eslint-plugin-no-only-tests": "^1.1.0", | ||
"istanbul": "^0.4.4", | ||
"mocha": "^3.0.2", | ||
"mocha-better-spec-reporter": "^3.0.2", | ||
"should": "^11.1.0" | ||
"@types/jest": "^23.3.1", | ||
"jest": "^23.5.0", | ||
"rimraf": "^2.6.2", | ||
"ts-jest": "^23.1.3", | ||
"tslint": "^5.11.0", | ||
"tslint-config-prettier": "^1.14.0", | ||
"typescript": "^3.0.1" | ||
}, | ||
"dependencies": { | ||
"ml-distance-euclidean": "^1.0.0" | ||
"ml-distance-euclidean": "^2.0.0" | ||
} | ||
} |
# nearest-vector | ||
[![NPM version][npm-image]][npm-url] | ||
[![build status][travis-image]][travis-url] | ||
[![Test coverage][coveralls-image]][coveralls-url] | ||
[![David deps][david-image]][david-url] | ||
[![npm download][download-image]][download-url] | ||
[![NPM version][npm-image]][npm-url] | ||
[![build status][travis-image]][travis-url] | ||
[![Test coverage][coveralls-image]][coveralls-url] | ||
[![David deps][david-image]][david-url] | ||
[![npm download][download-image]][download-url] | ||
> Find the nearest point to a sample point | ||
@@ -22,6 +22,12 @@ | ||
```js | ||
import nearestVector, {findNearestVector} from 'ml-nearest-vector'); | ||
const nearestVector = require('ml-nearest-vector'); | ||
let centers = [[1, 2, 1], [-1, -1, -1]]; | ||
// returns the index of the nearest vector | ||
nearestVector(centers, [1, 2, 1]) === 0; | ||
// returns the nearest vector itself | ||
findNearstVector(centers, [1, 2, 1]); // [1, 2, 1] | ||
``` | ||
@@ -28,0 +34,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8214
103
48
2
+ Addedml-distance-euclidean@2.0.0(transitive)
- Removedml-distance-euclidean@1.0.0(transitive)
Updatedml-distance-euclidean@^2.0.0