"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = catObject;

function _scope() {
  const data = require("../../../scope");

  _scope = function () {
    return data;
  };

  return data;
}

function catObject(hash, pretty, stringify) {
  return (0, _scope().loadScope)().then(scope => {
    return scope.getRawObject(hash).then(object => {
      if (!object) return 'object not found';
      if (stringify) return JSON.stringify(object.content.toString());
      return object.getString(pretty);
    });
  });
}