bit-bin
Version:
<a href="https://opensource.org/licenses/Apache-2.0"><img alt="apache" src="https://img.shields.io/badge/License-Apache%202.0-blue.svg"></a> <a href="https://github.com/teambit/bit/blob/master/CONTRIBUTING.md"><img alt="prs" src="https://img.shields.io/b
27 lines (22 loc) • 615 B
JavaScript
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) {
// @ts-ignore AUTO-ADDED-AFTER-MIGRATION-PLEASE-FIX!
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);
});
});
}
;