-
Notifications
You must be signed in to change notification settings - Fork 7
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
[APP-14984] - Fix resolvedSchemas.json adding required fields #196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appreciate the refactor to .ts
|
||
for SCHEMA_FILENAME in $(ls src/schemas | sort); do | ||
SCHEMA=$(echo $SCHEMA_FILENAME | cut -d . -f 1) | ||
sed -i "" "\|$MARKER|a\\ | ||
sed -i"" "\|$MARKER|a\\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sed -i"" "\|$MARKER|a\\ | |
sed -i "" "\|$MARKER|a\\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fix to make it work equal on linux and macos. The previous code just worked on mac.
} | ||
/** | ||
* sortObject sorts an objects and returns an object with keys in alphabetical | ||
* order | ||
* @param { Object } obj | ||
* @returns an object with the keys in sorted alphabetical order | ||
*/ | ||
function sortObject(obj) { | ||
function sortObject<T extends Record<string, unknown>>(obj: T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be generic?
Would this not work?
function sortObject<T extends Record<string, unknown>>(obj: T) { | |
function sortObject(obj: Record<string, unknown>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type need to be generic so the type returned is the same type passed to the function. In your suggestion the returned type will be Record<string, unknown>
.
@@ -7,7 +7,7 @@ jobs: | |||
strategy: | |||
fail-fast: false | |||
matrix: | |||
node-version: [14.x] | |||
node-version: [18.x] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
No description provided.