Comparing version 0.3.2 to 0.3.3
var minimatch = require('minimatch'); | ||
var oid = require('oid'); | ||
@@ -10,5 +9,16 @@ var MinimatchTree = function() { | ||
var getHash = function (data) { | ||
let symbols = Object.getOwnPropertySymbols(data); | ||
if (symbols.length === 0) { | ||
let symbol = Symbol(); | ||
data[symbol] = '__minimagicSymbol'; | ||
return symbol; | ||
} else { | ||
return symbols[0]; | ||
} | ||
} | ||
MinimatchTree.prototype.add = function (glob, data) { | ||
var globRoot = this._getGlobRoot(glob); | ||
var hash = oid.hash(data); | ||
var hash = getHash(data); | ||
var isNegation = this._isNegation(glob); | ||
@@ -69,3 +79,3 @@ if (isNegation) { | ||
var globRoot = this._getGlobRoot(glob); | ||
var hash = oid.hash(data); | ||
var hash = getHash(data); | ||
@@ -72,0 +82,0 @@ var matches = globRoot === glob ? this._exactMatches[glob] : this._rootData[globRoot]; |
{ | ||
"name": "minimagic", | ||
"description": "fast minimatching", | ||
"version": "0.3.2", | ||
"version": "0.3.3", | ||
"homepage": "https://github.com/azulus/minimagic", | ||
@@ -12,2 +12,3 @@ "authors": [ | ||
"main": "./MinimatchTree.js", | ||
"license": "MIT", | ||
"repository": { | ||
@@ -18,3 +19,2 @@ "type": "git", | ||
"dependencies": { | ||
"oid": "1.2.0", | ||
"minimatch": "0.2" | ||
@@ -21,0 +21,0 @@ }, |
10173
1
3
237
- Removedoid@1.2.0
- Removednan@2.22.0(transitive)
- Removedoid@1.2.0(transitive)