zah f42567c00c
Basic support for Json flavours without default object serialization (#66)
Other changes:

* Migrate many procs accepting JsonReader to JsonLexer in order to
  reduce the number of generic instantiations and the resulting code
  bloat
2023-12-19 12:00:24 +02:00

13 lines
343 B
Nim

import strutils
# `dedent` exists in newer Nim version and doesn't behave the same
func test_dedent*(s: string): string =
var
s = s.strip(leading = false)
minIndent = high(int)
for l in s.splitLines:
let indent = count(l, ' ')
if indent == 0: continue
if indent < minIndent: minIndent = indent
s.unindent(minIndent)