Skip to content

Commit 8157f6d

Browse files
Merge pull request #5 from ScriptAddicts/fmt-codebase
Format codebase
2 parents 972f8b9 + 398a2a2 commit 8157f6d

File tree

8 files changed

+640
-309
lines changed

8 files changed

+640
-309
lines changed

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package-lock.json
2+
dist/
3+
*.md
4+
*.yml

.prettierrc.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
tabWidth: 2
2+
trailingComma: "es5"
3+
semi: true
4+
singleQuote: false
Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
// --- DocumentAppp (DocumentApp plus) ---
2-
(function(r) {
2+
(function (r) {
33
var DocumentAppp;
4-
DocumentAppp = (function() {
4+
DocumentAppp = function () {
55
var gToM, putError, putInternalError;
66

77
class DocumentAppp {
88
constructor(id_) {
99
this.name = "DocumentAppp";
1010
if (id_ !== "create") {
11-
if (id_ === "" || DriveApp.getFileById(id_).getMimeType() !== MimeType.GOOGLE_DOCS) {
11+
if (
12+
id_ === "" ||
13+
DriveApp.getFileById(id_).getMimeType() !== MimeType.GOOGLE_DOCS
14+
) {
1215
putError.call(this, "This file ID is not the file ID of Document.");
1316
}
1417
this.obj = {
15-
documentId: id_
18+
documentId: id_,
1619
};
1720
}
1821
this.headers = {
19-
Authorization: `Bearer ${ScriptApp.getOAuthToken()}`
22+
Authorization: `Bearer ${ScriptApp.getOAuthToken()}`,
2023
};
2124
this.mainObj = {};
2225
}
@@ -26,34 +29,35 @@
2629
gToM.call(this);
2730
return new WordApp(this.mainObj.blob).getTableColumnWidth();
2831
}
29-
30-
};
32+
}
3133

3234
DocumentAppp.name = "DocumentAppp";
3335

3436
// --- end methods
35-
gToM = function() {
37+
gToM = function () {
3638
var obj, url;
3739
url = `https://www.googleapis.com/drive/v3/files/${this.obj.documentId}/export?mimeType=${MimeType.MICROSOFT_WORD}`;
3840
obj = UrlFetchApp.fetch(url, {
39-
headers: this.headers
41+
headers: this.headers,
4042
});
4143
if (obj.getResponseCode() !== 200) {
42-
putError.call(this, "Document ID might be not correct. Please check it again.");
44+
putError.call(
45+
this,
46+
"Document ID might be not correct. Please check it again."
47+
);
4348
}
4449
this.mainObj.blob = obj.getBlob();
4550
};
4651

47-
putError = function(m) {
52+
putError = function (m) {
4853
throw new Error(`${m}`);
4954
};
5055

51-
putInternalError = function(m) {
56+
putInternalError = function (m) {
5257
throw new Error(`Internal error: ${m}`);
5358
};
5459

5560
return DocumentAppp;
56-
57-
}).call(this);
58-
return r.DocumentAppp = DocumentAppp;
61+
}.call(this);
62+
return (r.DocumentAppp = DocumentAppp);
5963
})(this);

0 commit comments

Comments
 (0)