-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathisHtmlOutput.ts
More file actions
22 lines (20 loc) · 1001 Bytes
/
isHtmlOutput.ts
File metadata and controls
22 lines (20 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { isFunction, isObject } from "../../lang";
type HtmlOutput = GoogleAppsScript.HTML.HtmlOutput;
/**
* Checks if the given value is a Google Apps Script <a href="https://developers.google.com/apps-script/reference/html/html-output"><code>HtmlOutput</code></a> object.
*
* @param {unknown} value - The value to check.
* @returns {boolean} `true` if the value is an <a href="https://developers.google.com/apps-script/reference/html/html-output"><code>HtmlOutput</code></a> object, `false` otherwise.
* @see <a href="https://developers.google.com/apps-script/reference/html/html-output"><code>HtmlOutput</code></a>
* @since 1.0.0
* @version 1.0.0
* @environment `Google Apps Script`
*/
export function isHtmlOutput(value: unknown): value is HtmlOutput {
return (
isObject(value) &&
isFunction((value as HtmlOutput)?.getContent) &&
isFunction((value as HtmlOutput)?.setTitle) &&
isFunction((value as HtmlOutput)?.setXFrameOptionsMode)
);
}