LiteSun commented on a change in pull request #1490:
URL: https://github.com/apache/apisix-dashboard/pull/1490#discussion_r582563832



##########
File path: web/src/helpers.tsx
##########
@@ -130,3 +132,20 @@ export const timestampToLocaleString = (timestamp: number) 
=> {
 
   return moment.unix(timestamp).format('YYYY-MM-DD HH:mm:ss');
 };
+
+/**
+ * Transform json string to yaml string
+ * @param jsonStr
+ */
+export const json2yaml = (jsonStr: string): string => {
+  return yaml.dump(JSON.parse(jsonStr))

Review comment:
       if jsonStr's value is `''`, an error will occur




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to