55 * correctly in Grid3 gridsets.
66 */
77
8- import { openZipFromInput } from '../../utils/zip' ;
8+ import { openZipFromInput , type ZipAdapter } from '../../utils/zip' ;
99import { getZipEntriesFromAdapter } from './password' ;
1010import { resolveGridsetPasswordFromEnv } from './password' ;
1111import { XMLParser } from 'fast-xml-parser' ;
12- import { decodeText } from '../../utils/io' ;
12+ import { decodeText , type ProcessorInput } from '../../utils/io' ;
1313
1414export interface ImageIssue {
1515 gridName : string ;
@@ -45,7 +45,8 @@ export interface ImageAuditResult {
4545 */
4646export async function auditGridsetImages (
4747 gridsetBuffer : Uint8Array ,
48- password = resolveGridsetPasswordFromEnv ( )
48+ password = resolveGridsetPasswordFromEnv ( ) ,
49+ zipAdapter ?: ( input : ProcessorInput ) => Promise < { zip : ZipAdapter } >
4950) : Promise < ImageAuditResult > {
5051 const issues : ImageIssue [ ] = [ ] ;
5152 const availableImages = new Set < string > ( ) ;
@@ -55,7 +56,10 @@ export async function auditGridsetImages(
5556 let unresolvedImages = 0 ;
5657
5758 try {
58- const { zip } = await openZipFromInput ( gridsetBuffer ) ;
59+ const { zip } = zipAdapter
60+ ? await zipAdapter ( gridsetBuffer )
61+ : await openZipFromInput ( gridsetBuffer ) ;
62+
5963 const entries = getZipEntriesFromAdapter ( zip , password ) ;
6064 const parser = new XMLParser ( ) ;
6165
0 commit comments