@hyperfrontend/immutable-api-utils/built-in-copy/date

date

Locked, prototype-pollution-resistant copy of the global Date constructor and its statics.

The Date constructor is wrapped in a createDate factory (with all overloads preserved) and Date.now, Date.parse, and Date.UTC are captured at module-load time and frozen into a tamper-proof namespace, so timestamp work keeps producing trustworthy values even if the global Date is later patched. Effective only when imported before any untrusted code has had a chance to mutate the prototype chain.

API Reference

ƒ Functions

§function

createDate(): Date

Variables

§type

Date

(Safe copy) Namespace object containing Date factory and static methods. Note: Importing this imports all methods in this namespace (no tree-shaking).
§type

dateNow

(Safe copy) Returns the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC.
§type

dateParse

(Safe copy) Parses a string representation of a date.
§type

dateUTC

(Safe copy) Returns the number of milliseconds in a Date object since January 1, 1970 UTC.