Skip to content

Commit

Permalink
masks array with one string required
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermeasn committed Jan 8, 2024
1 parent 9cf8699 commit 802c14a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/mask.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions tests/mask.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('Mask class tests', () => {
test('Throw errors', () => {

expect(() => new Mask({
// @ts-ignore
masks: []
})).toThrow(/mask/gim);

Expand Down

0 comments on commit 802c14a

Please sign in to comment.