Skip to content

Commit 462a34c

Browse files
committed
Fix linting errors
1 parent c8112ea commit 462a34c

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

create-or-update-files.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@ function isBase64(str) {
55
}
66

77
var notBase64 = /[^A-Z0-9+\/=]/i;
8-
const isString = (typeof str === 'string' || str instanceof String);
8+
const isString = typeof str === "string" || str instanceof String;
99

1010
if (!isString) {
1111
let invalidType;
1212
if (str === null) {
13-
invalidType = 'null';
13+
invalidType = "null";
1414
} else {
1515
invalidType = typeof str;
16-
if (invalidType === 'object' && str.constructor && str.constructor.hasOwnProperty('name')) {
16+
if (
17+
invalidType === "object" &&
18+
str.constructor &&
19+
str.constructor.hasOwnProperty("name")
20+
) {
1721
invalidType = str.constructor.name;
1822
} else {
1923
invalidType = `a ${invalidType}`;
@@ -26,10 +30,12 @@ function isBase64(str) {
2630
if (!len || len % 4 !== 0 || notBase64.test(str)) {
2731
return false;
2832
}
29-
const firstPaddingChar = str.indexOf('=');
30-
return firstPaddingChar === -1 ||
33+
const firstPaddingChar = str.indexOf("=");
34+
return (
35+
firstPaddingChar === -1 ||
3136
firstPaddingChar === len - 1 ||
32-
(firstPaddingChar === len - 2 && str[len - 1] === '=');
37+
(firstPaddingChar === len - 2 && str[len - 1] === "=")
38+
);
3339
}
3440

3541
module.exports = function (octokit, opts) {

create-or-update-files.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ test(`success (buffer body provided)`, async () => {
245245
"test.md": Buffer.from(
246246
`# This is a test
247247
248-
I hope it works`
248+
I hope it works`,
249249
),
250250
"test2.md": {
251251
contents: `Something else`,

0 commit comments

Comments
 (0)