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

string-comparison

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string-comparison - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

lib/index.js

20

package.json
{
"name": "string-comparison",
"version": "1.0.0",
"description": "字符串相似度比较",
"version": "1.0.1",
"description": "A library implementing different string similarity",
"main": "./src/index.js",
"scripts": {
"test": "node ./node_modules/mocha/bin/mocha",
"lint": "eslint src"
"lint": "eslint src",
"build": "./node_modules/.bin/babel src --out-dir lib"
},

@@ -16,3 +17,3 @@ "repository": {

"strings",
"compareSimilarity",
"compare similarity",
"similarity",

@@ -24,4 +25,10 @@ "Dice's Coefficient",

"Longest Common Subsequence",
"Metric Longest Common Subsequence"
"Metric Longest Common Subsequence",
"difference",
"compare",
"comparision",
"similar",
"distance",
"match",
"sort match"
],

@@ -39,2 +46,3 @@ "author": {

"async": "^3.1.0",
"babel-preset-minify": "^0.5.1",
"mocha": "^6.2.1",

@@ -41,0 +49,0 @@ "npm-run-all": "^4.1.5"

@@ -0,23 +1,18 @@

const Sim = ['Cosine', 'DiceCoefficient', 'JaccardIndex', 'Levenshtein', 'LongestCommonSubsequence', 'MetricLCS']
const [
Cosine,
DiceCoefficient,
JaccardIndex,
Levenshtein,
LongestCommonSubsequence,
MetricLCS
] = Sim.map(v => require(`./main/packages/${v}`))
module.exports = {
cosine: require('./main/packages/Cosine'),
diceCoefficient: require('./main/packages/Cosine'),
jaccardIndex: require('./main/packages/Cosine'),
levenshtein: require('./main/packages/Cosine'),
lcs: require('./main/packages/Cosine'),
mlcs: require('./main/packages/Cosine')
}
// let S= ['Cosine', 'DiceCoefficient', 'JaccardIndex', 'Levenshtein', 'LongestCommonSubsequence', 'MetricLCS']
// let s = ['cosine',
// 'diceCoefficient',
// 'jaccardIndex',
// 'levenshtein',
// 'lcs',
// 'mlcs'
// ]
// Object.defineProperty(module.export = {}, '', {
// configurable: false,
// enumerable: true,
// get: () => require('./main/packages/Cosine')
// })
cosine: new Cosine(),
diceCoefficient: new DiceCoefficient(),
jaccardIndex: new JaccardIndex(),
levenshtein: new Levenshtein(),
lcs: new LongestCommonSubsequence(),
mlcs: new MetricLCS()
}

Sorry, the diff of this file is not supported yet

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