Deno Rewrite Custom Inspect

1.0.0Last update Dec 1, 2024
by@lovelindhoni

This codemod replaces occurrences of Deno.customInspect with Symbol.for("Deno.customInspect"). This change aligns with the new standard for defining custom inspection behavior in Deno, providing better interoperability with JavaScript's built-in features.

Before

class Foo {
// Old method of defining custom inspection
[Deno.customInspect]() {
return "This is Foo!";
}
}

After

class Foo {
// New method of defining custom inspection
[Symbol.for("Deno.customInspect")]() {
return "This is Foo!";
}
}

Build custom codemods

Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community

background illustrationGet Started Now