Skip to content

Commit

Permalink
fix(docs): wrap async return types in Promise (#1720)
Browse files Browse the repository at this point in the history
  • Loading branch information
mixmav authored Oct 24, 2024
1 parent a44495a commit c8b4192
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pages/sessions/basic-api/drizzle-orm.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ import { sha256 } from "@oslojs/crypto/sha2";

// ...

export async function createSession(token: string, userId: number): Session {
export async function createSession(token: string, userId: number): Promise<Session> {
const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token)));
const session: Session = {
id: sessionId,
Expand Down Expand Up @@ -253,7 +253,7 @@ export function generateSessionToken(): string {
return token;
}

export async function createSession(token: string, userId: number): Session {
export async function createSession(token: string, userId: number): Promise<Session> {
const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token)));
const session: Session = {
id: sessionId,
Expand Down
4 changes: 2 additions & 2 deletions pages/sessions/basic-api/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ import { sha256 } from "@oslojs/crypto/sha2";

// ...

export async function createSession(token: string, userId: number): Session {
export async function createSession(token: string, userId: number): Promise<Session> {
const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token)));
const session: Session = {
id: sessionId,
Expand Down Expand Up @@ -195,7 +195,7 @@ export function generateSessionToken(): string {
return token;
}

export async function createSession(token: string, userId: number): Session {
export async function createSession(token: string, userId: number): Promise<Session> {
const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token)));
const session: Session = {
id: sessionId,
Expand Down
2 changes: 1 addition & 1 deletion pages/sessions/basic-api/postgresql.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ import { sha256 } from "@oslojs/crypto/sha2";

// ...

export async function createSession(token: string, userId: number): Session {
export async function createSession(token: string, userId: number): Promise<Session> {
const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token)));
const session: Session = {
id: sessionId,
Expand Down
4 changes: 2 additions & 2 deletions pages/sessions/basic-api/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import { sha256 } from "@oslojs/crypto/sha2";

// ...

export async function createSession(token: string, userId: number): Session {
export async function createSession(token: string, userId: number): Promise<Session> {
const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token)));
const session: Session = {
id: sessionId,
Expand Down Expand Up @@ -186,7 +186,7 @@ export function generateSessionToken(): string {
return token;
}

export async function createSession(token: string, userId: number): Session {
export async function createSession(token: string, userId: number): Promise<Session> {
const sessionId = encodeHexLowerCase(sha256(new TextEncoder().encode(token)));
const session: Session = {
id: sessionId,
Expand Down

0 comments on commit c8b4192

Please sign in to comment.