Skip to content

Commit

Permalink
Add null to resolve()
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlw committed May 6, 2021
1 parent 7e02bcd commit 45ddd41
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export const saveProject = (filepath: string, project: IProject) => {
if (err) {
return reject(err)
}
return resolve()
return resolve(null)
})
})
}
Expand Down Expand Up @@ -303,7 +303,7 @@ export async function createObjectContainerFilesystem(
access(`${projectpath}/Files/${path}`, constants.F_OK, (err) => {
if (err) {
mkdirp(`${projectpath}/Files/${path}`, (err) => {
return err ? reject() : resolve()
return err ? reject() : resolve(null)
})
}
})
Expand Down Expand Up @@ -380,7 +380,7 @@ export const moveFileToContainer = (
if (err) {
return reject(err)
}
resolve()
resolve(null)
})
}
return reject(err)
Expand All @@ -402,7 +402,7 @@ export const moveFile = (src: string, dest: string) => {
} catch (err) {
return reject(err)
}
resolve()
resolve(null)
})
})
}
Expand Down Expand Up @@ -444,7 +444,7 @@ export const renameWithPurposeSuffix = (
catch (err) {
return reject(err)
}
resolve()
resolve(null)
})
}

Expand All @@ -467,7 +467,7 @@ export const purposeFromFilename = (filename: string) => {
export const orphanFile = (src: string, projectpath: string) => {
return new Promise((resolve, reject) => {
if (projectpath === '') {
return resolve()
return resolve(null)
}

const path = src.replace(`${projectpath}/Files/`, '')
Expand All @@ -478,14 +478,14 @@ export const orphanFile = (src: string, projectpath: string) => {
} catch (err) {
return reject(err)
}
resolve()
resolve(null)
})
}

export const orphanObject = (item: IObject, projectpath: string) => {
return new Promise((resolve, reject) => {
if (projectpath === '') {
return resolve()
return resolve(null)
}

const orphanPath = `${projectpath}/Orphaned/`
Expand All @@ -505,7 +505,7 @@ export const orphanObject = (item: IObject, projectpath: string) => {
renameSync(src, dest)
} catch (err) { }

resolve()
resolve(null)
})
}

Expand Down

0 comments on commit 45ddd41

Please sign in to comment.