MCPcopy
hub / github.com/jimp-dev/jimp / isBinary

Function isBinary

plugins/plugin-print/src/load-bitmap-font.ts:18–31  ·  view source on GitHub ↗
(buf: Buffer | string)

Source from the content-addressed store, hash-verified

16const HEADER = Buffer.from([66, 77, 70, 3]);
17
18function isBinary(buf: Buffer | string) {
19 if (typeof buf === "string") {
20 return buf.substring(0, 3) === "BMF";
21 }
22
23 const startOfHeader = buf.slice(0, 4);
24
25 return (
26 buf.length > 4 &&
27 startOfHeader[0] === HEADER[0] &&
28 startOfHeader[1] === HEADER[1] &&
29 startOfHeader[2] === HEADER[2]
30 );
31}
32
33export interface LoadedFont {
34 chars: BmCharacter[];

Callers 1

parseFontFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…