UNPKG

com-tools

Version:

com-tools 提供了一些通用的工具函数;

85 lines (39 loc) 1.03 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [com-tools](./com-tools.md) &gt; [toJSONItemFragment](./com-tools.tojsonitemfragment.md) ## toJSONItemFragment() function 将 项目转成 JSON 的数组中的 item 片断 **Signature:** ```typescript export declare function toJSONItemFragment(item: any, space?: string | number, itemSeparator?: string): string; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> item </td><td> any </td><td> </td></tr> <tr><td> space </td><td> string \| number </td><td> _(Optional)_ </td></tr> <tr><td> itemSeparator </td><td> string </td><td> _(Optional)_ 两个 item 之间的分隔符;默认情况下,如果 space 有值且不为0,则 itemSeparator 默认为 \\<!-- -->n 否则 为 空 </td></tr> </tbody></table> **Returns:** string