js, node で手軽な pretty print メモ
3799 ワード
深いネストもダンプする関数
> const pp = v => console.dir(v, { depth: null, colors: true})
> pp(obj)
[ { type: 'text', start: 0, end: 6, depth: 0, content: 'before' },
{ type: 'bracket',
start: 6,
end: 10,
depth: 0,
open: '(',
close: ')',
nodes:
[ { type: 'text', start: 7, end: 10, depth: 1, content: 'hit' } ] },
{ type: 'text', start: 11, end: 16, depth: 0, content: 'after' } ]
Author And Source
この問題について(js, node で手軽な pretty print メモ), 我々は、より多くの情報をここで見つけました https://qiita.com/elzup/items/42867f13a6f1c457dc6d著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .