mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor: ♻️ Always use explicit types in every function
This commit is contained in:
parent
54cea29ce9
commit
c1dcdc78ae
62 changed files with 359 additions and 226 deletions
|
|
@ -3,7 +3,13 @@ import { Args, type Command, Flags, type Interfaces } from "@oclif/core";
|
|||
import { Instance, User, db } from "@versia/kit/db";
|
||||
import { Emojis, Instances, Users } from "@versia/kit/tables";
|
||||
import chalk from "chalk";
|
||||
import { and, eq, getTableColumns, like } from "drizzle-orm";
|
||||
import {
|
||||
type InferSelectModel,
|
||||
and,
|
||||
eq,
|
||||
getTableColumns,
|
||||
like,
|
||||
} from "drizzle-orm";
|
||||
import { BaseCommand } from "./base.ts";
|
||||
|
||||
export type FlagsType<T extends typeof Command> = Interfaces.InferredFlags<
|
||||
|
|
@ -203,7 +209,11 @@ export abstract class EmojiFinderCommand<
|
|||
this.args = args as ArgsType<T>;
|
||||
}
|
||||
|
||||
public async findEmojis() {
|
||||
public async findEmojis(): Promise<
|
||||
(InferSelectModel<typeof Emojis> & {
|
||||
instanceUrl: string | null;
|
||||
})[]
|
||||
> {
|
||||
// Check if there are asterisks in the identifier but no pattern flag, warn the user if so
|
||||
if (this.args.identifier.includes("*") && !this.flags.pattern) {
|
||||
this.log(
|
||||
|
|
|
|||
|
|
@ -75,13 +75,13 @@ export default class UserCreate extends BaseCommand<typeof UserCreate> {
|
|||
const password1 = await input({
|
||||
message: "Please enter the user's password:",
|
||||
// Set whatever the user types to stars
|
||||
transformer: (value) => "*".repeat(value.length),
|
||||
transformer: (value): string => "*".repeat(value.length),
|
||||
});
|
||||
|
||||
const password2 = await input({
|
||||
message: "Please confirm the user's password:",
|
||||
// Set whatever the user types to stars
|
||||
transformer: (value) => "*".repeat(value.length),
|
||||
transformer: (value): string => "*".repeat(value.length),
|
||||
});
|
||||
|
||||
if (password1 !== password2) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue