SaltyMonkey лет назад: 5
Родитель
Сommit
4a62a947eb

+ 77 - 47
node_modules/string-similarity/README.md

@@ -1,28 +1,30 @@
-string-similarity
-=================
+# string-similarity
 
 Finds degree of similarity between two strings, based on [Dice's Coefficient](http://en.wikipedia.org/wiki/S%C3%B8rensen%E2%80%93Dice_coefficient), which is mostly better than [Levenshtein distance](http://en.wikipedia.org/wiki/Levenshtein_distance).
 
 ## Table of Contents
 
-* [Usage](#usage)
-  + [For Node.js](#for-nodejs)
-  + [For browser apps](#for-browser-apps)
-* [API](#api)
-  + [compareTwoStrings(string1, string2)](#comparetwostringsstring1-string2)
-      * [Arguments](#arguments)
-      * [Returns](#returns)
-      * [Examples](#examples)
-  + [findBestMatch(mainString, targetStrings)](#findbestmatchmainstring-targetstrings)
-      * [Arguments](#arguments-1)
-      * [Returns](#returns-1)
-      * [Examples](#examples-1)
-* [Release Notes](#release-notes)
-  + [2.0.0](#200)
-  + [3.0.0](#300)
-  + [3.0.1](#301)
-  + [4.0.1](#401)
-
+- [string-similarity](#string-similarity)
+  - [Table of Contents](#table-of-contents)
+  - [Usage](#usage)
+    - [For Node.js](#for-nodejs)
+    - [For browser apps](#for-browser-apps)
+  - [API](#api)
+    - [compareTwoStrings(string1, string2)](#comparetwostringsstring1-string2)
+      - [Arguments](#arguments)
+      - [Returns](#returns)
+      - [Examples](#examples)
+    - [findBestMatch(mainString, targetStrings)](#findbestmatchmainstring-targetstrings)
+      - [Arguments](#arguments-1)
+      - [Returns](#returns-1)
+      - [Examples](#examples-1)
+  - [Release Notes](#release-notes)
+    - [2.0.0](#200)
+    - [3.0.0](#300)
+    - [3.0.1](#301)
+    - [4.0.1](#401)
+    - [4.0.2](#402)
+    - [4.0.3](#403)
 
 ## Usage
 
@@ -37,11 +39,15 @@ npm install string-similarity --save
 In your code:
 
 ```javascript
-var stringSimilarity = require('string-similarity');
+var stringSimilarity = require("string-similarity");
 
-var similarity = stringSimilarity.compareTwoStrings('healed', 'sealed'); 
+var similarity = stringSimilarity.compareTwoStrings("healed", "sealed");
 
-var matches = stringSimilarity.findBestMatch('healed', ['edward', 'sealed', 'theatre']);
+var matches = stringSimilarity.findBestMatch("healed", [
+  "edward",
+  "sealed",
+  "theatre",
+]);
 ```
 
 #### For browser apps
@@ -69,32 +75,38 @@ The package contains two methods:
 Returns a fraction between 0 and 1, which indicates the degree of similarity between the two strings. 0 indicates completely different strings, 1 indicates identical strings. The comparison is case-sensitive.
 
 ##### Arguments
-  
+
 1. string1 (string): The first string
 2. string2 (string): The second string
-  
+
 Order does not make a difference.
-  
+
 ##### Returns
-  
+
 (number): A fraction from 0 to 1, both inclusive. Higher number indicates more similarity.
 
 ##### Examples
-  
+
 ```javascript
-stringSimilarity.compareTwoStrings('healed', 'sealed');
+stringSimilarity.compareTwoStrings("healed", "sealed");
 // → 0.8
 
-stringSimilarity.compareTwoStrings('Olive-green table for sale, in extremely good condition.', 
-  'For sale: table in very good  condition, olive green in colour.');
+stringSimilarity.compareTwoStrings(
+  "Olive-green table for sale, in extremely good condition.",
+  "For sale: table in very good  condition, olive green in colour."
+);
 // → 0.6060606060606061
 
-stringSimilarity.compareTwoStrings('Olive-green table for sale, in extremely good condition.', 
-  'For sale: green Subaru Impreza, 210,000 miles');
+stringSimilarity.compareTwoStrings(
+  "Olive-green table for sale, in extremely good condition.",
+  "For sale: green Subaru Impreza, 210,000 miles"
+);
 // → 0.2558139534883721
 
-stringSimilarity.compareTwoStrings('Olive-green table for sale, in extremely good condition.', 
-  'Wanted: mountain bike with at least 21 gears.');
+stringSimilarity.compareTwoStrings(
+  "Olive-green table for sale, in extremely good condition.",
+  "Wanted: mountain bike with at least 21 gears."
+);
 // → 0.1411764705882353
 ```
 
@@ -108,16 +120,18 @@ Compares `mainString` against each string in `targetStrings`.
 2. targetStrings (Array): Each string in this array will be matched against the main string.
 
 ##### Returns
+
 (Object): An object with a `ratings` property, which gives a similarity rating for each target string, a `bestMatch` property, which specifies which target string was most similar to the main string, and a `bestMatchIndex` property, which specifies the index of the bestMatch in the targetStrings array.
 
 ##### Examples
+
 ```javascript
 stringSimilarity.findBestMatch('Olive-green table for sale, in extremely good condition.', [
-  'For sale: green Subaru Impreza, 210,000 miles', 
-  'For sale: table in very good condition, olive green in colour.', 
+  'For sale: green Subaru Impreza, 210,000 miles',
+  'For sale: table in very good condition, olive green in colour.',
   'Wanted: mountain bike with at least 21 gears.'
 ]);
-// → 
+// →
 { ratings:
    [ { target: 'For sale: green Subaru Impreza, 210,000 miles',
        rating: 0.2558139534883721 },
@@ -128,27 +142,43 @@ stringSimilarity.findBestMatch('Olive-green table for sale, in extremely good co
   bestMatch:
    { target: 'For sale: table in very good condition, olive green in colour.',
      rating: 0.6060606060606061 },
-  bestMatchIndex: 1 
+  bestMatchIndex: 1
 }
 ```
 
 ## Release Notes
 
 ### 2.0.0
-* Removed production dependencies
-* Updated to ES6 (this breaks backward-compatibility for pre-ES6 apps)
+
+- Removed production dependencies
+- Updated to ES6 (this breaks backward-compatibility for pre-ES6 apps)
 
 ### 3.0.0
-* Performance improvement for `compareTwoStrings(..)`: now O(n) instead of O(n^2)
-* The algorithm has been tweaked slightly to disregard spaces and word boundaries. This will change the rating values slightly but not enough to make a significant difference
-* Adding a `bestMatchIndex` to the results for `findBestMatch(..)` to point to the best match in the supplied `targetStrings` array
+
+- Performance improvement for `compareTwoStrings(..)`: now O(n) instead of O(n^2)
+- The algorithm has been tweaked slightly to disregard spaces and word boundaries. This will change the rating values slightly but not enough to make a significant difference
+- Adding a `bestMatchIndex` to the results for `findBestMatch(..)` to point to the best match in the supplied `targetStrings` array
 
 ### 3.0.1
-* Refactoring: removed unused functions; used `substring` instead of `substr`
-* Updated dependencies
+
+- Refactoring: removed unused functions; used `substring` instead of `substr`
+- Updated dependencies
 
 ### 4.0.1
-* Distributing as an UMD build to be used in browsers.
+
+- Distributing as an UMD build to be used in browsers.
+
+### 4.0.2
+
+- Update dependencies to latest versions.
+
+### 4.0.3
+
+- Make compatible with IE and ES5. Also, update deps. (see [PR56](https://github.com/aceakash/string-similarity/pull/56))
+
+### 4.0.4
+
+- Simplify some conditional statements. Also, update deps. (see [PR50](https://github.com/aceakash/string-similarity/pull/50))
 
 ![Build status](https://codeship.com/projects/2aa453d0-0959-0134-8a76-4abcb29fe9b4/status?branch=master)
 [![Known Vulnerabilities](https://snyk.io/test/github/aceakash/string-similarity/badge.svg)](https://snyk.io/test/github/aceakash/string-similarity)

+ 56 - 26
node_modules/string-similarity/package.json

@@ -1,17 +1,49 @@
 {
-  "name": "string-similarity",
-  "version": "4.0.1",
-  "description": "Finds degree of similarity between strings, based on Dice's Coefficient, which is mostly better than Levenshtein distance.",
-  "main": "src/index.js",
-  "scripts": {
-    "test": "jasmine --config=src/spec/support/jasmine.json",
-    "build": "rm -rf umd && webpack-cli",
-    "prepublish": "npm test && npm run build"
+  "_from": "string-similarity@4.0.4",
+  "_id": "string-similarity@4.0.4",
+  "_inBundle": false,
+  "_integrity": "sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==",
+  "_location": "/string-similarity",
+  "_phantomChildren": {},
+  "_requested": {
+    "type": "version",
+    "registry": true,
+    "raw": "string-similarity@4.0.4",
+    "name": "string-similarity",
+    "escapedName": "string-similarity",
+    "rawSpec": "4.0.4",
+    "saveSpec": null,
+    "fetchSpec": "4.0.4"
   },
-  "repository": {
-    "type": "git",
-    "url": "git://github.com/aceakash/string-similarity.git"
+  "_requiredBy": [
+    "#USER",
+    "/"
+  ],
+  "_resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz",
+  "_shasum": "42d01ab0b34660ea8a018da8f56a3309bb8b2a5b",
+  "_spec": "string-similarity@4.0.4",
+  "_where": "D:\\!Git\\fps-manager",
+  "author": {
+    "name": "Akash Kurdekar",
+    "email": "npm@kurdekar.com",
+    "url": "http://untilfalse.com/"
+  },
+  "bugs": {
+    "url": "https://github.com/aceakash/string-similarity/issues"
+  },
+  "bundleDependencies": false,
+  "deprecated": false,
+  "description": "Finds degree of similarity between strings, based on Dice's Coefficient, which is mostly better than Levenshtein distance.",
+  "devDependencies": {
+    "jasmine": "^3.6.3",
+    "webpack": "^5.11.1",
+    "webpack-cli": "^4.3.1"
   },
+  "files": [
+    "src/index.js",
+    "umd/string-similarity.min.js"
+  ],
+  "homepage": "https://github.com/aceakash/string-similarity#readme",
   "keywords": [
     "strings",
     "similar",
@@ -25,19 +57,17 @@
     "dice",
     "levenshtein"
   ],
-  "files": [
-    "src/index.js",
-    "umd/string-similarity.min.js"
-  ],
-  "author": "Akash Kurdekar <npm@kurdekar.com> (http://untilfalse.com/)",
   "license": "ISC",
-  "devDependencies": {
-    "jasmine": "^3.4.0",
-    "webpack": "^4.41.5",
-    "webpack-cli": "^3.3.10"
-  }
-
-,"_resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.1.tgz"
-,"_integrity": "sha512-v36MJzloekKVvKAsYi6O/qpn2mIuvwEFIT9Gx3yg4spkNjXYsk7yxc37g4ZTyMVIBvt/9PZGxnqEtme8XHK+Mw=="
-,"_from": "string-similarity@4.0.1"
-}
+  "main": "src/index.js",
+  "name": "string-similarity",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/aceakash/string-similarity.git"
+  },
+  "scripts": {
+    "build": "rm -rf umd && webpack-cli",
+    "prepublish": "npm test && npm run build",
+    "test": "jasmine --config=src/spec/support/jasmine.json"
+  },
+  "version": "4.0.4"
+}

+ 6 - 9
node_modules/string-similarity/src/index.js

@@ -1,17 +1,14 @@
 module.exports = {
-	compareTwoStrings,
-	findBestMatch
+	compareTwoStrings:compareTwoStrings,
+	findBestMatch:findBestMatch
 };
 
 function compareTwoStrings(first, second) {
 	first = first.replace(/\s+/g, '')
 	second = second.replace(/\s+/g, '')
 
-	if (!first.length && !second.length) return 1;                   // if both are empty strings
-	if (!first.length || !second.length) return 0;                   // if only one is empty string
-	if (first === second) return 1;       							 // identical
-	if (first.length === 1 && second.length === 1) return 0;         // both are 1-letter strings
-	if (first.length < 2 || second.length < 2) return 0;			 // if either is a 1-letter string
+	if (first === second) return 1; // identical or empty
+	if (first.length < 2 || second.length < 2) return 0; // if either is a 0-letter or 1-letter string
 
 	let firstBigrams = new Map();
 	for (let i = 0; i < first.length - 1; i++) {
@@ -57,13 +54,13 @@ function findBestMatch(mainString, targetStrings) {
 	
 	const bestMatch = ratings[bestMatchIndex]
 	
-	return { ratings, bestMatch, bestMatchIndex };
+	return { ratings: ratings, bestMatch: bestMatch, bestMatchIndex: bestMatchIndex };
 }
 
 function areArgsValid(mainString, targetStrings) {
 	if (typeof mainString !== 'string') return false;
 	if (!Array.isArray(targetStrings)) return false;
 	if (!targetStrings.length) return false;
-	if (targetStrings.find(s => typeof s !== 'string')) return false;
+	if (targetStrings.find( function (s) { return typeof s !== 'string'})) return false;
 	return true;
 }

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
node_modules/string-similarity/umd/string-similarity.min.js


+ 3 - 3
package-lock.json

@@ -1034,9 +1034,9 @@
       "dev": true
     },
     "string-similarity": {
-      "version": "4.0.1",
-      "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.1.tgz",
-      "integrity": "sha512-v36MJzloekKVvKAsYi6O/qpn2mIuvwEFIT9Gx3yg4spkNjXYsk7yxc37g4ZTyMVIBvt/9PZGxnqEtme8XHK+Mw=="
+      "version": "4.0.4",
+      "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz",
+      "integrity": "sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ=="
     },
     "string-width": {
       "version": "4.2.0",

+ 1 - 1
package.json

@@ -19,6 +19,6 @@
   },
   "dependencies": {
     "rfdc": "^1.2.0",
-    "string-similarity": "^4.0.1"
+    "string-similarity": "^4.0.4"
   }
 }

Некоторые файлы не были показаны из-за большого количества измененных файлов