-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathisSlide.ts
More file actions
15 lines (15 loc) · 623 Bytes
/
isSlide.ts
File metadata and controls
15 lines (15 loc) · 623 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.Slide|Slide} object.
*
* @param {unknown} value The value to check.
* @returns {value is GoogleAppsScript.Slides.Slide} `true` if the value is a {@link GoogleAppsScript.Slides.Slide|Slide} object, `false` otherwise.
* @since 1.5.0
*/
export function isSlide(value: unknown): value is GoogleAppsScript.Slides.Slide {
return (
typeof value === "object" &&
value !== null &&
typeof (value as GoogleAppsScript.Slides.Slide).getObjectId === "function" &&
typeof (value as GoogleAppsScript.Slides.Slide).getPageElementById === "function"
);
}