chore: reformat some files

This commit is contained in:
Julien Fontanet 2018-11-28 19:10:51 +01:00
parent 8751180634
commit aa72708996
2 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,7 @@ const GRAIN_ADDRESS_OFFSET = 56
* the grain table is the array of LBAs (in byte, not in sector) ordered by their position in the VDMK file
* THIS CODE RUNS ON THE BROWSER
*/
export default async function readVmdkGrainTable (fileAccessor) {
export default async function readVmdkGrainTable(fileAccessor) {
const getLongLong = (buffer, offset, name) => {
if (buffer.length < offset + 8) {
throw new Error(

View File

@ -85,13 +85,13 @@ const filterDisks = disks => {
// ===================================================================
/* global FileReader */
async function readFileFragment (file, start = 0, end) {
async function readFileFragment(file, start = 0, end) {
const reader = new FileReader()
reader.readAsArrayBuffer(file.slice(start, end))
return (await fromEvent(reader, 'loadend')).target.result
}
function parseTarHeader (header) {
function parseTarHeader(header) {
const fileName = Buffer.from(header.slice(0, 100))
.toString('ascii')
.split('\0')[0]
@ -105,7 +105,7 @@ function parseTarHeader (header) {
return { fileName, fileSize }
}
async function parseOVF (fileFragment) {
async function parseOVF(fileFragment) {
const xmlString = Buffer.from(await readFileFragment(fileFragment)).toString()
return new Promise((resolve, reject) =>
xml2js.parseString(
@ -172,7 +172,7 @@ async function parseOVF (fileFragment) {
)
}
async function parseTarFile (file) {
async function parseTarFile(file) {
let offset = 0
const HEADER_SIZE = 512
let data = { tables: {} }