JsonUtils

Last Updated on : 2024-06-05 03:14:36download

This topic describes the utility method that is used to parse a JSON string.

API operation name

parseJSON

API description

Return the result after the JSON string is parsed.

Request parameter

Name Data type Description Required
str string String Yes

Return parameter

Name Data type Description
finalObj object The result after the JSON string is parsed.

Sample request

import { Utils } from "tuya-panel-kit"; const { parseJSON } = Utils.JsonUtils; parseJSON(str); //Example: parseJSON("{a:1, b:2}");

Sample response

{a: 1, b: 2}