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

Sweep: Update CODES.md file with latest currency codes, names, and rates #269

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

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented May 31, 2024

Purpose

The purpose of this pull request is to update the CODES.md file with the latest currency codes, names, and rates from the provided JSON response.

Description

The changes in this pull request include:

  1. Importing the necessary modules (fs and path) to read and write the CODES.md file.
  2. Adding a new function updateCodes that takes a JSON response string as input and updates the CODES.md file with the latest currency information.
  3. The updateCodes function performs the following steps:
    • Parses the JSON response into a JavaScript object.
    • Extracts the currency code, name, and rate from each object in the data array.
    • Sorts the currency entries alphabetically by currency code.
    • Gets the current date and formats it as "YYYY-MM-DD".
    • Reads the contents of the CODES.md file.
    • Replaces the existing currency list with the sorted entries and updates the "updated" date.
    • Writes the updated contents back to the CODES.md file.

Summary

The changes in this pull request include:

  • Updating the src/index.ts file with the new updateCodes function.
  • Updating the CODES.md file with the latest currency codes, names, and rates from the provided JSON response.

Fixes #268.


Tip

To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

This is an automated message generated by Sweep AI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sweep: Update de CODES.md file
1 participant