Skip to content

Commit

Permalink
fix(metadata): remove the default type to work around a TS bug
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondfeng committed Sep 28, 2018
1 parent f4be330 commit fc89a2c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion packages/authentication/src/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@ export namespace AuthenticationBindings {
* The key used to store log-related via @loopback/metadata and reflection.
*/
export const AUTHENTICATION_METADATA_KEY = MetadataAccessor.create<
AuthenticationMetadata
AuthenticationMetadata,
MethodDecorator
>('authentication.operationsMetadata');
2 changes: 1 addition & 1 deletion packages/metadata/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class MetadataAccessor<T, D extends DecoratorType = DecoratorType> {
* @typeparam T Type of the metadata value
* @typeparam D Type of the decorator
*/
static create<T, D extends DecoratorType = DecoratorType>(key: string) {
static create<T, D extends DecoratorType>(key: string) {
return new MetadataAccessor<T, D>(key);
}
}
Expand Down
7 changes: 4 additions & 3 deletions packages/repository-json-schema/src/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {JSONSchema6 as JSONSchema} from 'json-schema';
/**
* Metadata key used to set or retrieve repository JSON Schema
*/
export const JSON_SCHEMA_KEY = MetadataAccessor.create<JSONSchema>(
'loopback:json-schema',
);
export const JSON_SCHEMA_KEY = MetadataAccessor.create<
JSONSchema,
ClassDecorator
>('loopback:json-schema');

0 comments on commit fc89a2c

Please sign in to comment.