-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathisValidSheetName.ts
More file actions
17 lines (16 loc) · 775 Bytes
/
isValidSheetName.ts
File metadata and controls
17 lines (16 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { isString, nonEmpty } from "../../lang";
/**
* Checks if the given value is a valid [sheet](https://developers.google.com/apps-script/reference/spreadsheet/sheet) name.
* A valid sheet name, according to this function, is a non-empty string.
*
* @param {unknown} value - The value to check.
* @returns {boolean} `true` if the value is a non-empty string, `false` otherwise.
* @see {@link GoogleAppsScript.Spreadsheet.Sheet|Sheet}
* @see [Class Sheet](https://developers.google.com/apps-script/reference/spreadsheet/sheet)
* @since 1.0.0
* @version 1.0.1
* @environment `Google Apps Script`, `Browser`
*/
export function isValidSheetName(value: unknown): value is string {
return isString(value) && nonEmpty(value);
}