Skip to content

Commit

Permalink
🐛 export Signer and SignPdfError from utils
Browse files Browse the repository at this point in the history
Consumers of the library may want to implement their own Signer or even catch and make
assertions of errors. Exposing the classes from utils through this library means that
consumers don't have to manually require the sub-package themselves, which helps avoid
dependency resolution issues that can sometimes happen in npm when root projects and
dependencies have slightly mis-matched version requirements.
  • Loading branch information
dhensby authored and vbuch committed Nov 24, 2023
1 parent accbbad commit 288ce7c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/signpdf/dist/signpdf.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ export type SignerOptions = {
asn1StrictParsing?: boolean;
};
import { Signer } from '@signpdf/utils';
import { SignPdfError } from '@signpdf/utils';
export { Signer, SignPdfError };
//# sourceMappingURL=signpdf.d.ts.map
2 changes: 1 addition & 1 deletion packages/signpdf/dist/signpdf.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion packages/signpdf/dist/signpdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,20 @@
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.SignPdf = void 0;
exports.SignPdf = void 0;
Object.defineProperty(exports, "SignPdfError", {
enumerable: true,
get: function () {
return _utils.SignPdfError;
}
});
Object.defineProperty(exports, "Signer", {
enumerable: true,
get: function () {
return _utils.Signer;
}
});
exports.default = void 0;
var _utils = require("@signpdf/utils");
/**
* @typedef {object} SignerOptions
Expand Down
2 changes: 2 additions & 0 deletions packages/signpdf/src/signpdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
Signer,
} from '@signpdf/utils';

export {Signer, SignPdfError};

/**
* @typedef {object} SignerOptions
* @prop {string} [passphrase]
Expand Down

0 comments on commit 288ce7c

Please sign in to comment.