Skip to content

DebugReplFn

reference
1 min readUpdated

Kind: Class

Source: packages/core/repl/native-functions/debug-repl-fn.ts

Part of: Core

DebugReplFn is a native REPL function that provides a debug-oriented command within the core REPL environment. Its action() method performs the command's behavior when the function is invoked by the REPL command dispatcher.

Extends: ReplFunction

Methods

MethodSignatureReturns
action`action(moduleCls: Typestring)`

Properties

PropertyType
fnDefinitionReplFnDefinition

Where it refuses work

  • DebugReplFn stops the work with an early return when !moduleEntry.
  • DebugReplFn stops the work with an early return when collectionEntries.length <= 0.

Diagram

mermaid
graph LR
  User[REPL user] --> Parser[REPL command parser]
  Parser --> Dispatcher[Native function dispatcher]
  Dispatcher --> DebugReplFn[DebugReplFn]
  DebugReplFn --> Action[action(): void]
  Action --> DebugOutput[Debug behavior/output]

Usage

ts
import { DebugReplFn } from './native-functions/debug-repl-fn';

// Typically invoked by the REPL's native-function dispatcher.
const debugCommand = new DebugReplFn();

debugCommand.action();

AI Coding Instructions

  • Keep action() focused on the behavior of the debug REPL command; avoid placing command parsing logic in this class.
  • Integrate DebugReplFn through the existing native-function registration and dispatch flow rather than calling it directly from unrelated application code.
  • Preserve the void return contract of action() and route observable results through the REPL's established output or logging mechanisms.
  • Treat this function as a developer-facing REPL capability; avoid exposing sensitive runtime state unless the surrounding debug conventions explicitly allow it.

Was this page helpful?

Download as PDF
DebugReplFn — NestJS head-to-head