UNPKG

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

61 lines (45 loc) 1.06 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; function _defineProperty2() { const data = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); _defineProperty2 = function () { return data; }; return data; } function _object() { const data = _interopRequireDefault(require("../objects/object")); _object = function () { return data; }; return data; } // TODO: fix .parse // @ts-ignore class Source extends _object().default { constructor(contents) { super(); (0, _defineProperty2().default)(this, "contents", void 0); this.contents = contents; } id() { return this.contents; } toBuffer() { return this.contents; } toString() { return this.contents.toString(); } static parse(contents) { return new Source(contents); } static from(buffer) { return new Source(buffer); } } exports.default = Source;