Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the parameter type in the pasteData request
Browse files Browse the repository at this point in the history
frouo committed Sep 1, 2022

Verified

This commit was signed with the committer’s verified signature.
medariox Dario
1 parent d9c1556 commit e166159
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/classes/google-spreadsheet-worksheet.md
Original file line number Diff line number Diff line change
@@ -248,6 +248,7 @@ Param|Type|Required|Description
`coordinate`|[[GridCoordinate](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/other#GridCoordinate)]|✅|The coordinate at which the data should start being inserted, sheetId not required!
`data`|String|✅|The data to insert.
`delimiter`|String|✅|The delimiter in the data.
`type`|String (enum)<br>[PasteType](https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#PasteType)|-|How the data should be pasted. _defaults to `PASTE_NORMAL`_

#### `appendDimension(dimension, length)` (async) :id=fn-appendDimension
> Appends rows or columns to the end of a sheet.
3 changes: 2 additions & 1 deletion lib/GoogleSpreadsheetWorksheet.js
Original file line number Diff line number Diff line change
@@ -697,7 +697,7 @@ class GoogleSpreadsheetWorksheet {
// https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#UpdateEmbeddedObjectPositionRequest
}

async pasteData(coordinate, data, delimiter) {
async pasteData(coordinate, data, delimiter, type = "PASTE_NORMAL") {
// Request type = `pasteData`
// https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/request#PasteDataRequest
await this._makeSingleUpdateRequest("pasteData", {
@@ -708,6 +708,7 @@ class GoogleSpreadsheetWorksheet {
},
data,
delimiter,
type
});
}

0 comments on commit e166159

Please sign in to comment.