mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 06:19:43 +08:00
12 lines
350 B
TypeScript
12 lines
350 B
TypeScript
/** Wire-level course scope shared by the standalone study surfaces. */
|
|
|
|
export function courseSessionConfiguration<T extends object>(
|
|
configuration: T,
|
|
courseId: string,
|
|
): T | (T & { courseId: string }) {
|
|
const cleanCourseId = courseId.trim();
|
|
return cleanCourseId
|
|
? { ...configuration, courseId: cleanCourseId }
|
|
: configuration;
|
|
}
|