Safe Flat Utilities
JSON →safe-flat is a JavaScript/TypeScript utility library designed for safely flattening and unflattening deeply nested objects. Its primary function, `flatten`, converts a multi-level object into a single-level object, using a configurable delimiter (defaulting to '.'). A key feature is its robust handling of circular references, which it replaces with the `[Circular]` string during flattening to prevent infinite recursion and serialization issues. The companion function, `unflatten`, reconstructs the original nested object structure from a flattened representation, treating `[Circular]` markers as literal string values. The current stable version, 2.1.0, is distributed with TypeScript types, enhancing developer experience. It appears to have a stable, though infrequent, release cadence, focusing on reliability for object serialization and deserialization tasks by mitigating common pitfalls like circular references.
Traffic · last 30 days ↓50% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany