File size: 546 Bytes
80ce16c | 1 2 3 4 5 6 7 8 9 10 11 12 13 | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getUpdatedSystemClockOffset = void 0;
const isClockSkewed_1 = require("./isClockSkewed");
const getUpdatedSystemClockOffset = (clockTime, currentSystemClockOffset) => {
const clockTimeInMs = Date.parse(clockTime);
if ((0, isClockSkewed_1.isClockSkewed)(clockTimeInMs, currentSystemClockOffset)) {
return clockTimeInMs - Date.now();
}
return currentSystemClockOffset;
};
exports.getUpdatedSystemClockOffset = getUpdatedSystemClockOffset;
|