Payload Lab / Examples
Examples
These examples call the distributed SDK directly, not a remote API. Results are calculated when you press Run.
format
Parse and serialize JSON with indentation.
JavaScript
import { format } from "./sdk.js";
console.log(format('{"enabled":true}'));Expected value
{
"enabled": true
}Not executed yet
pointer
Resolve an RFC 6901 JSON Pointer.
JavaScript
import { pointer } from "./sdk.js";
console.log(pointer('{"items":[{"id":7}]}', "/items/0/id"));Expected value
7Not executed yet
compare
Compare JSON values and return changed paths.
JavaScript
import { compare } from "./sdk.js";
console.log(compare('{"a":1}', '{"a":2}'));Expected value
[
"/a"
]Not executed yet