Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dice-coefficient

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dice-coefficient - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

21

cli.js
#!/usr/bin/env node
/**
* @author Titus Wormer
* @copyright 2014 Titus Wormer
* @license MIT
* @module dice-coefficient
* @fileoverview CLI for `dice-coefficient`.
*/
'use strict';
/* Dependencies. */
var pack = require('./package.json');
var dice = require('./');
/* Arguments. */
var argv = process.argv.slice(2);

@@ -40,7 +30,3 @@

/**
* Get the edit distance for a list of words.
*
* @param {Array.<string>} values
*/
/* Get the edit distance for a list of words. */
function getEditDistance(values) {

@@ -55,7 +41,2 @@ if (values.length === 2) {

/**
* Help.
*
* @return {string}
*/
function help() {

@@ -62,0 +43,0 @@ return [

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

/**
* @author Titus Wormer
* @copyright 2014 Titus Wormer
* @license MIT
* @module dice-coefficient
* @fileoverview Sørensen–Dice coefficient.
*/
'use strict';
/* Dependencies. */
var bigrams = require('n-gram').bigram;
/* Expose. */
module.exports = diceCoefficient;
/**
* Get the edit-distance according to Dice between two values.
*
* @param {*} value - First value.
* @param {*} right - Second value.
* @return {number} Edit distance.
*/
/* Get the edit-distance according to Dice between two values. */
function diceCoefficient(value, alternative) {

@@ -25,0 +9,0 @@ var left = bigrams(String(value).toLowerCase());

57

package.json
{
"name": "dice-coefficient",
"version": "1.0.0",
"version": "1.0.1",
"description": "Sørensen–Dice coefficient",

@@ -14,10 +14,2 @@ "license": "MIT",

],
"dependencies": {
"n-gram": "^0.1.2"
},
"files": [
"index.js",
"cli.js"
],
"bin": "cli.js",
"repository": "https://github.com/wooorm/dice-coefficient",

@@ -29,21 +21,22 @@ "bugs": "https://github.com/wooorm/dice-coefficient/issues",

],
"engines": {
"node": ">=0.11.0"
"bin": "cli.js",
"files": [
"index.js",
"cli.js"
],
"dependencies": {
"n-gram": "^1.0.0"
},
"devDependencies": {
"browserify": "^13.0.0",
"browserify": "^14.0.0",
"esmangle": "^1.0.0",
"execa": "^0.4.0",
"has": "^1.0.1",
"nyc": "^7.1.0",
"remark-cli": "^1.0.0",
"remark-comment-config": "^4.0.0",
"remark-github": "^5.0.0",
"remark-lint": "^4.0.0",
"remark-validate-links": "^4.0.0",
"execa": "^0.7.0",
"nyc": "^11.0.0",
"remark-cli": "^3.0.0",
"remark-preset-wooorm": "^3.0.0",
"tape": "^4.4.0",
"xo": "^0.16.0"
"xo": "^0.18.0"
},
"scripts": {
"build-md": "remark . --quiet --frail",
"build-md": "remark . -qfo",
"build-bundle": "browserify index.js -s diceCoefficient > dice-coefficient.js",

@@ -65,19 +58,15 @@ "build-mangle": "esmangle dice-coefficient.js > dice-coefficient.min.js",

"space": true,
"esnext": false,
"rules": {
"unicorn/explicit-length-check": "off"
},
"ignores": [
"dice-coefficient.js",
"dice-coefficient.min.js"
"dice-coefficient.js"
]
},
"remarkConfig": {
"output": true,
"plugins": {
"comment-config": null,
"lint": null,
"github": null,
"validate-links": null
},
"settings": {
"bullet": "*"
}
"plugins": [
"preset-wooorm"
]
}
}

@@ -18,6 +18,6 @@ # dice-coefficient [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov]

dice('abc', 'abc'); // 1
dice('abc', 'xyz'); // 0
dice('night', 'nacht'); // 0.25
dice('night', 'nacht') === dice('NiGhT', 'NACHT'); // true
dice('abc', 'abc'); //=> 1
dice('abc', 'xyz'); //=> 0
dice('night', 'nacht'); //=> 0.25
dice('night', 'nacht') === dice('NiGhT', 'NACHT'); //=> true
```

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

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