diff --git a/src/mask.class.ts b/src/mask.class.ts index 750f1d2..6c8d9e1 100644 --- a/src/mask.class.ts +++ b/src/mask.class.ts @@ -154,7 +154,7 @@ export default class Mask { // fill props needed this._props = { - masks: Array.isArray(props.masks) ? props.masks.map(m => m.toString()) : [ props.masks ], + masks: Array.isArray(props.masks) ? props.masks.map(m => m.toString()) : [ props.masks.toString() ], patterns: props.patterns ?? Mask.defaultPatterns, placeholder: props.placeholder ?? '', reverse: props.reverse ?? false, diff --git a/tests/mask.spec.ts b/tests/mask.spec.ts index 0c3c216..e2f7765 100644 --- a/tests/mask.spec.ts +++ b/tests/mask.spec.ts @@ -27,6 +27,7 @@ describe('Mask class tests', () => { test('Throw errors', () => { expect(() => new Mask({ + // @ts-ignore masks: [] })).toThrow(/mask/gim);