Skip to content

Commit

Permalink
chore: format and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
IncognitoTGT committed May 16, 2024
1 parent de8be5d commit 74f4a1a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/lib/session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import { getAuthSession } from "../auth";
import { revalidatePath } from "next/cache";
import { consola } from "consola";
const getRandomNumber = (min: number, max: number) => Math.floor(Math.random() * (max - min + 1)) + min;
const encodeEmailLocal = (email: string) => Array.from(email).map(char => /[a-zA-Z0-9_.-]/.test(char) ? char : char.charCodeAt(0)).join("");
const encodeEmailLocal = (email: string) =>
Array.from(email)
.map((char) => (/[a-zA-Z0-9_.-]/.test(char) ? char : char.charCodeAt(0)))
.join("");
/**
* Creates a new Stardust session
* @param Image Docker image to use for making the session
Expand All @@ -33,7 +36,7 @@ async function createSession(Image: string) {
}
const container = await docker
.createContainer({
name: `stardust-${Date.now()}-${encodeEmailLocal(userSession.user.email?.split("@")[0])}`,
name: `stardust-${Date.now()}-${encodeEmailLocal((userSession.user?.email as string).split("@")[0])}`,
Image,
HostConfig: {
PortBindings: {
Expand Down

0 comments on commit 74f4a1a

Please sign in to comment.