Skip to content

Commit b4d6db4

Browse files
committedJan 25, 2022
refactor(model-collection): updated toJSON typing
updated `toJSON` typing to track the model's `toJSON`
1 parent 789dbf8 commit b4d6db4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/Calliope/ModelCollection.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ export default class ModelCollection<T extends Model> extends Collection<T> {
418418
/**
419419
* @inheritDoc
420420
*/
421-
public override toJSON(): { elements: ReturnType<typeof JSON.parse>[] } {
421+
public override toJSON(): { elements: Model['toJSON'][] } {
422422
// eslint-disable-next-line max-len
423423
// https://security.stackexchange.com/questions/7001/how-should-web-app-developers-defend-against-json-hijacking/7003#7003
424424
return { elements: this.toArray().map(model => model.toJSON()) };

0 commit comments

Comments
 (0)