10 lines
145 B
TypeScript
10 lines
145 B
TypeScript
function getAPId (object: string | { id: string }) {
|
|
if (typeof object === 'string') return object
|
|
|
|
return object.id
|
|
}
|
|
|
|
export {
|
|
getAPId
|
|
}
|