@aws-amplify/core
Version:
Core category of aws-amplify
1 lines • 1.16 kB
Source Map (JSON)
{"version":3,"file":"getUpdatedSystemClockOffset.mjs","sources":["../../../../../../src/clients/middleware/signing/utils/getUpdatedSystemClockOffset.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { isClockSkewed } from './isClockSkewed';\n/**\n * Returns the difference between clock time and the current system time if clock is skewed.\n *\n * @param clockTimeInMilliseconds Clock time in milliseconds.\n * @param currentSystemClockOffset Current system clock offset in milliseconds.\n *\n * @internal\n */\nexport const getUpdatedSystemClockOffset = (clockTimeInMilliseconds, currentSystemClockOffset) => {\n if (isClockSkewed(clockTimeInMilliseconds, currentSystemClockOffset)) {\n return clockTimeInMilliseconds - Date.now();\n }\n return currentSystemClockOffset;\n};\n"],"names":[],"mappings":";;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,2BAA2B,GAAG,CAAC,uBAAuB,EAAE,wBAAwB,KAAK;AAClG,IAAI,IAAI,aAAa,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,EAAE;AAC1E,QAAQ,OAAO,uBAAuB,GAAG,IAAI,CAAC,GAAG,EAAE;AACnD,IAAI;AACJ,IAAI,OAAO,wBAAwB;AACnC;;;;"}