In JS SDK, what's the easiest way to save a web map in its current state as a JSON object? Is there a method to generate objects of the Web Map specification? I see a method to load web maps with WebMap.fromJSON, but can't find where to generate such an object.
I've been building the object from my Map according to the spec, but it's running into quite a few issues.