import { ClientEngineType } from '@prisma/sdk' ; import path from 'path' ; param clientEngineType param relativeOutdir param runtimeDir returns export function buildDirname ( clientEngineType , relativeOutdir , runtimeDir ) { if ( clientEngineType !== ClientEngineType . DataProxy ) { return buildDirnameFind ( relativeOutdir , runtimeDir ) ; } return buildDirnameDefault ( ) ; } param relativeOutdir param runtimePath returns function buildDirnameFind ( relativeOutdir , runtimePath ) { const slsRelativeOutputDir = relativeOutdir . split ( path . sep ) . slice ( 1 ) . join ( path . sep ) ; return `
const { findSync } = require('${ runtimePath }')

const dirname = findSync(process.cwd(), [
    ${ JSON . stringify ( relativeOutdir ) },
    ${ JSON . stringify ( slsRelativeOutputDir ) },
], ['d'], ['d'], 1)[0] || __dirname` ; } returns function buildDirnameDefault ( ) { return `const dirname = '/'` ; }