mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
16 lines
463 B
TypeScript
16 lines
463 B
TypeScript
import {decodeScalar} from 'sentry/utils/queryString';
|
|
|
|
// TypeScript thinks the values are strings, but they could be undefined.
|
|
// See `noUncheckedIndexedAccess`
|
|
interface Return {
|
|
feedbackId: string | undefined;
|
|
projectSlug: string | undefined;
|
|
}
|
|
|
|
export default function decodeFeedbackSlug(
|
|
val: string | string[] | null | undefined
|
|
): Return {
|
|
const [projectSlug, feedbackId] = decodeScalar(val, '').split(':');
|
|
return {projectSlug, feedbackId};
|
|
}
|