Code coverage report for src/util.js

Statements: 100% (2 / 2)      Branches: 100% (0 / 0)      Functions: 100% (1 / 1)      Lines: 100% (2 / 2)      Ignored: none     

All files » src/ » util.js
1 2 3 4 5 6 7 8 9 10 11              1 1    
/**
* Create a Blob containing JSON-serialized data.
* Useful for easily creating JSON fetch request bodies.
*
* @param body The object to be serialized to JSON.
* @returns A Blob containing the JSON serialized body.
*/
export function json(body: any): Blob {
  return new Blob([JSON.stringify(body)], { type: 'application/json' });
}