next.js / packages /next /src /shared /lib /deployment-id.ts
AbdulElahGwaith's picture
Upload folder using huggingface_hub
b91e262 verified
// This could also be a variable instead of a function, but some unit tests want to change the ID at
// runtime. Even though that would never happen in a real deployment.
export function getDeploymentId(): string | undefined {
return process.env.NEXT_DEPLOYMENT_ID
}
export function getDeploymentIdQueryOrEmptyString(): string {
let deploymentId = getDeploymentId()
if (deploymentId) {
return `?dpl=${deploymentId}`
}
return ''
}