Skip to content

Commit

Permalink
fix: Correct return type of related* accessors
Browse files Browse the repository at this point in the history
When using the `Resource.related*` accessors there was a mismatch between
the actual return type of the getter and the type indicated to the ProxyHandler
  • Loading branch information
danielmenzel committed Oct 23, 2019
1 parent a250512 commit 0d1453f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## Unreleased

## [v0.0.6](https://github.com/muellerbbm-vas/grivet/compare/v0.0.5...v0.0.6) - 2019-10-23

### Fixed

- Correct return type of `related*` accessors

## [v0.0.5](https://github.com/muellerbbm-vas/grivet/compare/v0.0.4...v0.0.5) - 2019-08-27

### Fixed
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Expand Up @@ -238,11 +238,11 @@ export namespace JsonApi {
export type Links = { [linkName: string]: Link };

/** @hidden */
type RelationshipToResource = { [relationshipName: string]: Resource };
type RelationshipToResource = { [relationshipName: string]: Promise<Resource> };
/** @hidden */
type RelationshipToResources = { [relationshipName: string]: Resource[] };
type RelationshipToResources = { [relationshipName: string]: Promise<Resource[]> };
/** @hidden */
type RelationshipToDocument = { [relationshipName: string]: Document };
type RelationshipToDocument = { [relationshipName: string]: Promise<Document> };

/** @hidden */
class RelatedResourceAccessor<T extends RelationshipToResource> implements ProxyHandler<T> {
Expand Down

0 comments on commit 0d1453f

Please sign in to comment.