effect-io-ai

Package: effect
Module: Inspectable

Inspectable.NodeInspectSymbol

The type of the Node.js inspection symbol used for custom object inspection. This symbol type is used to implement custom inspection behavior in Node.js environments.

When to use

Use to type methods keyed by the Node.js custom inspection symbol.

Example (Typing custom Node inspection)

import { Inspectable } from "effect"

class CustomObject {
  constructor(private value: string) {}

  [Inspectable.NodeInspectSymbol]() {
    return `CustomObject(${this.value})`
  }
}

const obj = new CustomObject("test")
console.log(obj) // CustomObject(test)

Signature

type NodeInspectSymbol = typeof NodeInspectSymbol

Source

Since v2.0.0