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

fix: switch isLatitude & isLongitude validators #537

Merged
merged 1 commit into from Mar 26, 2020

Conversation

zesani
Copy link
Contributor

@zesani zesani commented Mar 1, 2020

Validatorjs check if the string is a valid latitude-longitude coordinate in the format lat,long or lat, long.

Ref: https://github.com/validatorjs/validator.js

check if the string is a valid latitude-longitude coordinate in the format lat,long or lat, long.
@johannesschobel
Copy link

this may be fixed if #513 will be implemented? can you check please? @zesani

@vlapo
Copy link
Contributor

vlapo commented Mar 25, 2020

#502 looks like we have wrong type, too:

export function IsLatitude(validationOptions?: ValidationOptions): PropertyDecorator {
    return function (object: Object, propertyName: string) {
        const args: ValidationMetadataArgs = {
            type: ValidationTypes.IS_LONGITUDE,
            target: object.constructor,
            propertyName: propertyName,
            validationOptions: validationOptions
        };
        getMetadataStorage().addValidationMetadata(new ValidationMetadata(args));
    };
}

@zesani could you also fix that and update tests? We should cover edge cases.

@vlapo vlapo changed the title Fix isLatitude & isLongitude fix: switch isLatitude & isLongitude validators Mar 26, 2020
@vlapo vlapo merged commit c27500b into typestack:master Mar 26, 2020
@vlapo
Copy link
Contributor

vlapo commented Mar 26, 2020

Thank you!

@github-actions
Copy link

github-actions bot commented Aug 3, 2020

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants