@looker/sdk-rtl
Version:
Looker SDK Runtime Library
22 lines • 1.39 kB
JavaScript
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
export class DelimArray extends Array {
constructor(items) {
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';
var prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
var suffix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
super();
this.separator = separator;
this.prefix = prefix;
this.suffix = suffix;
_defineProperty(this, "toString", () => {
return "".concat(this.prefix).concat(this.join(this.separator)).concat(this.suffix);
});
this.push(...(items || []));
}
static create() {
return Object.create(DelimArray.prototype);
}
}
//# sourceMappingURL=delimArray.js.map