( offset: number, opts: Partial<ITarWriteOptions>, fileType: TarFileType, )
| 312 | } |
| 313 | |
| 314 | private fillHeader( |
| 315 | offset: number, |
| 316 | opts: Partial<ITarWriteOptions>, |
| 317 | fileType: TarFileType, |
| 318 | ) { |
| 319 | const { uid, gid, mode, mtime, user, group } = { |
| 320 | uid: 1000, |
| 321 | gid: 1000, |
| 322 | mode: fileType === TarFileTypeCodes.File ? 0o664 : 0o775, |
| 323 | mtime: Math.trunc(Date.now() / 1000), |
| 324 | user: "tarballjs", |
| 325 | group: "tarballjs", |
| 326 | ...opts, |
| 327 | }; |
| 328 | |
| 329 | this.writeFileMode(mode, offset); |
| 330 | this.writeFileUid(uid, offset); |
| 331 | this.writeFileGid(gid, offset); |
| 332 | this.writeFileMtime(mtime, offset); |
| 333 | |
| 334 | this.writeString("ustar", offset + 257, 6); // magic string |
| 335 | this.writeString("00", offset + 263, 2); // magic version |
| 336 | |
| 337 | this.writeFileUser(user, offset); |
| 338 | this.writeFileGroup(group, offset); |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | function getArrayBuffer(file: string | ArrayBuffer | Uint8Array | Blob) { |
no test coverage detected