79631794

Date: 2025-05-21 10:37:03
Score: 0.5
Natty:
Report link

If you're looking for a fully type-safe, refactor-friendly alternative without relying on compiler transforms or macros, check out this new package:

👉 @nameof/nameof

import nameof from "@nameof/nameof";

const obj = { someProperty: 123 } as const;

const key = nameof(obj, "someProperty"); 
// "someProperty", inferred type: "someProperty"
Reasons:
  • Contains signature (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Baboon