UNPKG

@looker/sdk-rtl

Version:
29 lines (28 loc) 1.52 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DelimArray = void 0; 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); } 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); } } exports.DelimArray = DelimArray; //# sourceMappingURL=delimArray.js.map