hatch-surf/node_modules/next/dist/shared/lib/magic-identifier.d.ts
Riley Zhang df378d33ef
Some checks failed
CI / go (push) Waiting to run
CI / docker (push) Waiting to run
CI / lint-go (push) Waiting to run
CI / lint-docs (push) Waiting to run
CI / check-paperclip (push) Waiting to run
Deploy static site / Deploy to GitHub Pages (push) Has been cancelled
Deploy static site / Deploy via Docker to hatch.surf (push) Has been cancelled
Merge GitHub main into Gitea repo (allow unrelated histories)
Resolved conflicts by taking GitHub versions for:
- .dockerignore, .gitignore, Dockerfile, README.md, docker-compose.yml

Kept deploy.sh updated to:
- Pull from GitHub (primary source)
- Push to Gitea (push-mirror)
- Build from site/ directory (GitHub structure)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-06-25 05:20:46 +02:00

31 lines
1.3 KiB
TypeScript

export declare function decodeMagicIdentifier(identifier: string): string;
export declare const MAGIC_IDENTIFIER_REGEX: RegExp;
/**
* Cleans up module IDs by removing implementation details.
* - Replaces [project] with .
* - Removes content in brackets [], parentheses (), and angle brackets <>
*/
export declare function deobfuscateModuleId(moduleId: string): string;
/**
* Removes the free call wrapper pattern (0, expr) from expressions.
* This is a JavaScript pattern to call a function without binding 'this',
* but it's noise for developers reading error messages.
*/
export declare function removeFreeCallWrapper(text: string): string;
export type TextPartType = 'raw' | 'deobfuscated';
/**
* Deobfuscates text and returns an array of discriminated parts.
* Each part is a tuple of [type, string] where type is either 'raw' (unchanged text)
* or 'deobfuscated' (a magic identifier that was decoded).
*
* This is useful when you need to process or display deobfuscated and raw text differently.
*/
export declare function deobfuscateTextParts(text: string): Array<[TextPartType, string]>;
/**
* Deobfuscates text by:
* 1. Decoding magic identifiers
* 2. Cleaning up module IDs
* 3. Removing free call wrappers
*/
export declare function deobfuscateText(text: string): string;