first commit
This commit is contained in:
11
src/utils/payload.ts
Normal file
11
src/utils/payload.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { Category, Media } from '../clientsdk/types.gen'
|
||||
|
||||
export const isCategory = (value: unknown): value is Category => {
|
||||
if (!value || typeof value !== 'object') return false
|
||||
return 'title' in value
|
||||
}
|
||||
|
||||
export const isMedia = (value: unknown): value is Media => {
|
||||
if (!value || typeof value !== 'object') return false
|
||||
return 'url' in value
|
||||
}
|
||||
Reference in New Issue
Block a user