konami
constkonami:object
Defined in: index.ts:7
Konami code helpers.
Type Declaration
Section titled “Type Declaration”CODE:
TKonamiCode[]
The Konami code key sequence, as KeyboardEvent.code values.
is: (
event) =>boolean
Feeds a key event into the sequence and returns true when it completes the Konami code; a wrong key resets progress.
The progress is module-level state shared by every caller, so use one listener per page.
Parameters
Section titled “Parameters”KeyboardEvent
Returns
Section titled “Returns”boolean
Example
Section titled “Example”import { konami } from "@theholocron/misc-utils";
document.addEventListener("keydown", (event) => { if (konami.is(event)) console.log("Konami Code entered!");});