1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.IsLatitude = exports.isLatitude = exports.IS_LATITUDE = void 0;
|
4 | const ValidateBy_1 = require("./ValidateBy");
|
5 | const IsLatLong_1 = require("./IsLatLong");
|
6 | exports.IS_LATITUDE = 'isLatitude';
|
7 |
|
8 |
|
9 |
|
10 | function isLatitude(value) {
|
11 | return (typeof value === 'number' || typeof value === 'string') && (0, IsLatLong_1.isLatLong)(`${value},0`);
|
12 | }
|
13 | exports.isLatitude = isLatitude;
|
14 |
|
15 |
|
16 |
|
17 | function IsLatitude(validationOptions) {
|
18 | return (0, ValidateBy_1.ValidateBy)({
|
19 | name: exports.IS_LATITUDE,
|
20 | validator: {
|
21 | validate: (value, args) => isLatitude(value),
|
22 | defaultMessage: (0, ValidateBy_1.buildMessage)(eachPrefix => eachPrefix + '$property must be a latitude string or number', validationOptions),
|
23 | },
|
24 | }, validationOptions);
|
25 | }
|
26 | exports.IsLatitude = IsLatitude;
|
27 |
|
\ | No newline at end of file |