Appearance
isPptFilePath 判断 PPT 文件路径
function isPptFilePath(filePath: string): boolean
判断文件路径是否为 PPT 文件。支持 ppt、pptx 后缀。
参数
| 参数名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| filePath | 待判断的文件路径 | string | 必填 |
返回值
| 返回值 | 说明 | 类型 |
|---|---|---|
| result | 是 PPT 文件路径时返回 true,否则返回 false | boolean |
示例
typescript
import { isPptFilePath } from '@mingto/tools'
isPptFilePath('/docs/slides.ppt') // true
isPptFilePath('/docs/slides.pptx?preview=1') // true
isPptFilePath('/docs/report.pdf') // false