mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs(docs-infra): Remove leading path from zipped files. (#59726)
In certain circonstances, a leading slash in the file paths created a incorrect unarchived project. fixes #57075 PR Close #59726
This commit is contained in:
parent
ccebbbae6e
commit
97897eebd8
1 changed files with 3 additions and 0 deletions
|
|
@ -14,6 +14,9 @@ import {zip, strToU8} from 'fflate';
|
|||
export async function generateZip(files: FileAndContent[]): Promise<Uint8Array> {
|
||||
const filesObj: Record<string, Uint8Array> = {};
|
||||
files.forEach(({path, content}) => {
|
||||
if (path.startsWith('/')) {
|
||||
path = path.slice(1);
|
||||
}
|
||||
filesObj[path] = typeof content === 'string' ? strToU8(content) : content;
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue