MCPcopy Create free account
hub / github.com/Shazbot/WH3-Mod-Manager / writePack

Function writePack

src/packFileSerializer.ts:1972–1991  ·  view source on GitHub ↗
(
  packFiles: NewPackedFile[],
  path: string,
  existingPackToAppend?: Pack,
  replaceDuplicates?: boolean,
  dependencyPacks: string[] = [],
)

Source from the content-addressed store, hash-verified

1970 }
1971};
1972export const writePack = async (
1973 packFiles: NewPackedFile[],
1974 path: string,
1975 existingPackToAppend?: Pack,
1976 replaceDuplicates?: boolean,
1977 dependencyPacks: string[] = [],
1978) => {
1979 // Use fast append implementation when we have an existing pack
1980 if (existingPackToAppend) {
1981 return await writePackAppendFast(
1982 packFiles,
1983 path,
1984 existingPackToAppend,
1985 replaceDuplicates,
1986 dependencyPacks,
1987 );
1988 }
1989 // Fallback to sorted implementation for new packs
1990 return await writePackSorted(packFiles, path, dependencyPacks);
1991};
1992// Legacy implementation (kept for reference, but replaced by the optimized versions above)
1993export const writePackLegacy = async (
1994 packFiles: NewPackedFile[],

Callers 4

executeSaveTextNodeFunction · 0.90
executeSaveChangesNodeFunction · 0.90
registerIpcMainListenersFunction · 0.90
executeDBDuplicationFunction · 0.85

Calls 2

writePackAppendFastFunction · 0.85
writePackSortedFunction · 0.85

Tested by

no test coverage detected