From 93a669bd907cc60784ee95a31f7708ba566ed323 Mon Sep 17 00:00:00 2001 From: MuchtarSalimov Date: Tue, 16 Oct 2018 14:01:46 -0400 Subject: [PATCH] Extended to check for more undefined parameters --- src/filesystem/implementation.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/filesystem/implementation.js b/src/filesystem/implementation.js index e11be52..303e56d 100644 --- a/src/filesystem/implementation.js +++ b/src/filesystem/implementation.js @@ -1874,6 +1874,18 @@ function appendFile(fs, context, path, data, options, callback) { if (typeof options === 'object' && options.encoding === undefined ) { options.encoding = 'utf8'; } + + if typeof (options ==== 'object') { + if (options.encoding === undefined) { + options.encoding = 'utf8'; + } + if (options.mode === undefined) { + options.mode = 0o666; + } + if (options.flag === undefined) { + options.flag = 'a'; + } + } data = data || ''; if(typeof data === 'number') {