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

Code cleanup, expand README, fix some minor bugs #20

Merged
merged 31 commits into from
May 9, 2024

Conversation

3vorp
Copy link
Contributor

@3vorp 3vorp commented Apr 14, 2024

(from changelog, make sure to add the release number and date when this gets merged)

Added

  • Exposed Collection.collectionName as a readonly property for TypeScript usage.
  • TypeScript overview to the README.
  • Optional replacement argument for array-splice edit fields.
  • array-contains-none option for array fields.
  • Optional constructor for the JSONDatabase PHP class to reduce repetitive code.
  • "Advanced" section to the README for previously undocumented features.
  • original option for readRaw to not insert ID fields, for easier non-relational collection usage.

Changed

  • Rejected incorrect parameters are now TypeErrors instead of regular Errors.
  • Deprecated firestorm.table(name) method, since firestorm.collection(name) does exactly the same thing.
  • Reformatted the repository and improved README.md to make it easier to set up Firestorm.
  • Clean up and standardize JSDoc comments.
  • editField and editFieldBulk now return confirmations like all other write methods.
  • editField and editFieldBulk now reject with a descriptive error message on failure rather than silently failing.

Fixed

  • PHP-level errors not being rejected properly in GET requests.
  • Certain write commands mutating data internally and affecting parameters outside Firestorm.
  • Collection.searchKeys and Collection.values not returning proper Error objects sometimes.
  • files.upload not allowing the form-data package's typing of FormData in TypeScript.
  • Inconsistent use of indentation and formatting in PHP files.
  • Various typos in PHP files.
  • Collection class being exported in TypeScript despite the actual class being private.
  • array-splice edit fields being incorrectly typed as array-slice.
  • Platform-specific PHP error when searching nested keys.
  • Collection.remove rejecting numeric keys, despite Collection.removeBulk not doing so.
  • editField and editFieldBulk validation issues.

- Upgraded __get_request to match __write_data better and have less redundant code
- Fixed __write_data overwriting keys sometimes
- Failed GET requests now reject directly
- added collectionName to typescript
- return TypeErrors more consistently
tests/js-test.spec.js Show resolved Hide resolved
typings/index.d.ts Show resolved Hide resolved
typings/index.d.ts Show resolved Hide resolved
typings/index.d.ts Outdated Show resolved Hide resolved
@3vorp 3vorp requested a review from TheRolfFR April 16, 2024 02:47
tests/config.php Outdated Show resolved Hide resolved
@3vorp 3vorp requested a review from TheRolfFR April 22, 2024 00:40
Copy link
Owner

@TheRolfFR TheRolfFR left a comment

Choose a reason for hiding this comment

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

For real, what's the point of modifying my code, you're just modifying code to modify code.

It's useless, and you removed my sec function. Why, I don't know, but if I made it, it's so that I can modify the content later if needed

tests/tokens.php Outdated Show resolved Hide resolved
@3vorp
Copy link
Contributor Author

3vorp commented Apr 30, 2024

I'm just trying to make the code cleaner, it was really inconsistent before and most of the changes are simply running a formatter and linter.

php/classes/JSONDatabase.php Outdated Show resolved Hide resolved
@3vorp 3vorp changed the title Fix various small issues I noticed Code cleanup, expand README, fix some minor bugs Apr 30, 2024
@TheRolfFR TheRolfFR merged commit 00e8c93 into TheRolfFR:main May 9, 2024
2 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.

None yet

2 participants