mdast2docx logo Md2Docx
Version 0.1.0API DocsFunctions

stableSerialize()

Updated 22 Oct 2026

stableSerialize(obj, ignoreKeys?): string

Defined in: cache.ts:134

Serializes a value into a stable string for cache key generation.

  • Recursively handles arrays and objects
  • Skips functions, promises and undefined values
  • Omits keys listed in ignoreKeys (only for objects)
  • Ensures consistent key ordering for objects

Parameters

obj

unknown

The input to serialize (can be primitive, array, or object)

ignoreKeys?

string[] = []

Keys to exclude from object serialization

Returns

string

A stable, stringified representation

On this page