UNPKG

@genexus/web-standard-functions

Version:

GeneXus JavaScript standard functions library for web generators

73 lines 1.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GxBinary = void 0; class GxBinary { constructor() { this.uri = ""; } serialize() { return this.toString(); } deserialize(x) { return GxBinary.createBinary(x); } toString() { return this.uri; } fromString(uri) { this.uri = uri; } isEmpty() { return this.uri === "" || this.uri === null; } setEmpty() { this.uri = ""; } get FileName() { var _a; const fileName = this.name ? this.name : new URL(this.uri).pathname; return (_a = fileName .split("/") .pop()) === null || _a === void 0 ? void 0 : _a.split(".")[0]; } get FileType() { var _a; const fileName = this.name ? this.name : new URL(this.uri).pathname; return (_a = fileName .split("/") .pop()) === null || _a === void 0 ? void 0 : _a.split(".")[1]; } get FileURI() { return this.uri; } set FileURI(uri) { this.uri = uri; } FromURL(uri) { this.uri = uri; } toBase64String() { console.log("toBase64String - Not implemented"); } fromBase64String(s) { console.log("fromBase64String - Not implemented"); } static create(b1) { const b2 = new GxBinary(); b2.uri = b1.uri; return b2; } static createBinary(url) { const b = new GxBinary(); b.uri = url; return b; } static createBinaryFromObject(b1) { const b = new GxBinary(); b.uri = b1["uri"]; b.name = b1["name"]; return b; } } exports.GxBinary = GxBinary; //# sourceMappingURL=gxbinary.js.map