UNPKG

@thumbmarkjs/thumbmarkjs

Version:

![GitHub package.json dynamic](https://img.shields.io/github/package-json/version/ilkkapeltola/thumbmarkjs) ![NPM Version](https://img.shields.io/npm/v/@thumbmarkjs/thumbmarkjs) ![NPM Downloads](https://img.shields.io/npm/dm/%40thumbmarkjs%2Fthumbmarkjs

23 lines (22 loc) 713 B
/** * Stable JSON stringify implementation * Based on fast-json-stable-stringify by Evgeny Poberezkin * https://github.com/epoberezkin/fast-json-stable-stringify * * This implementation ensures consistent JSON serialization by sorting object keys, * which is critical for generating stable hashes from fingerprint data. */ /** * Converts data to a stable JSON string with sorted keys * * @param data - The data to stringify * @returns Stable JSON string representation * @throws TypeError if circular reference is detected * * @example * ```typescript * const obj = { b: 2, a: 1 }; * stableStringify(obj); // '{"a":1,"b":2}' * ``` */ export declare function stableStringify(data: any): string;