-
Notifications
You must be signed in to change notification settings - Fork 53
fix: parseEntities returns array instead of record<string, parsedenti… #382
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"@dojoengine/sdk": patch | ||
"template-vite-ts": patch | ||
"@dojoengine/core": patch | ||
"@dojoengine/create-burner": patch | ||
"@dojoengine/create-dojo": patch | ||
"@dojoengine/predeployed-connector": patch | ||
"@dojoengine/react": patch | ||
"@dojoengine/state": patch | ||
"@dojoengine/torii-client": patch | ||
"@dojoengine/torii-wasm": patch | ||
"@dojoengine/utils": patch | ||
"@dojoengine/utils-wasm": patch | ||
--- | ||
|
||
parseEntities now returns Array<ParsedEntity<T>> instead of Record<string, ParsedEntity<T>> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ export function parseEntities<T extends SchemaType>( | |
options?: { logging?: boolean } | ||
): StandardizedQueryResult<T> { | ||
// @ts-ignore | ||
const result: StandardizedQueryResult<T> = entities; | ||
const result: Record<string, ParsedEntity> = {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Type declaration mismatch with return type. The function's return type is -): StandardizedQueryResult<T> {
+): ParsedEntity<T>[] {
|
||
const entityIds = Object.keys(entities); | ||
|
||
entityIds.forEach((entityId) => { | ||
|
@@ -52,7 +52,7 @@ export function parseEntities<T extends SchemaType>( | |
console.log("Parsed result:", result); | ||
} | ||
|
||
return result; | ||
return Object.values(result); | ||
} | ||
|
||
/** | ||
|
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.
Update version bump type to reflect breaking changes.
All packages are currently marked for patch updates, but changing the return type of
parseEntities
fromRecord<string, ParsedEntity<T>>
toArray<ParsedEntity<T>>
is a breaking change that will affect API consumers. This should be reflected in the version numbers.Apply this diff to update the version bump type: