Skip to content

Conversation

@Fdawgs
Copy link
Owner

@Fdawgs Fdawgs commented Dec 2, 2025

Whilst it is a private field, it is still possible to accidentally change these values, so protect against that.

Checklist

Copilot AI review requested due to automatic review settings December 2, 2025 11:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces object freezing for the #acceptedOptions configuration objects stored in the Poppler class to prevent accidental modifications. While the intent is good defensive programming, the implementation uses a new external dependency ice-barrage instead of JavaScript's built-in Object.freeze().

Key Changes

  • Added ice-barrage ^1.0.0 as a production dependency
  • Wrapped all #acceptedOptions object literals with freeze() calls across 11 PDF utility method configurations (pdfAttach, pdfDetach, pdfFonts, pdfImages, pdfInfo, pdfSeparate, pdfToCairo, pdfToHtml, pdfToPpm, pdfToPs, pdfToText, pdfUnite)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
package.json Added ice-barrage ^1.0.0 dependency for object freezing functionality
src/index.js Imported freeze from ice-barrage and wrapped all accepted options configurations with freeze() calls to make them immutable

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@Fdawgs Fdawgs merged commit ba5f382 into main Dec 2, 2025
23 checks passed
@Fdawgs Fdawgs deleted the refactor/index-freeze branch December 2, 2025 11:25
@Fdawgs Fdawgs linked an issue Dec 2, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deep freeze #acceptedOptions to prevent mutation

2 participants