Helpers

stableStringify.mjs

@mr_ozio/scraper-utils · v2.5.0 · Generated April 21, 2026

Target Style

Target Style

2 exports

const

stableStringify

Target Style
export const stableStringify = (value) => {

Serializes a value with stable object key ordering.

Target style API. Preferred for new code.

Parameters

  • valueunknown

Returns

string

Example

const json = stableStringify({
  b: 2,
  a: 1,
})

const

hashStably

Target Style
export const hashStably = (value, { using = 'sha256' } = {}) => hashOf(stableStringify(value), { using })

Generates a hash from a stable serialized representation of a value.

Target style API. Preferred for new code.

Parameters

  • valueunknown
  • [options]{ using?: string }

Returns

string

Example

const digest = hashStably({
  slug: 'ginza',
  status: 1,
})

Legacy Style

Legacy Style

0 exports

No legacy exports in this module.