Skip to content

Instantly share code, notes, and snippets.

@etc-tiago
Created September 9, 2022 01:56
Show Gist options
  • Save etc-tiago/19cb304e0444a8edd952a310bc039442 to your computer and use it in GitHub Desktop.
Save etc-tiago/19cb304e0444a8edd952a310bc039442 to your computer and use it in GitHub Desktop.
const isPDF = (buf) =>
Buffer.isBuffer(buf) &&
buf.lastIndexOf('%PDF-') === 0 &&
buf.lastIndexOf('%%EOF') > -1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment