diff --git a/src/util.js b/src/util.js index 12ce9ae..d403306 100644 --- a/src/util.js +++ b/src/util.js @@ -3,8 +3,9 @@ * Useful for easily creating JSON fetch request bodies. * * @param body The object to be serialized to JSON. +* @param replacer The JSON.stringify replacer used when serializing. * @returns A Blob containing the JSON serialized body. */ -export function json(body: any): Blob { - return new Blob([JSON.stringify((body !== undefined ? body : {}))], { type: 'application/json' }); +export function json(body: any, replacer?: any): Blob { + return new Blob([JSON.stringify((body !== undefined ? body : {}), replacer)], { type: 'application/json' }); }