megahash
megahash copied to clipboard
ES6 Map compatibility
@jhuckaby Would you accept a PR which makes the megahash interface compatible with ES6 Map? If so, what would be your preferred option? E.g. Using class inheritance like:
const MegaHash = require('./main.js')
class Map extends MegaHash {
get size () {
return this.length()
}
* keys () {
let key
while (1) {
key = this.nextKey(key)
if (key === undefined) break
yield key
}
return key
}
//...
}
module.exports = Map
or adding the prototypes in main.js
?
Hello! Yes, that would be awesome. I would prefer that it be a separate subclass (possibly called MegaMap
?) which inherits from MegaHash.