Skip to content

Commit

Permalink
Allow for async modify
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Oct 15, 2023
1 parent f2632ad commit da81690
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/projector/otto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export interface IFilePatch {
* @param data The data to modify.
* @returns Modified data.
*/
modify: (data: Uint8Array) => Uint8Array;
modify: (data: Uint8Array) => Promise<Uint8Array> | Uint8Array;

/**
* Run after all patches.
Expand Down
3 changes: 2 additions & 1 deletion src/projector/otto/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ export class ProjectorOttoWindows extends ProjectorOtto {
if (!data) {
throw new Error(`Failed to read: ${entry.volumePath}`);
}
data = patch.modify(data);
// eslint-disable-next-line no-await-in-loop
data = await patch.modify(data);
}
}

Expand Down

0 comments on commit da81690

Please sign in to comment.