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

Create JSONHelper.lua #325

Merged
merged 4 commits into from
Oct 3, 2023
Merged

Create JSONHelper.lua #325

merged 4 commits into from
Oct 3, 2023

Conversation

jdahlblom
Copy link
Contributor

@jdahlblom jdahlblom commented Oct 2, 2023

Wondering how to isolate it more in regards of JSON.lua.

@jdahlblom jdahlblom marked this pull request as ready for review October 2, 2023 16:41
Copy link
Member

@charliefoxtwo charliefoxtwo left a comment

Choose a reason for hiding this comment

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

Looks like stylua wasn't run on this file (likely not running on any files in this folder).

It may be possible for us to just use require("JSON"), not sure.


--- @func Encodes to JSON and writes to file
--- @param filename string File name including path
--- @return any
Copy link
Member

Choose a reason for hiding this comment

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

return type should be specified (it's a table, I believe? { [string]: any } maybe?)

--- @param value any
--- @param filename string File name including path
function JSONHelper.encode_to_file(value, filename)
local JSON = BIOS.json
Copy link
Member

Choose a reason for hiding this comment

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

The only place BIOS.json will be used is in this file, right? I'm thinking at the very least we should get rid of BIOS.json and just keep that definition local to this file.

@jdahlblom
Copy link
Contributor Author

Looks like stylua wasn't run on this file (likely not running on any files in this folder).
I will add it

@jdahlblom jdahlblom added this pull request to the merge queue Oct 3, 2023
Merged via the queue into DCS-Skunkworks:master with commit ac28c4d Oct 3, 2023
2 checks passed
@jdahlblom jdahlblom deleted the json-helper-module branch October 3, 2023 06:46
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