From b78004b13e84314ee343f7ec5035aafcaa75fe07 Mon Sep 17 00:00:00 2001 From: Rohit Tanwar Date: Mon, 26 Feb 2018 15:01:26 +0530 Subject: [PATCH] add snippet to archive --- package-lock.json | 2 +- .../levenshteinDistance.md | 0 tag_database | 1 - .../levenshteinDistance.js | 4 ++-- test/testlog | 21 +++++++------------ 5 files changed, 10 insertions(+), 18 deletions(-) rename {snippets => snippets_archive}/levenshteinDistance.md (100%) diff --git a/package-lock.json b/package-lock.json index 7dea1534c..5d7736c68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "30-seconds-of-code", - "version": "0.0.1", + "version": "0.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/snippets/levenshteinDistance.md b/snippets_archive/levenshteinDistance.md similarity index 100% rename from snippets/levenshteinDistance.md rename to snippets_archive/levenshteinDistance.md diff --git a/tag_database b/tag_database index 4783045a3..b3aa1d07a 100644 --- a/tag_database +++ b/tag_database @@ -144,7 +144,6 @@ join:array JSONToFile:node,json last:array lcm:math,recursion -levenshteinDistance:string,utility longestItem:array,string,utility lowercaseKeys:object luhnCheck:math,utility diff --git a/test/levenshteinDistance/levenshteinDistance.js b/test/levenshteinDistance/levenshteinDistance.js index f522dd2b4..6b26dba3f 100644 --- a/test/levenshteinDistance/levenshteinDistance.js +++ b/test/levenshteinDistance/levenshteinDistance.js @@ -3,8 +3,8 @@ if(string1.length === 0) return string2.length; if(string2.length === 0) return string1.length; let matrix = Array(string2.length+ 1).fill(0).map((x,i) => [i]); matrix[0] = Array(string1.length + 1).fill(0).map((x,i) => i); -for(i = 1;i <= string2.length;i++){ -for(j = 1;j<=string1.length; j++){ +for(let i = 1;i <= string2.length;i++){ +for(let j = 1;j<=string1.length; j++){ if(string2[i-1] === string1[j-1]){ matrix[i][j] = matrix[i-1][j-1]; } diff --git a/test/testlog b/test/testlog index a8e0e2f68..3f0e6708a 100644 --- a/test/testlog +++ b/test/testlog @@ -1,4 +1,4 @@ -Test log for: Sun Feb 18 2018 20:24:43 GMT+0000 (UTC) +Test log for: Mon Feb 26 2018 15:00:57 GMT+0530 (India Standard Time) > 30-seconds-of-code@0.0.2 test R:\github\30-seconds-of-code > tape test/**/*.test.js | tap-spec @@ -538,12 +538,6 @@ Test log for: Sun Feb 18 2018 20:24:43 GMT+0000 (UTC) √ Returns own methods √ Returns own and inherited methods - Testing fuzzySearch - - √ fuzzySearch is a Function - √ Provided examples work - √ Provided examples work - Testing gcd √ gcd is a Function @@ -1529,8 +1523,8 @@ Test log for: Sun Feb 18 2018 20:24:43 GMT+0000 (UTC) Testing stableSort - ✔ stableSort is a Function - ✔ Array is properly sorted + √ stableSort is a Function + √ Array is properly sorted Testing standardDeviation @@ -1914,15 +1908,14 @@ Test log for: Sun Feb 18 2018 20:24:43 GMT+0000 (UTC) √ zipWith is a Function √ Runs the function provided √ Runs promises in series - √ Works as expecting, passing arguments properly √ Sends a GET request + √ Works as expecting, passing arguments properly √ Sends a POST request √ Works with multiple promises - - total: 974 - passing: 974 - duration: 2.9s + total: 973 + passing: 973 + duration: 3s