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

feat: support bracket notation for arrays #15

Merged
merged 2 commits into from
Aug 20, 2024

Conversation

Balastrong
Copy link
Contributor

@Balastrong Balastrong commented Aug 19, 2024

This PR resolves #14

I just launched Copilot Workspace and tweaked the output a bit, if this PR doesn't make any sense feel free to discard it but... tests are passing :D


Add support for bracket notation for arrays in form data decoding.

  • README.md

    • Update examples to include bracket notation for arrays.
    • Add a note explaining that both dot and bracket notation are supported.
  • src/decode.test.ts

    • Add tests for decoding arrays using bracket notation.
    • Ensure existing tests for dot notation are not affected.
  • src/decode.ts

    • Update the decode function to handle bracket notation for arrays.
    • Modify the logic to parse and decode form data entries with bracket notation.

For more details, open the Copilot Workspace session.

This PR resolves fabian-hiller#14

I just launched Copilot Workspace and tweaked the output a bit, if this PR doesn't make any sense feel free to discard it but... tests are passing :D

---

Add support for bracket notation for arrays in form data decoding.

* **README.md**
  - Update examples to include bracket notation for arrays.
  - Add a note explaining that both dot and bracket notation are supported.

* **src/decode.test.ts**
  - Add tests for decoding arrays using bracket notation.
  - Ensure existing tests for dot notation are not affected.

* **src/decode.ts**
  - Update the `decode` function to handle bracket notation for arrays.
  - Modify the logic to parse and decode form data entries with bracket notation.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/fabian-hiller/decode-formdata?shareId=XXXX-XXXX-XXXX-XXXX).
@fabian-hiller fabian-hiller self-assigned this Aug 19, 2024
@fabian-hiller fabian-hiller added the enhancement New feature or request label Aug 19, 2024
@fabian-hiller
Copy link
Owner

At first glance it looks pretty good. I will try to check it out in detail later this week.

@Balastrong Balastrong marked this pull request as ready for review August 19, 2024 13:07
@fabian-hiller fabian-hiller force-pushed the support-bracket-notation branch from 6008bde to d03c0a9 Compare August 20, 2024 15:46
@fabian-hiller fabian-hiller force-pushed the support-bracket-notation branch from d03c0a9 to e0fbdd5 Compare August 20, 2024 15:48
@fabian-hiller fabian-hiller merged commit db319f4 into fabian-hiller:main Aug 20, 2024
4 checks passed
@fabian-hiller
Copy link
Owner

v0.8.0 is available

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

Successfully merging this pull request may close these issues.

The field in the format text[$].text is not decoded
2 participants