diff --git a/packages/sdk-rtl/src/delimArray.spec.ts b/packages/sdk-rtl/src/delimArray.spec.ts index f2a03ed83..e87ea1fcf 100644 --- a/packages/sdk-rtl/src/delimArray.spec.ts +++ b/packages/sdk-rtl/src/delimArray.spec.ts @@ -47,6 +47,19 @@ describe('DelimArray', () => { expect(actual).toEqual('{1 2 3 4}') }) + it('integer', () => { + const numbers = [2] + let values = new DelimArray(numbers) + const expected = '2' + let actual = values.toString() + const normal = `${numbers}` + expect(normal).toEqual(expected) + expect(actual).toEqual(expected) + values = new DelimArray(numbers, ' ', '{', '}') + actual = values.toString() + expect(actual).toEqual('{2}') + }) + it('strings', () => { const strings = ['a', 'b', 'c', 'd'] let values = new DelimArray(strings) diff --git a/packages/sdk-rtl/src/delimArray.ts b/packages/sdk-rtl/src/delimArray.ts index c5a76833a..8f0824276 100644 --- a/packages/sdk-rtl/src/delimArray.ts +++ b/packages/sdk-rtl/src/delimArray.ts @@ -31,7 +31,8 @@ export class DelimArray extends Array { public prefix: string = '', public suffix: string = '' ) { - super(...(items || [])) + super() + this.push(...(items || [])) } static create(): DelimArray {