UNPKG

fitbit-api-client

Version:
20 lines 951 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WeightResponseFromJson = WeightResponseFromJson; const date_utils_1 = require("../../utils/date.utils"); const types_utils_1 = require("../../utils/types.utils"); function WeightResponseFromJson(offsetFromUTCMillis, json) { return { weightLogs: (0, types_utils_1.get)(json, 'weight').map((data) => WeightLogFromJson(offsetFromUTCMillis, data)), }; } function WeightLogFromJson(offsetFromUTCMillis, json) { return { dateTime: (0, date_utils_1.convertToOffsetDate)(new Date(`${(0, types_utils_1.get)(json, 'date')}T${(0, types_utils_1.get)(json, 'time')}Z`), offsetFromUTCMillis), weight: (0, types_utils_1.get)(json, 'weight'), logId: (0, types_utils_1.get)(json, 'logId'), source: (0, types_utils_1.get)(json, 'source'), bmi: (0, types_utils_1.get)(json, 'bmi'), }; } //# sourceMappingURL=weight.js.map