PLPayload LabJS SDK · 1.0.0
Payload Lab / Formatting & validation

Formatting & validation

JSON is a data format, not JavaScript source. Keys and strings require double quotes; comments and trailing commas are not allowed. Formatting preserves parsed values but may normalize number spelling. Large integers above Number.MAX_SAFE_INTEGER can lose precision.

Working example

JavaScript
import { format } from "./sdk.js";

console.log(format('{"enabled":true}'));
Expected value
{
  "enabled": true
}

When input is invalid

SyntaxError: malformed JSON

Run the example in the local playground before integrating it.
Examples API reference