Skip to content
Prev Previous commit
Next Next commit
Update packages/rrweb/src/utils.ts
Fix typing issue with regex against `Date.now()`

Co-authored-by: Justin Halsall <[email protected]>
  • Loading branch information
eoghanmurray and Juice10 committed Apr 13, 2023
commit d3b67af85702355ebaaedce8905bca4bb04dd2a0
2 changes: 1 addition & 1 deletion packages/rrweb/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function patch(
// guard against old third party libraries which redefine Date.now
let nowTimestamp = Date.now;

if (!(/*@__PURE__*/ /[1-9][0-9]{12}/.test(Date.now()))) {
if (!(/*@__PURE__*/ /[1-9][0-9]{12}/.test(Date.now().toString()))) {
// they have already redefined it! use a fallback
nowTimestamp = () => new Date().getTime();
}
Expand Down