Skip to content

Commit a28b454

Browse files
refactor: ♻️ lint
1 parent 9883258 commit a28b454

File tree

5 files changed

+30
-17
lines changed

5 files changed

+30
-17
lines changed

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 4,
4+
"singleQuote": true
5+
}

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ cordova plugin add cordova-plugin-simple-file-chooser
1919

2020
```js
2121
/**
22-
* Displays native prompt for user to select one or more files.
23-
*
24-
* @param accept Optional MIME type filter (e.g. 'image/gif,video/*').
25-
*
26-
* @returns Promise containing selected files' information,
27-
* MIME type, display name, and original URI.
28-
*
29-
* If user cancels, promise will be resolved as undefined.
30-
* If error occurs, promise will be rejected.
31-
*/
22+
* Displays native prompt for user to select one or more files.
23+
*
24+
* @param accept Optional MIME type filter (e.g. 'image/gif,video/*').
25+
*
26+
* @returns Promise containing selected files' information,
27+
* MIME type, display name, and original URI.
28+
*
29+
* If user cancels, promise will be resolved as undefined.
30+
* If error occurs, promise will be rejected.
31+
*/
3232
chooser.getFiles(accept?: string) : Promise<undefined|{
3333
mediaType: string;
3434
name: string;
@@ -47,4 +47,4 @@ chooser.getFiles(accept?: string) : Promise<undefined|{
4747

4848
### Note
4949

50-
If calling in typescript don't use types instead use direct javascript by `declare var chooser` on your ts file.
50+
If calling in typescript don't use types instead use direct javascript by `declare var chooser` on your ts file.

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
"scripts": {
3131
"test": "echo \"Error: no test specified\" && exit 1"
3232
}
33-
}
33+
}

www/chooser.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ module.exports = {
55
function (json) {
66
try {
77
resolve(JSON.parse(json));
8-
}
9-
catch (err) {
8+
} catch (err) {
109
reject(err);
1110
}
1211
},
1312
reject,
1413
'Chooser',
1514
'getFiles',
16-
[(typeof accept === 'string' ? accept.replace(/\s/g, '') : undefined) || '*/*']
15+
[
16+
(typeof accept === 'string'
17+
? accept.replace(/\s/g, '')
18+
: undefined) || '*/*',
19+
]
1720
);
1821
});
1922

@@ -25,5 +28,5 @@ module.exports = {
2528
}
2629

2730
return result;
28-
}
29-
};
31+
},
32+
};

0 commit comments

Comments
 (0)