{"size": 881, "ext": "js", "max_stars_repo_path": "lib/Promisifier.js", "max_stars_repo_name": "umbra-test/umbra-example", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/Promisifier.js", "max_issues_repo_name": "umbra-test/umbra-example", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/Promisifier.js", "max_forks_repo_name": "umbra-test/umbra-example", "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": 29.3666666667, "max_line_length": 62, "alphanum_fraction": 0.3632236095}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class Promisifier {
    wrap(fn) {
        return (results) => {
            if (fn.length === 2) {
                return new Promise((resolve, reject) => {
                    fn(results, (result) => {
                        if (result instanceof Error) {
                            reject(result);
                        }
                        else {
                            resolve(result);
                        }
                    });
                });
            }
            else {
                try {
                    return Promise.resolve(fn(results));
                }
                catch (e) {
                    return Promise.reject(e);
                }
            }
        };
    }
}
exports.Promisifier = Promisifier;
//# sourceMappingURL=Promisifier.js.map