From 16de092e3d3f8862dd3431f420908e9755f19b62 Mon Sep 17 00:00:00 2001 From: Luis Arias Date: Wed, 10 Feb 2021 18:27:39 +0100 Subject: [PATCH 1/2] fix: :recycle: --- src/index.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/index.js b/src/index.js index a119074..3ba124e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,9 @@ -const Sim = ['Cosine', 'DiceCoefficient', 'JaccardIndex', 'Levenshtein', 'LongestCommonSubsequence', 'MetricLCS'] -const [ - Cosine, - DiceCoefficient, - JaccardIndex, - Levenshtein, - LongestCommonSubsequence, - MetricLCS -] = Sim.map(v => require(`./main/packages/${v}`)) +const Cosine = require('./main/packages/Cosine') +const DiceCoefficient = require('./main/packages/DiceCoefficient') +const JaccardIndex = require('./main/packages/JaccardIndex') +const Levenshtein = require('./main/packages/Levenshtein') +const LongestCommonSubsequence = require('./main/packages/LongestCommonSubsequence') +const MetricLCS = require('./main/packages/MetricLCS') module.exports = { cosine: new Cosine(), From 324b3bae62410676292a1323d72acaaae47948da Mon Sep 17 00:00:00 2001 From: Luis Arias Date: Wed, 10 Feb 2021 19:14:45 +0100 Subject: [PATCH 2/2] chore: Build distribution --- lib/index.js | 2 +- lib/main/packages/Cosine.js | 2 +- lib/main/packages/DiceCoefficient.js | 2 +- lib/main/packages/JaccardIndex.js | 2 +- lib/main/packages/Levenshtein.js | 2 +- lib/main/packages/LongestCommonSubsequence.js | 2 +- lib/main/packages/MetricLCS.js | 2 +- package-lock.json | 4231 +++++++++++++++++ 8 files changed, 4238 insertions(+), 7 deletions(-) create mode 100644 package-lock.json diff --git a/lib/index.js b/lib/index.js index 1886f22..a7d9f3a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1 +1 @@ -"use strict";function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function _iterableToArrayLimit(a,b){if(Symbol.iterator in Object(a)||"[object Arguments]"===Object.prototype.toString.call(a)){var c=[],d=!0,e=!1,f=void 0;try{for(var g,h=a[Symbol.iterator]();!(d=(g=h.next()).done)&&(c.push(g.value),!(b&&c.length===b));d=!0);}catch(a){e=!0,f=a}finally{try{d||null==h["return"]||h["return"]()}finally{if(e)throw f}}return c}}function _arrayWithHoles(a){if(Array.isArray(a))return a}var Sim=["Cosine","DiceCoefficient","JaccardIndex","Levenshtein","LongestCommonSubsequence","MetricLCS"],_Sim$map=Sim.map(function(a){return require("./main/packages/".concat(a))}),_Sim$map2=_slicedToArray(_Sim$map,6),Cosine=_Sim$map2[0],DiceCoefficient=_Sim$map2[1],JaccardIndex=_Sim$map2[2],Levenshtein=_Sim$map2[3],LongestCommonSubsequence=_Sim$map2[4],MetricLCS=_Sim$map2[5];module.exports={cosine:new Cosine,diceCoefficient:new DiceCoefficient,jaccardIndex:new JaccardIndex,levenshtein:new Levenshtein,lcs:new LongestCommonSubsequence,mlcs:new MetricLCS}; \ No newline at end of file +"use strict";var Cosine=require("./main/packages/Cosine"),DiceCoefficient=require("./main/packages/DiceCoefficient"),JaccardIndex=require("./main/packages/JaccardIndex"),Levenshtein=require("./main/packages/Levenshtein"),LongestCommonSubsequence=require("./main/packages/LongestCommonSubsequence"),MetricLCS=require("./main/packages/MetricLCS");module.exports={cosine:new Cosine,diceCoefficient:new DiceCoefficient,jaccardIndex:new JaccardIndex,levenshtein:new Levenshtein,lcs:new LongestCommonSubsequence,mlcs:new MetricLCS}; \ No newline at end of file diff --git a/lib/main/packages/Cosine.js b/lib/main/packages/Cosine.js index 22fb391..2749170 100644 --- a/lib/main/packages/Cosine.js +++ b/lib/main/packages/Cosine.js @@ -1 +1 @@ -"use strict";function _typeof(a){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;dd||2>e)return 0;for(var f=new Map,g=0;gd||2>e)return 0;for(var f=new Map,g=0;ga.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);ca.length)&&(b=a.length);for(var c=0,d=Array(b);c