{"size": 881, "ext": "js", "max_stars_repo_path": "web/js/WebStorage/PartUsedService.js", "max_stars_repo_name": "davethemac/roaming-repairs", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "web/js/WebStorage/PartUsedService.js", "max_issues_repo_name": "davethemac/roaming-repairs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "web/js/WebStorage/PartUsedService.js", "max_forks_repo_name": "davethemac/roaming-repairs", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.9117647059, "max_line_length": 85, "alphanum_fraction": 0.6049943246}
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

var WebStoragePartUsedService = function(key){

    WebStoragePartUsedService.prototype = Object.create(WebStorageService.prototype);

    WebStorageService.call(this, key);

    this.findByKey = function(keyName, id) {
        var deferred = $.Deferred(),
            items = JSON.parse(window.localStorage.getItem(this.key)),
            results = [],
            l = items.length;

        for (var i = 0; i < l; i++) {
            if (items[i][keyName] === id) {
                results.push(items[i]);
                break;
            }
        }

        deferred.resolve(results);
        return deferred.promise();

    };

};

//WebStoragePartUsedService.inherits(WebStorageService);
