Removing measurement type enforcement
This commit is contained in:
Родитель
322c6d13a1
Коммит
79043ebdfd
|
@ -74,27 +74,6 @@ function validateMeasurements(measurements) {
|
|||
return false;
|
||||
}
|
||||
|
||||
for (const field in measurements) {
|
||||
if (typeof measurements[field] !== 'number' && typeof measurements[field] !== 'string' && !isLocation(measurements[field])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns true if a measurement is a location.
|
||||
*/
|
||||
function isLocation(measurement) {
|
||||
if (!measurement || typeof measurement !== 'object' || typeof measurement.lat !== 'number' || typeof measurement.lon !== 'number') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ('alt' in measurement && typeof measurement.alt !== 'number') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ Function. You can check the integrity of the code being deployed by verifying th
|
|||
of the `iotc-bridge-az-function.zip` file in the root of this repository matches the following:
|
||||
|
||||
```
|
||||
EAEF80420054196F05F7D36E436BA168AF5DCD7A6E31753C8A86F71607C39312
|
||||
4A3CF7179FF0B0AB6A070F596C3B8746EF1A0BA9BE51BD9952AE04047281D6DC
|
||||
```
|
||||
|
||||
# Contributing
|
||||
|
|
Двоичные данные
iotc-bridge-az-function.zip
Двоичные данные
iotc-bridge-az-function.zip
Двоичный файл не отображается.
Загрузка…
Ссылка в новой задаче