LiquidJS

教程标签过滤器演示API
GitHub
概述absappendarray_to_sentence_stringat_leastat_mostcapitalizeceilcgi_escapecompactconcatdatedate_to_long_stringdate_to_rfc822date_to_stringdate_to_xmlschemadefaultdivided_bydowncaseescapeescape_oncefindfind_expfirstfloorgroup_bygroup_by_expinspectjoinjsonjsonifylastlstripmapminusmodulonewline_to_brnormalize_whitespacenumber_of_wordspluspoppushprependrawremoveremove_firstremove_lastreplacereplace_firstreplace_lastreverseroundrstripshiftsizesliceslugifysortsort_naturalsplitstripstrip_htmlstrip_newlinessumtimesto_integertruncatetruncatewordsuniqunshiftupcaseuri_escapeurl_decodeurl_encodewherewhere_expxml_escape

inspect

v10.13.0

类似于 json,但可以处理循环引用的情况。例如对于上下文:

1
2
3
4
5
const foo = {
bar: 'BAR'
}
foo.foo = foo
const scope = { foo }

输入

1
{% foo | inspect %}

输出

1
{"bar":"BAR","foo":"[Circular]"}

格式化

可以指定一个 space 参数来缩进长度。

输入

1
{{ foo | inspect: 4 }}

输出

1
2
3
4
{
"bar": "BAR",
"foo": "[Circular]"
}
上次更新:2024-08-16 上一页下一页
目录
  1. 格式化
回到顶部
© 2024 Harttle
本文档通过 CC BY 4.0 授权。
    教程标签过滤器演示API
概述absappendarray_to_sentence_stringat_leastat_mostcapitalizeceilcgi_escapecompactconcatdatedate_to_long_stringdate_to_rfc822date_to_stringdate_to_xmlschemadefaultdivided_bydowncaseescapeescape_oncefindfind_expfirstfloorgroup_bygroup_by_expinspectjoinjsonjsonifylastlstripmapminusmodulonewline_to_brnormalize_whitespacenumber_of_wordspluspoppushprependrawremoveremove_firstremove_lastreplacereplace_firstreplace_lastreverseroundrstripshiftsizesliceslugifysortsort_naturalsplitstripstrip_htmlstrip_newlinessumtimesto_integertruncatetruncatewordsuniqunshiftupcaseuri_escapeurl_decodeurl_encodewherewhere_expxml_escape