This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
Liam 98c52e5525
Some checks failed
Deploy Backend / deploy (push) Failing after 25s
Deploy Frontend / deploy (push) Failing after 10s
let's try this again
2024-10-04 20:35:44 +01:00

35 lines
785 B
TypeScript

import Cookies from "js-cookie";
/**
* Sets the player id cookie
*
* @param playerId the player id to set
*/
export function setPlayerIdCookie(playerId: string) {
Cookies.set("playerId", playerId, { path: "/" });
}
/**
* Gets if we're in production
*/
export function isProduction() {
return process.env.NODE_ENV === "production";
}
/**
* Gets the build information
*
* @returns the build information
*/
export function getBuildInformation() {
const buildId = process.env.NEXT_PUBLIC_BUILD_ID
? isProduction()
? process.env.NEXT_PUBLIC_BUILD_ID.slice(0, 7)
: "dev"
: "";
const buildTime = process.env.NEXT_PUBLIC_BUILD_TIME;
const buildTimeShort = process.env.NEXT_PUBLIC_BUILD_TIME_SHORT;
return { buildId, buildTime, buildTimeShort };
}