com-tools
Version:
com-tools 提供了一些通用的工具函数;
91 lines (42 loc) • 1.11 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [com-tools](./com-tools.md) > [pathString](./com-tools.pathstring.md)
## pathString() function
将路径数组转成路径字符串
**Signature:**
```typescript
export declare function pathString(path: (string | number | null | undefined)[], separator?: string | null, placeholder?: string | null): string;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
path
</td><td>
(string \| number \| null \| undefined)\[\]
</td><td>
路径数组
</td></tr>
<tr><td>
separator
</td><td>
string \| null
</td><td>
_(Optional)_ 分隔符,默认是 "/"
</td></tr>
<tr><td>
placeholder
</td><td>
string \| null
</td><td>
_(Optional)_ 占位符,默认是 "-"
</td></tr>
</tbody></table>
**Returns:**
string
## Remarks
会自动将数组尾部的空值给移除,中间的空值转为占位符 placeholder