mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-15 18:34:50 +00:00
10 lines
245 B
TypeScript
10 lines
245 B
TypeScript
import { promises as fsp } from 'node:fs'
|
|
|
|
export function toArray<T> (value: T | T[]): T[] {
|
|
return Array.isArray(value) ? value : [value]
|
|
}
|
|
|
|
export async function isDirectory (path: string) {
|
|
return (await fsp.lstat(path)).isDirectory()
|
|
}
|