Render a Rule as a short human-readable string, for inspectors and diagnostics that need to say WHICH rule decided something.
{ capability: 'edits-page' } → capability:edits-page{ all: [{ mode: 'normal' }, { focused: true }] } → all(mode:normal, focused:true){ not: { selection: { empty: true } } } → not(selection:empty=true){ when: function hasPath() { … } } → when(hasPath) Copy
{ capability: 'edits-page' } → capability:edits-page{ all: [{ mode: 'normal' }, { focused: true }] } → all(mode:normal, focused:true){ not: { selection: { empty: true } } } → not(selection:empty=true){ when: function hasPath() { … } } → when(hasPath)
Never throws and always terminates — unlike JSON.stringify, which throws on a cyclic value and renders the when arm as a useless {}.
JSON.stringify
when
{}
Render a Rule as a short human-readable string, for inspectors and diagnostics that need to say WHICH rule decided something.
Never throws and always terminates — unlike
JSON.stringify, which throws on a cyclic value and renders thewhenarm as a useless{}.