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

Update upload.ts #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update upload.ts #1

wants to merge 1 commit into from

Commits on Oct 3, 2024

  1. Update upload.ts

    Explanation of Changes:
    
    1   validatePinataHeaders Function: This utility checks the necessary headers, making the code cleaner and easier to extend.
    2.  Simplified Blob creation: If the contentType is not provided, the ?? '' ensures an empty string is used, which avoids unnecessary undefined checks.
    3.  Error Handling: More precise error messages are added to provide better context for potential failures during the fetch call.
    General Code Cleanup: Removed unnecessary type annotations where TypeScript could infer them automatically.
    
    This optimized code should now be more maintainable, efficient, and clearer, particularly in terms of error handling and the handling of HTTP requests.
    macfly-base authored Oct 3, 2024
    Configuration menu
    Copy the full SHA
    9b05637 View commit details
    Browse the repository at this point in the history