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

console

Locked, prototype-pollution-resistant copies of the global console methods, pre-bound to the original console object.

log, warn, error, info, debug, trace, dir, table, assert, group*, time*, and the rest of the console surface are captured (and .bind()-ed) at module-load time and frozen into a tamper-proof namespace, so diagnostic output keeps reaching the real console even if globalThis.console is later patched. Effective only when imported before any untrusted code has had a chance to mutate the prototype chain.

API Reference

Variables

§type

assert

(Safe copy) Writes an error message to the console if the assertion is false.
§type

clear

(Safe copy) Clears the console.
§type

Console

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

count

(Safe copy) Logs the number of times that this particular call to count() has been called.
§type

countReset

(Safe copy) Resets the counter used with console.count().
§type

debug

(Safe copy) Outputs a debug message to the console.
§type

dir

(Safe copy) Displays an interactive listing of the properties of a specified object.
§type

error

(Safe copy) Outputs an error message to the console.
§type

group

(Safe copy) Creates a new inline group in the console.
§type

groupCollapsed

(Safe copy) Creates a new inline group in the console that is initially collapsed.
§type

groupEnd

(Safe copy) Exits the current inline group.
§type

info

(Safe copy) Outputs an informational message to the console.
§type

log

(Safe copy) Outputs a message to the console.
§type

table

(Safe copy) Displays tabular data as a table.
§type

time

(Safe copy) Starts a timer with a name specified as an input parameter.
§type

timeEnd

(Safe copy) Stops a timer that was previously started.
§type

timeLog

(Safe copy) Logs the current value of a timer that was previously started.
§type

trace

(Safe copy) Outputs a stack trace to the console.
§type

warn

(Safe copy) Outputs a warning message to the console.