initial commit

This commit is contained in:
nxglabs
2023-10-22 01:37:25 +05:30
parent 80327652c3
commit 97fd28697a
182 changed files with 55033 additions and 122 deletions
@@ -0,0 +1,21 @@
import SignPdfError from './SignPdfError.js';
/**
* @param {object} refTable
* @param {string} ref
* @returns {number}
*/
const getIndexFromRef = (refTable, ref) => {
let [index] = ref.split(' ');
index = parseInt(index);
if (!refTable.offsets.has(index)) {
throw new SignPdfError(
`Failed to locate object "${ref}".`,
SignPdfError.TYPE_PARSE,
);
}
return index;
};
export default getIndexFromRef;