-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add phone validator #118
Conversation
packages/ember/src/utils/phone.ts
Outdated
/** A phone number with a 1-4 digit line number */ | ||
export const lineNumberInput = /^(\d{1,4})$/; | ||
|
||
/** A phone number with a 1-4 digit exchange code */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** A phone number with a 1-4 digit exchange code */ | |
/** A phone number with a 1-3 digit exchange code */ |
assert.deepEqual(result, { | ||
isValid: true, | ||
isWarning: false, | ||
message: undefined, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we wrap this in a function to aid readability and general dryness?
assertValid(validator)
, assertInvalid(validator, message)
, assertWarning(validator, message)
I find myself breaking flow to read each of the options passed to deepEqual
each time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I do that in a separate PR? That's a change I'd like to make in all the validator tests
No description provided.