chore: reformat some files
This commit is contained in:
parent
8751180634
commit
aa72708996
@ -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(
|
||||
|
@ -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: {} }
|
||||
|
Loading…
Reference in New Issue
Block a user