- 웹훅 URL을 https://admin.youtooplay.com/webhook로 변경 - Nginx 리버스 프록시 설정 파일 추가 - 배포 가이드 업데이트
This commit is contained in:
32
@core/utils/helpers.ts
Normal file
32
@core/utils/helpers.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
// 👉 IsEmpty
|
||||
export const isEmpty = (value: unknown): boolean => {
|
||||
if (value === null || value === undefined || value === '')
|
||||
return true
|
||||
|
||||
return !!(Array.isArray(value) && value.length === 0)
|
||||
}
|
||||
|
||||
// 👉 IsNullOrUndefined
|
||||
export const isNullOrUndefined = (value: unknown): value is undefined | null => {
|
||||
return value === null || value === undefined
|
||||
}
|
||||
|
||||
// 👉 IsEmptyArray
|
||||
export const isEmptyArray = (arr: unknown): boolean => {
|
||||
return Array.isArray(arr) && arr.length === 0
|
||||
}
|
||||
|
||||
// 👉 IsObject
|
||||
export const isObject = (obj: unknown): obj is Record<string, unknown> =>
|
||||
obj !== null && !!obj && typeof obj === 'object' && !Array.isArray(obj)
|
||||
|
||||
// 👉 IsToday
|
||||
export const isToday = (date: Date) => {
|
||||
const today = new Date()
|
||||
|
||||
return (
|
||||
date.getDate() === today.getDate()
|
||||
&& date.getMonth() === today.getMonth()
|
||||
&& date.getFullYear() === today.getFullYear()
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user