build ok,

This commit is contained in:
louiscklaw
2025-06-15 11:28:24 +08:00
parent c319c103f6
commit b7cd25b614
1088 changed files with 4376 additions and 7002 deletions

View File

@@ -2,7 +2,6 @@ import bcrypt from 'bcrypt';
const generateHash = async (password: string) => bcrypt.hash(password, await bcrypt.genSalt(10));
const validatePassword = async (password: string, hash: string) =>
bcrypt.compare(password, hash as string);
const validatePassword = async (password: string, hash: string) => bcrypt.compare(password, hash as string);
export { generateHash, validatePassword };

View File

@@ -40,11 +40,7 @@ export function logger(label: string, value: unknown, breakLine: boolean = false
if (value === null || value === undefined) {
formattedValue = String(value);
} else if (type === 'object') {
formattedValue = JSON.stringify(
value,
null,
breakLine || JSON.stringify(value).length > 50 ? 2 : 0
);
formattedValue = JSON.stringify(value, null, breakLine || JSON.stringify(value).length > 50 ? 2 : 0);
} else {
formattedValue = String(value);
}

View File

@@ -15,10 +15,8 @@ export function setDate(now: Date, options: { days?: number; hours?: number; min
return new Date(`${year}-${month}-${days ?? today} ${hours}:${minutes}`).toJSON();
}
export const subHours = (
value: number,
option: 'years' | 'months' | 'days' | 'hours' | 'minutes' | 'seconds' | 'milliseconds'
) => dayjs().subtract(value, option).format();
export const subHours = (value: number, option: 'years' | 'months' | 'days' | 'hours' | 'minutes' | 'seconds' | 'milliseconds') =>
dayjs().subtract(value, option).format();
// years,
// months,
@@ -38,15 +36,7 @@ export type DurationProps = {
milliseconds?: number;
};
export function fSub({
years = 0,
months = 0,
days = 0,
hours = 0,
minutes = 0,
seconds = 0,
milliseconds = 0,
}: DurationProps) {
export function fSub({ years = 0, months = 0, days = 0, hours = 0, minutes = 0, seconds = 0, milliseconds = 0 }: DurationProps) {
const result = dayjs()
.subtract(
dayjs.duration({
@@ -64,15 +54,7 @@ export function fSub({
return result;
}
export function fAdd({
years = 0,
months = 0,
days = 0,
hours = 0,
minutes = 0,
seconds = 0,
milliseconds = 0,
}: DurationProps) {
export function fAdd({ years = 0, months = 0, days = 0, hours = 0, minutes = 0, seconds = 0, milliseconds = 0 }: DurationProps) {
const result = dayjs()
.add(
dayjs.duration({