'use strict';

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

var _scope;

function _load_scope() {
  return _scope = require('../../../scope');
}

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