UNPKG

@hpcc-js/comms

Version:
47 lines 1.63 kB
import { __extends } from "tslib"; import { StateObject } from "@hpcc-js/util"; var Resource = /** @class */ (function (_super) { __extends(Resource, _super); function Resource(wu, url) { var _this = _super.call(this) || this; _this.wu = wu; var cleanedURL = url.split("\\").join("/"); var urlParts = cleanedURL.split("/"); var matchStr = "res/" + _this.wu.Wuid + "/"; var displayPath = ""; var displayName = ""; if (cleanedURL.indexOf(matchStr) === 0) { displayPath = cleanedURL.substr(matchStr.length); displayName = urlParts[urlParts.length - 1]; } _this.set({ URL: url, DisplayName: displayName, DisplayPath: displayPath }); return _this; } Object.defineProperty(Resource.prototype, "properties", { get: function () { return this.get(); }, enumerable: false, configurable: true }); Object.defineProperty(Resource.prototype, "URL", { get: function () { return this.get("URL"); }, enumerable: false, configurable: true }); Object.defineProperty(Resource.prototype, "DisplayName", { get: function () { return this.get("DisplayName"); }, enumerable: false, configurable: true }); Object.defineProperty(Resource.prototype, "DisplayPath", { get: function () { return this.get("DisplayPath"); }, enumerable: false, configurable: true }); return Resource; }(StateObject)); export { Resource }; //# sourceMappingURL=resource.js.map