mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-19 01:45:53 +00:00
14 lines
344 B
TypeScript
14 lines
344 B
TypeScript
import { promises as fsp } from 'node:fs'
|
|
import { useLogger } from '@nuxt/kit'
|
|
|
|
/** @since 3.9.0 */
|
|
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()
|
|
}
|
|
|
|
export const logger = useLogger('nuxt')
|