mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 14:59:05 +00:00
refactor(xar): reuse the signature recognizer (#17011)
This commit is contained in:
1 parent
3f9f6fce6c
commit
b17cd21c01
3 files changed
+2
-9
No files matched your search
@@ -8,13 +8,13 @@ import type {
|
||||
MacosPkgRefusal,
|
||||
} from "../domain/formatMetadata/macosPkgMetadata.js";
|
||||
import { artifactExpansionBudgetBytes } from "../domain/artifactExpansionBudget.js";
|
||||
import { hasXarMagic } from "../domain/binaryContainer.js";
|
||||
import {
|
||||
MACOS_PKG_FORMAT,
|
||||
MACOS_PKG_MAX_TOC_UNCOMPRESSED_BYTES,
|
||||
XAR_HEADER_MIN_BYTES,
|
||||
XAR_MAGIC_TEXT,
|
||||
XAR_VERSION,
|
||||
hasXarMagic,
|
||||
macosPkgCpioBudget,
|
||||
macosPkgLimitFailure,
|
||||
macosPkgMetadataBudget,
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { expect, it } from "vitest";
|
||||
|
||||
import { hasXarMagic } from "./binaryContainer.js";
|
||||
import {
|
||||
MACOS_PKG_MAX_CPIO_ARCHIVE_BYTES,
|
||||
MACOS_PKG_MAX_CPIO_MEMBERS,
|
||||
MACOS_PKG_MAX_TOC_PATH_BYTES,
|
||||
hasXarMagic,
|
||||
macosPkgCpioBudget,
|
||||
} from "./macosPkgFormat.js";
|
||||
|
||||
|
||||
@@ -146,13 +146,6 @@ export interface XarHeader {
|
||||
readonly heapOffset: number;
|
||||
}
|
||||
|
||||
export const hasXarMagic = (prefix: Uint8Array): boolean =>
|
||||
prefix.length >= 4 &&
|
||||
prefix[0] === 0x78 &&
|
||||
prefix[1] === 0x61 &&
|
||||
prefix[2] === 0x72 &&
|
||||
prefix[3] === 0x21;
|
||||
|
||||
export const macosPkgLimitFailure = (
|
||||
message: string,
|
||||
limit: {
|
||||
|
||||
Reference in new issue
Block a user