mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 21:46:01 +00:00
12 lines
278 B
TypeScript
12 lines
278 B
TypeScript
/** Check a schema-validated nonnegative byte range against its carrier size. */
|
|
export const insideArtifact =
|
|
(fileBytes: number) =>
|
|
({
|
|
offset,
|
|
bytes,
|
|
}: {
|
|
readonly offset: number;
|
|
readonly bytes: number;
|
|
}): boolean =>
|
|
offset <= fileBytes - bytes;
|