mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-11 01:14:35 +01:00
fix(decrypt): remove redundant password trim check and empty file condition
test(pdf-tools): update expected tool count to 41
This commit is contained in:
1 parent
f3e7ef25fa
commit
12753349ec
2 files changed
+3
-3
No files matched your search
@@ -12,7 +12,7 @@ export async function decrypt() {
|
||||
document.getElementById('password-input') as HTMLInputElement
|
||||
)?.value;
|
||||
|
||||
if (!password?.trim()) {
|
||||
if (!password) {
|
||||
showAlert('Input Required', 'Please enter the PDF password.');
|
||||
return;
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export async function decrypt() {
|
||||
showLoader('Preparing download...');
|
||||
const outputFile = qpdf.FS.readFile(outputPath, { encoding: 'binary' });
|
||||
|
||||
if (!outputFile || outputFile.length === 0) {
|
||||
if (outputFile.length === 0) {
|
||||
throw new Error('Decryption resulted in an empty file.');
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('Tool Configuration Arrays', () => {
|
||||
|
||||
it('should have the correct number of tools', () => {
|
||||
// This acts as a snapshot test to catch unexpected additions/removals.
|
||||
expect(singlePdfLoadTools).toHaveLength(40);
|
||||
expect(singlePdfLoadTools).toHaveLength(41);
|
||||
});
|
||||
|
||||
it('should not contain any duplicate tools', () => {
|
||||
|
||||
Reference in new issue
Block a user