Skip to content

Commit ad4a7bb

Browse files
committed
make reducers/revivers optional
1 parent 7edc790 commit ad4a7bb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/parse.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
/**
1111
* Revive a value serialized with `devalue.stringify`
1212
* @param {string} serialized
13-
* @param {Record<string, (value: any) => any>} revivers
13+
* @param {Record<string, (value: any) => any>} [revivers]
1414
*/
1515
export function parse(serialized, revivers) {
1616
return unflatten(JSON.parse(serialized), revivers);
@@ -19,7 +19,7 @@ export function parse(serialized, revivers) {
1919
/**
2020
* Revive a value flattened with `devalue.stringify`
2121
* @param {number | any[]} parsed
22-
* @param {Record<string, (value: any) => any>} revivers
22+
* @param {Record<string, (value: any) => any>} [revivers]
2323
*/
2424
export function unflatten(parsed, revivers) {
2525
if (typeof parsed === 'number') return hydrate(parsed, true);

src/stringify.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import {
1717
/**
1818
* Turn a value into a JSON string that can be parsed with `devalue.parse`
1919
* @param {any} value
20-
* @param {Record<string, (value: any) => any>} reducers
20+
* @param {Record<string, (value: any) => any>} [reducers]
2121
*/
2222
export function stringify(value, reducers) {
2323
/** @type {any[]} */

0 commit comments

Comments
 (0)