Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(file): allow File.writeFile() and File.writeExistingFile() accept Blob #527

Merged
merged 1 commit into from
Sep 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/plugins/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,12 @@ export class File {
*
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
* @param {string} fileName path relative to base path
* @param {string} text content to write
* @param {string | Blob} text content or blob to write
* @param {boolean | WriteOptions} replaceOrOptions replace file if set to true. See WriteOptions for more information.
* @returns {Promise<void>} Returns a Promise that resolves or rejects with an error.
*/
static writeFile(path: string, fileName: string,
text: string, replaceOrOptions: boolean | WriteOptions): Promise<void> {
text: string | Blob, replaceOrOptions: boolean | WriteOptions): Promise<void> {
if ((/^\//.test(fileName))) {
let err = new FileError(5);
err.message = 'file-name cannot start with \/';
Expand Down Expand Up @@ -701,10 +701,10 @@ export class File {
*
* @param {string} path Base FileSystem. Please refer to the iOS and Android filesystems above
* @param {string} fileName path relative to base path
* @param {string} text content to write
* @param {string | Blob} text content or blob to write
* @returns {Promise<void>} Returns a Promise that resolves or rejects with an error.
*/
static writeExistingFile(path: string, fileName: string, text: string): Promise<void> {
static writeExistingFile(path: string, fileName: string, text: string | Blob): Promise<void> {
if ((/^\//.test(fileName))) {
let err = new FileError(5);
err.message = 'file-name cannot start with \/';
Expand Down