Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "hasharray", | ||
"author": "Joshua Jung <joshua.p.jung@gmail.com>", | ||
"license": "MIT", | ||
"description": "A data structure that combines a hash and an array for CRUD operations by object keys or index.", | ||
"version": "0.1.3", | ||
"main": "index.js", | ||
"url": "https://github.com/joshjung/hash-array", | ||
"homepage": "https://github.com/joshjung/hash-array", | ||
"email": "joshua.p.jung@gmail.com", | ||
"dependencies": { | ||
"debug": "^1.0.4" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/joshjung/hash-array.git" | ||
}, | ||
"keywords": [ | ||
"hash", | ||
"hashtable", | ||
"array", | ||
"arraylist", | ||
"dictionary" | ||
] | ||
} | ||
"name": "hasharray", | ||
"author": "Joshua Jung <joshua.p.jung@gmail.com>", | ||
"license": "MIT", | ||
"description": "A data structure that combines a hash and an array for CRUD operations by object keys or index.", | ||
"version": "0.1.4", | ||
"main": "index.js", | ||
"url": "https://github.com/joshjung/hash-array", | ||
"homepage": "https://github.com/joshjung/hash-array", | ||
"email": "joshua.p.jung@gmail.com", | ||
"dependencies": { | ||
"debug": "^1.0.4", | ||
"jclass": "^0.2.5" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/joshjung/hash-array.git" | ||
}, | ||
"keywords": [ | ||
"hash", | ||
"hashtable", | ||
"array", | ||
"arraylist", | ||
"dictionary" | ||
] | ||
} |
@@ -1,20 +0,15 @@ | ||
var HashArray = function(keyFields, callback) { | ||
this._map = {}; | ||
this._list = []; | ||
this.callback = callback; | ||
var JClass = require('jclass'); | ||
this.keyFields = keyFields; | ||
var HashArray = JClass.extend({ | ||
init: function(keyFields, callback) { | ||
this._map = {}; | ||
this._list = []; | ||
this.callback = callback; | ||
if (callback) { | ||
callback('construct'); | ||
} | ||
}; | ||
this.keyFields = keyFields; | ||
HashArray.prototype = { | ||
get all() { | ||
return this._list; | ||
if (callback) { | ||
callback('construct'); | ||
} | ||
}, | ||
get map() { | ||
return this._map; | ||
}, | ||
add: function() { | ||
@@ -142,4 +137,16 @@ for (var i = 0; i < arguments.length; i++) { | ||
} | ||
}; | ||
}); | ||
Object.defineProperty(HashArray.prototype, 'all', { | ||
get: function () { | ||
return this._list; | ||
} | ||
}); | ||
Object.defineProperty(HashArray.prototype, 'map', { | ||
get: function () { | ||
return this._map; | ||
} | ||
}); | ||
module.exports = HashArray; | ||
@@ -146,0 +153,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17542
431
2
+ Addedjclass@^0.2.5
+ Addedjclass@0.2.5(transitive)