UNPKG

@chubbyts/chubbyts-decode-encode

Version:

A simple decode/encode solution for json / jsonx / url-encoded / xml / yaml.

11 lines (10 loc) 381 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createJsonTypeEncoder = void 0; const createJsonTypeEncoder = (prettyPrint = false) => { return { encode: (data) => JSON.stringify(data, undefined, prettyPrint ? 4 : undefined), contentType: 'application/json', }; }; exports.createJsonTypeEncoder = createJsonTypeEncoder;