UNPKG

@ethersphere/bee-js

Version:
18 lines (17 loc) 537 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ResourceLocator = void 0; const cafe_utility_1 = require("cafe-utility"); const typed_bytes_1 = require("./typed-bytes"); class ResourceLocator { constructor(raw) { this.raw = raw; } toString() { if (cafe_utility_1.Types.isString(this.raw) && this.raw.includes('.eth')) { return this.raw; } return new typed_bytes_1.Reference(this.raw).toHex(); } } exports.ResourceLocator = ResourceLocator;