Closed ntucakovic closed 4 years ago
Can you elaborate on why the default isn't appropriate? Typically we expect the output of this to be only used to be read by machines (indexers, etc) and so having it as short as possible makes sense (the default when space is not set).
It's totally appropriate to have default as it currently is, I wouldn't change that. I'm only suggesting to allow the React component to pass down space property to stringify method.
I'm porting over existing JSON-LD declared straight in HTML to React, and having both at the same time nicely printed allows me to compare the difference easily, without having to rely on some other.
Got it. Yeah cleaner diffs sounds like a compelling reason here, I get the pain.
Writing a PR with this change sounds good!
I have quite long JSON-LD schemas, and it would be very useful if we could support passing down space property down to JSON stringify.
Something like:
I could do a PR with this