The string to parse
OptionaloptionsOrSentinel: Function | ObjectifyOptions
Optional configuration options or a sentinel function for undefined values
The deserialized object or original string if parsing fails
TRUST BOUNDARY WARNING
objectify() is an ACTIVE deserializer designed for internal state persistence
(e.g. WebStorage, internal caching, trusted worker IPC).
Do NOT use objectify() on untrusted or external strings (e.g. HTTP request bodies,
unverified tokens, public webhooks):
Reflect.construct.Symbol.for().When dealing with semi-trusted strings, configure ObjectifyOptions:
set allowClasses: false (or specify an allowedClasses allowlist), maxDepth,
or enforce tamper detection with requireSigned: true.
For cryptographically authenticated payloads across untrusted network boundaries, use signJWS() / verifyJWS().
For completely untrusted external input, use native JSON.parse() with schema validation instead.
Rebuilds an Object from its
stringify'd string representation. Handles custom single key:value type definitions automatically.