code: function filterValidFiles (_files, checkExtension, warningCallback) {
    var file, fileName, extension, hasValidExtension, filteredFiles = []
    for (var i = 0, l = _files.length; i < l; i++) {
      file = _files[i]
      fileName = file.name
      if (typeof fileName === 'string') {
        // ignore system files
        if (fileName[0] === '.' || fileName.substring(0, 9) === '__MACOSX/') {
          continue
        }
        // check extensions
        extension = fileName.split('.').length > 1 ? '.' + fileName.split('.').pop().toLowerCase() : null
        if (!extension) {
          console.error('File ' + fileName + ' has no extension and will be ignored.')
          warningCallback('File ' + fileName + ' has no extension and will be ignored.')
        } else {
          hasValidExtension = EXTENSION_WHITE_LIST.indexOf(extension) > -1
          if (checkExtension && !hasValidExtension) {
            console.error('File ' + fileName + ' is not supported and will be ignored.')
            warningCallback('File ' + fileName + ' is not supported and will be ignored.')
          } else {
            filteredFiles[filteredFiles.length] = file
          }
        }
      }
    }
    return filteredFiles
  }
docs: private methods