-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathisPresentation.ts
More file actions
15 lines (15 loc) · 671 Bytes
/
isPresentation.ts
File metadata and controls
15 lines (15 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/**
* Checks if a value is a {@link GoogleAppsScript.Slides.Presentation|Presentation} object.
*
* @param {unknown} value The value to check.
* @returns {value is GoogleAppsScript.Slides.Presentation} `true` if the value is a {@link GoogleAppsScript.Slides.Presentation|Presentation} object, `false` otherwise.
* @since 1.5.0
*/
export function isPresentation(value: unknown): value is GoogleAppsScript.Slides.Presentation {
return (
typeof value === "object" &&
value !== null &&
typeof (value as GoogleAppsScript.Slides.Presentation).getId === "function" &&
typeof (value as GoogleAppsScript.Slides.Presentation).getSlides === "function"
);
}