Skip to content
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

fix(metadata): remove the default type to work around a TS bug #1774

Merged
merged 1 commit into from
Sep 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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');