open-nomad/ui/app/helpers/stringify-object.js
Phil Renaud 9043512f03 Secure Variables: JSON view (#13439)
* JSON view init

* Overeager config history reverted

* Set as query parameter

* border added to copy button

* More robust stringifyObject helper

* Testing for stringify-object helper
2022-07-11 13:34:06 -04:00

14 lines
285 B
JavaScript

import Helper from '@ember/component/helper';
/**
* Changes a JSON object into a string
*/
export function stringifyObject(
[obj],
{ replacer = null, whitespace = 2 } = {}
) {
return JSON.stringify(obj, replacer, whitespace);
}
export default Helper.helper(stringifyObject);