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