//#region src/serverless.ts
/**
* Serverless environment detection.
*
* Used to auto-enable session flush and generate warnings when events
* might be lost due to the runtime freezing before the flush interval fires.
*/
const SERVERLESS_ENV_VARS = [
	"AWS_LAMBDA_FUNCTION_NAME",
	"VERCEL",
	"NETLIFY",
	"FUNCTION_TARGET",
	"WEBSITE_INSTANCE_ID",
	"CF_PAGES"
];
let _cached = null;
/**
* Detect whether the current process is running in a serverless environment.
*
* Checks well-known environment variables set by major serverless platforms.
* Result is cached after the first call.
*/
function isServerless() {
	if (_cached != null) return _cached;
	_cached = SERVERLESS_ENV_VARS.some((v) => process.env[v] != null && process.env[v] !== "");
	return _cached;
}
/** Reset the cached result (for testing). */
function _resetServerlessCache() {
	_cached = null;
}

//#endregion
export { _resetServerlessCache, isServerless };
//# sourceMappingURL=serverless.js.map