Apply prettier config to all files

This commit is contained in:
Ephraim Atta-Duncan
2023-04-04 22:02:32 +00:00
parent 85f2b5e84a
commit 84b57d715c
94 changed files with 956 additions and 1386 deletions

View File

@ -1,13 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
value: true,
});
exports.default = void 0;
var _SignPdfError = _interopRequireDefault(require("../SignPdfError"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : { default: obj };
}
const sliceLastChar = (pdf, character) => {
const lastChar = pdf.slice(pdf.length - 1).toString();
@ -26,23 +28,25 @@ const sliceLastChar = (pdf, character) => {
* @returns {Buffer}
*/
const removeTrailingNewLine = pdf => {
const removeTrailingNewLine = (pdf) => {
if (!(pdf instanceof Buffer)) {
throw new _SignPdfError.default('PDF expected as Buffer.', _SignPdfError.default.TYPE_INPUT);
throw new _SignPdfError.default("PDF expected as Buffer.", _SignPdfError.default.TYPE_INPUT);
}
let output = pdf;
output = sliceLastChar(output, '\n');
output = sliceLastChar(output, '\r');
output = sliceLastChar(output, "\n");
output = sliceLastChar(output, "\r");
const lastLine = output.slice(output.length - 6).toString();
if (lastLine !== '\n%%EOF') {
throw new _SignPdfError.default('A PDF file must end with an EOF line.', _SignPdfError.default.TYPE_PARSE);
if (lastLine !== "\n%%EOF") {
throw new _SignPdfError.default(
"A PDF file must end with an EOF line.",
_SignPdfError.default.TYPE_PARSE
);
}
return output;
};
var _default = removeTrailingNewLine;
exports.default = _default;
exports.default = _default;