Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only use matterWrapper #834

Merged
merged 3 commits into from
Sep 28, 2023
Merged

only use matterWrapper #834

merged 3 commits into from
Sep 28, 2023

Conversation

tyler17
Copy link
Collaborator

@tyler17 tyler17 commented Sep 27, 2023

use the same config in all gray-matter matter() calls

@vercel
Copy link

vercel bot commented Sep 27, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
governance-portal-v2 ✅ Ready (Inspect) Visit Preview Sep 27, 2023 11:56pm

@what-the-diff
Copy link

what-the-diff bot commented Sep 27, 2023

PR Summary

  • Introduction of a New Function for Code Sanitization
    A new function called matterWrapper has been added to a new file named lib/matter.ts. The purpose of the function is to sanitize JavaScript code and prevent unwanted operations such as parsing or stringifying JavaScript. It's essentially a safer version of the function matter from the gray-matter library.

  • Implementation of the New function across Several Modules
    The matterWrapper function has replaced the import of matter in multiple files across different modules, adding an additional layer of code sanitization. These files include different API fetch files (e.g., fetchAvcs.ts, fetchGithubDelegates.ts, parseExecutive.ts, fetchPollMetadata.ts), helper files including their tests (parsePollMetadata.spec.ts, validatePollParameters.spec.ts, validator.spec.ts, parsePollMetadata.ts, validator.ts), and in the executive module's creation page (create.tsx). This change results in higher security and less risk of unexpected behavior during navigation and data fetching.

hernandoagf
hernandoagf previously approved these changes Sep 27, 2023
Copy link
Collaborator

@hernandoagf hernandoagf left a comment

Choose a reason for hiding this comment

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

LGTM

@tyler17 tyler17 merged commit 0304b71 into master Sep 28, 2023
4 of 6 checks passed
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.

2 participants