open-nomad/ui/app/helpers/stringify-object.js
2023-04-10 15:36:59 +00:00

19 lines
363 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
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);