Skip to content
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

PostalCode.IT.rawValue returns wrong value #27

Closed
Neirys opened this issue Nov 17, 2020 · 3 comments
Closed

PostalCode.IT.rawValue returns wrong value #27

Neirys opened this issue Nov 17, 2020 · 3 comments

Comments

@Neirys
Copy link

Neirys commented Nov 17, 2020

case DE, EE, ES, FI, IT, KE, LT, MX, SA, UA = "\\d{5}"

(lldb) po PostalCode.IT.rawValue
"IT"
(lldb) po PostalCode.UA.rawValue
"\\d{5}"
@gkaimakas
Copy link
Owner

Hello @Neirys ,

Thanks for opening this issue. Can you be more specific on what is the expected result and what you are getting?

@Neirys
Copy link
Author

Neirys commented Nov 17, 2020

Hello @gkaimakas,
PostalCode regex won't work correctly because PostalCode.IT.rawValue returns IT whereas it should returns "\\d{5}"

It happens here :

public static func isPostalCode(_ countryCode: PostalCode, nilResponse: Bool = false) -> Validator {
    return regex(countryCode.rawValue, nilResponse: nilResponse)
}

@gkaimakas
Copy link
Owner

Thank you @Neirys.

9.0.3 should fix this. It should be available on SPM and CocoaPods soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants