🚚 add node-signpdf copy to signing packgage until npm includes fix

This commit is contained in:
Timur Ercan
2023-03-01 18:27:19 +01:00
parent eb38024c20
commit cfb0d94e84
23 changed files with 1522 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getPagesDictionaryRef;
var _SignPdfError = _interopRequireDefault(require("../../SignPdfError"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* @param {Object} info As extracted from readRef()
*/
function getPagesDictionaryRef(info) {
const pagesRefRegex = /\/Pages\s+(\d+\s+\d+\s+R)/g;
const match = pagesRefRegex.exec(info.root);
if (match === null) {
throw new _SignPdfError.default('Failed to find the pages descriptor. This is probably a problem in node-signpdf.', _SignPdfError.default.TYPE_PARSE);
}
return match[1];
}