Skip to content

Commit 9cf2ba6

Browse files
committed
Delint PR
1 parent e987c9b commit 9cf2ba6

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

slides/snippets/slides_image_merging.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,27 @@ async function imageMerging(templatePresentationId, imageUrl, customerName) {
2626
const {google} = require('googleapis');
2727

2828
const auth = new GoogleAuth(
29-
{scopes: ['https://www.googleapis.com/auth/presentations',
29+
{scopes: ['https://www.googleapis.com/auth/presentations',
3030
'https://www.googleapis.com/auth/drive']});
3131

3232
const slidesService = google.slides({version: 'v1', auth});
3333
const driveService = google.drive({version: 'v2', auth});
34-
let logoUrl = imageUrl;
35-
let customerGraphicUrl = imageUrl;
34+
const logoUrl = imageUrl;
35+
const customerGraphicUrl = imageUrl;
3636

3737
// Duplicate the template presentation using the Drive API.
38-
let copyTitle = customerName + ' presentation';
38+
const copyTitle = customerName + ' presentation';
3939
try {
4040
const driveResponse = await driveService.files.copy({
4141
fileId: templatePresentationId,
4242
resource: {
4343
name: copyTitle,
4444
},
4545
});
46-
let presentationCopyId = driveResponse.data.id;
46+
const presentationCopyId = driveResponse.data.id;
4747

4848
// Create the image merge (replaceAllShapesWithImage) requests.
49-
let requests = [{
49+
const requests = [{
5050
replaceAllShapesWithImage: {
5151
imageUrl: logoUrl,
5252
replaceMethod: 'CENTER_INSIDE',
@@ -76,7 +76,7 @@ async function imageMerging(templatePresentationId, imageUrl, customerName) {
7676
let numReplacements = 0;
7777
for (let i = 0; i < batchUpdateResponse.data.replies.length; ++i) {
7878
numReplacements += batchUpdateResponse.data.replies[i]
79-
.replaceAllShapesWithImage.occurrencesChanged;
79+
.replaceAllShapesWithImage.occurrencesChanged;
8080
}
8181
console.log(`Created merged presentation with ID: ${presentationCopyId}`);
8282
console.log(`Replaced ${numReplacements} shapes with images.`);
@@ -88,4 +88,4 @@ async function imageMerging(templatePresentationId, imageUrl, customerName) {
8888
}
8989

9090
imageMerging('12zc4QWOtsJZ0weX3zFHj5O_IVRhXQYqOXjbia4hoXw4',
91-
'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png');
91+
'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png');

slides/snippets/slides_simple_text_replace.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ async function simpleTextReplace(presentationId, shapeId, replacementText) {
2626
const {google} = require('googleapis');
2727

2828
const auth = new GoogleAuth(
29-
{scopes: 'https://www.googleapis.com/auth/presentations'});
29+
{scopes: 'https://www.googleapis.com/auth/presentations'});
3030

3131
const service = google.slides({version: 'v1', auth});
3232
// Remove existing text in the shape, then insert new text.
33-
let requests = [{
33+
const requests = [{
3434
deleteText: {
3535
objectId: shapeId,
3636
textRange: {
@@ -63,4 +63,4 @@ async function simpleTextReplace(presentationId, shapeId, replacementText) {
6363
// [END slides_simple_text_replace]
6464

6565
simpleTextReplace('12zc4QWOtsJZ0weX3zFHj5O_IVRhXQYqOXjbia4hoXw4',
66-
'MyTextBox_01', 'My_text_which_is_new');
66+
'MyTextBox_01', 'My_text_which_is_new');

slides/snippets/slides_text_merging.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,44 +25,44 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) {
2525
const {google} = require('googleapis');
2626

2727
const auth = new GoogleAuth(
28-
{scopes: ['https://www.googleapis.com/auth/presentations',
29-
'https://www.googleapis.com/auth/drive',
30-
'https://www.googleapis.com/auth/spreadsheet']});
28+
{scopes: ['https://www.googleapis.com/auth/presentations',
29+
'https://www.googleapis.com/auth/drive',
30+
'https://www.googleapis.com/auth/spreadsheet']});
3131

3232
const slidesService = google.slides({version: 'v1', auth});
3333
const sheetsService = google.sheets({version: 'v4', auth});
3434
const driveService = google.drive({version: 'v2', auth});
3535

3636
// Use the Sheets API to load data, one record per row.
37-
let responses = [];
38-
let dataRangeNotation = 'Customers!A2:M6';
37+
const responses = [];
38+
const dataRangeNotation = 'Customers!A2:M6';
3939

4040
try {
4141
const sheetsResponse = await sheetsService.spreadsheets.values.get({
4242
spreadsheetId: dataSpreadsheetId,
4343
range: dataRangeNotation,
4444
});
45-
let values = sheetsResponse.data.values;
45+
const values = sheetsResponse.data.values;
4646

4747
// For each record, create a new merged presentation.
4848
for (let i = 0; i < values.length; ++i) {
49-
let row = values[i];
50-
let customerName = row[2]; // name in column 3
51-
let caseDescription = row[5]; // case description in column 6
52-
let totalPortfolio = row[11]; // total portfolio in column 12
49+
const row = values[i];
50+
const customerName = row[2]; // name in column 3
51+
const caseDescription = row[5]; // case description in column 6
52+
const totalPortfolio = row[11]; // total portfolio in column 12
5353

5454
// Duplicate the template presentation using the Drive API.
55-
let copyTitle = customerName + ' presentation';
55+
const copyTitle = customerName + ' presentation';
5656
let requests = {
5757
name: copyTitle,
5858
};
5959

6060
const driveResponse = await driveService.files.copy({
6161
fileId: templatePresentationId,
6262
requests,
63-
});
63+
});
6464

65-
let presentationCopyId = driveResponse.data.id;
65+
const presentationCopyId = driveResponse.data.id;
6666
// Create the text merge (replaceAllText) requests for this presentation.
6767
requests = [{
6868
replaceAllText: {
@@ -96,7 +96,7 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) {
9696
requests,
9797
},
9898
});
99-
let result = batchUpdateResponse.data;
99+
const result = batchUpdateResponse.data;
100100
// [START_EXCLUDE silent]
101101
responses.push(result.replies);
102102
// [END_EXCLUDE]
@@ -117,4 +117,4 @@ async function textMerging(templatePresentationId, dataSpreadsheetId) {
117117
// [END slides_text_merging]
118118

119119
textMerging('12zc4QWOtsJZ0weX3zFHj5O_IVRhXQYqOXjbia4hoXw4',
120-
'1uSTAkV11mnou78uRdTYcy36owjZR2mWMDAeRhXEImjE');
120+
'1uSTAkV11mnou78uRdTYcy36owjZR2mWMDAeRhXEImjE');

slides/snippets/slides_text_style_update.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ async function textStyleUpdate(presentationId, shapeId) {
1212
const {google} = require('googleapis');
1313

1414
const auth = new GoogleAuth(
15-
{scopes: 'https://www.googleapis.com/auth/presentations'});
15+
{scopes: 'https://www.googleapis.com/auth/presentations'});
1616

1717
const service = google.slides({version: 'v1', auth});
1818

19-
let requests = [{
19+
const requests = [{
2020
updateTextStyle: {
2121
objectId: shapeId,
2222
textRange: {
@@ -92,4 +92,4 @@ async function textStyleUpdate(presentationId, shapeId) {
9292
// [END slides_text_style_update]
9393

9494
textStyleUpdate('12zc4QWOtsJZ0weX3zFHj5O_IVRhXQYqOXjbia4hoXw4',
95-
'MyTextBox_01');
95+
'MyTextBox_01');

0 commit comments

Comments
 (0)