'use strict'
/**
 * util.js
 * Contains essential common utilities required
 ******************************/
const fs = require('fs')
const path = require('path')

exports.checkDirectorySync = function (dir) {
  return exports.checkFileSync(dir)
}

exports.checkFileSync = function (path) {
  try {
    fs.accessSync(path, fs.F_OK)
  } catch (err) {
    if (err.code === 'ENOENT') return false
  }
  return true
}

exports.streamToString = function (stream, callback) {
  const chunks = []
  stream.on('data', (chunk) => {
    chunks.push(chunk)
  })
  stream.on('error', function (err) {
    callback(err)
  })
  stream.on('end', () => {
    callback(null, chunks.join(''))
  })
}

@@ -411,272 +411,4 @@
 e%0A%7D%0A
-%0Aexports.streamToString = function (stream, callback) %7B%0A  const chunks = %5B%5D%0A  stream.on('data', (chunk) =%3E %7B%0A    chunks.push(chunk)%0A  %7D)%0A  stream.on('error', function (err) %7B%0A    callback(err)%0A  %7D)%0A  stream.on('end', () =%3E %7B%0A    callback(null, chunks.join(''))%0A  %7D)%0A%7D%0A

remove superflous code