Skip to content

Commit 4a3418e

Browse files
Merge pull request #13 from MaksymStoianov/max/next
Max/next
2 parents 13860d6 + bf108da commit 4a3418e

File tree

7 files changed

+28
-3
lines changed

7 files changed

+28
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ A collection of functions to simplify working with Google Sheets.
8585
| [`isTextStyle`](src/appsscript/sheets/isTextStyle.ts) | Checks if an object is a [`TextStyle`](https://developers.google.com/apps-script/reference/slides/text-style). |
8686
| [`isValidSheetName`](src/appsscript/sheets/isValidSheetName.ts) | Checks if a sheet name is valid. |
8787
| [`isValidSpreadsheetId`](src/appsscript/sheets/isValidSpreadsheetId.ts) | Checks if a spreadsheet ID is valid. |
88+
| [`nonSheet`](src/appsscript/sheets/nonSheet.ts) 🆕 | Checks if an object is not a [`Sheet`](https://developers.google.com/apps-script/reference/spreadsheet/sheet). |
8889
| [`parseA1Notation`](src/appsscript/sheets/parseA1Notation.ts) | Parses an A1 notation (e.g., 'A1:B2') into [`GridRange`](src/appsscript/sheets/types/GridRange.ts) components. |
8990
| [`prependRow`](src/appsscript/sheets/prependRow.ts) | Prepends a single row of data to the sheet. |
9091
| [`prependRows`](src/appsscript/sheets/prependRows.ts) | Prepends multiple rows of data to the sheet. |
@@ -243,7 +244,7 @@ Functions for working with file paths and URLs.
243244
- [ ] `base/date/getDaysInMonth`
244245
- [ ] `base/date/getDaysLeftInMonth`
245246
- [ ] `base/date/offset`
246-
- [ ] `base/date/offset`
247+
- [ ] `abstract/EventEmitter`
247248

248249
</details>
249250

src/appsscript/sheets/getColumnLetterByPosition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getColumnLetterByIndex } from "@/appsscript";
1+
import { getColumnLetterByIndex } from "./getColumnLetterByIndex";
22

33
/**
44
* ## getColumnLetterByPosition

src/appsscript/sheets/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export { isTextStyle } from "./isTextStyle";
2424
export { isValidSheetName } from "./isValidSheetName";
2525
export { isValidSpreadsheetId } from "./isValidSpreadsheetId";
2626

27+
export { nonSheet } from "./nonSheet";
28+
2729
export { parseA1Notation } from "./parseA1Notation";
2830

2931
export { toA1Notation } from "./toA1Notation";

src/appsscript/sheets/isCellGridRange.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { nonNil } from "@/base";
1+
import { nonNil } from "../../base";
22
import { GridRange } from "./types";
33

44
/**

src/appsscript/sheets/isSheet.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { isObject } from "../../base";
77
*
88
* @param value - The value to check.
99
* @returns `true` if the value is a {@link GoogleAppsScript.Spreadsheet.Sheet|Sheet} object, `false` otherwise.
10+
* @see nonSheet
1011
* @see [Class Sheet](https://developers.google.com/apps-script/reference/spreadsheet/sheet)
1112
* @since 1.0.0
1213
* @version 1.0.0

src/appsscript/sheets/nonSheet.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { isSheet } from "./isSheet";
2+
3+
/**
4+
* ## nonSheet
5+
*
6+
* Checks if the provided value is not a [`Google Sheet`](https://developers.google.com/apps-script/reference/spreadsheet/sheet) object.
7+
*
8+
* @param value - The value to check.
9+
* @returns `true` if the value is not a {@link GoogleAppsScript.Spreadsheet.Sheet|Sheet} object.
10+
* @see isSheet
11+
* @see [Class Sheet](https://developers.google.com/apps-script/reference/spreadsheet/sheet)
12+
* @since 1.3.0
13+
* @version 1.0.0
14+
* @environment Google Apps Script
15+
*/
16+
export function nonSheet<T>(
17+
value: T | GoogleAppsScript.Spreadsheet.Sheet
18+
): value is T {
19+
return !isSheet(value);
20+
}

src/base/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export { isValidVersion } from "./isValidVersion";
3535
export { isVersionCompatible } from "./isVersionCompatible";
3636

3737
export { nonBoolean } from "./nonBoolean";
38+
export { nonEmpty } from "./nonEmpty";
3839
export { nonNil } from "./nonNil";
3940
export { nonNull } from "./nonNull";
4041
export { nonNumber } from "./nonNumber";

0 commit comments

Comments
 (0)