diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..2340abd --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,4 @@ +- repo: git://github.com/pre-commit/pre-commit-hooks + sha: '96fb7fa10f2f4c11ed33482a9ad7474251e5e97f' # Use the sha you want to point at + hooks: + - id: check-json diff --git a/jaccard.js b/jaccard.js index d1a35a8..9f1c13e 100644 --- a/jaccard.js +++ b/jaccard.js @@ -11,7 +11,7 @@ var async = require('async'); var intersection = function (a, b, c) { var x = []; var check = function (e, cb) { - if (~b.indexOf(e)) x.push(e); + if (~b.indexOf(e) && !~x.indexOf(e)) x.push(e); if (cb && typeof cb == 'function') cb(null); };