{"size": 1505, "ext": "js", "max_stars_repo_path": "lib/index.js", "max_stars_repo_name": "pandastrike/message", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/index.js", "max_issues_repo_name": "pandastrike/message", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/index.js", "max_forks_repo_name": "pandastrike/message", "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": 26.875, "max_line_length": 262, "alphanum_fraction": 0.5787375415}
// Generated by CoffeeScript 1.10.0
(function() {
  var YAML, _abort, abort, apply, async, binary, curry, deref, flip, identity, join, map, pipe, property, read, reduce, ref, splat, split, t,
    slice = [].slice;

  join = require("path").join;

  YAML = require("js-yaml");

  ref = require("fairmont"), async = ref.async, read = ref.read, abort = ref.abort, curry = ref.curry, binary = ref.binary, flip = ref.flip, property = ref.property, reduce = ref.reduce, apply = ref.apply, pipe = ref.pipe, map = ref.map, identity = ref.identity;

  t = function(k, d) {
    return (require("markup-js")).up(k, d);
  };

  split = curry(function(d, s) {
    return s.split(d);
  });

  splat = function(f) {
    return function() {
      var args;
      args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
      return f(args);
    };
  };

  deref = curry(binary(flip(splat(reduce(apply, pipe(split("."), map(property), reduce(pipe, identity)))))));

  _abort = abort;

  module.exports = async(function*(path) {
    var lookup, message, messages;
    messages = YAML.safeLoad((yield read(path)));
    lookup = deref(messages);
    message = function(key, data) {
      if (data == null) {
        data = {};
      }
      return t(lookup(key), data);
    };
    abort = function(key, data) {
      if (data == null) {
        data = {};
      }
      return _abort(message(key, data));
    };
    return {
      lookup: lookup,
      message: message,
      abort: abort
    };
  });

}).call(this);
