Files
pnpm/exec/plugin-commands-script-runners/src/existsInDir.ts
Zoltan Kochan 5d5818e44f style: enforce node: protocol for builtin imports (#10951)
Add n/prefer-node-protocol rule and autofix all bare builtin imports
to use the node: prefix. Simplify the simple-import-sort builtins
pattern to just ^node: since all imports now use the prefix.
2026-03-13 07:59:51 +01:00

9 lines
259 B
TypeScript

import fs from 'node:fs'
import path from 'node:path'
export function existsInDir (entityName: string, dir: string): string | undefined {
const entityPath = path.join(dir, entityName)
if (fs.existsSync(entityPath)) return entityPath
return undefined
}