UNPKG

jscpd

Version:

Copy/paste detector for programming code, support JavaScript, CoffeeScript, PHP, Ruby, Python, Less, Go, Java, Yaml, C#, C++, C languages

35 lines (26 loc) 856 B
// Generated by CoffeeScript 1.10.0 (function() { var StorageMemory; StorageMemory = (function() { function StorageMemory() { this.codeHashes = {}; } StorageMemory.prototype.addHash = function(hash, file, line, language) { var ref; this.codeHashes[language] = (ref = this.codeHashes[language]) != null ? ref : {}; return this.codeHashes[language][hash] = { line: line, file: file }; }; StorageMemory.prototype.hasHash = function(hash, language) { return this.codeHashes[language] && hash in this.codeHashes[language]; }; StorageMemory.prototype.getHash = function(hash, language) { var ref; return (ref = this.codeHashes[language]) != null ? ref[hash] : void 0; }; return StorageMemory; })(); module.exports = StorageMemory; }).call(this);