Skip to content

Commit 618e35d

Browse files
committed
fix(metadata): remove the default type to work around a TS bug
See microsoft/TypeScript#26985
1 parent f4be330 commit 618e35d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

packages/authentication/src/keys.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,6 @@ export namespace AuthenticationBindings {
105105
* The key used to store log-related via @loopback/metadata and reflection.
106106
*/
107107
export const AUTHENTICATION_METADATA_KEY = MetadataAccessor.create<
108-
AuthenticationMetadata
108+
AuthenticationMetadata,
109+
MethodDecorator
109110
>('authentication.operationsMetadata');

packages/metadata/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class MetadataAccessor<T, D extends DecoratorType = DecoratorType> {
3030
* @typeparam T Type of the metadata value
3131
* @typeparam D Type of the decorator
3232
*/
33-
static create<T, D extends DecoratorType = DecoratorType>(key: string) {
33+
static create<T, D extends DecoratorType>(key: string) {
3434
return new MetadataAccessor<T, D>(key);
3535
}
3636
}

packages/repository-json-schema/src/keys.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {JSONSchema6 as JSONSchema} from 'json-schema';
99
/**
1010
* Metadata key used to set or retrieve repository JSON Schema
1111
*/
12-
export const JSON_SCHEMA_KEY = MetadataAccessor.create<JSONSchema>(
13-
'loopback:json-schema',
14-
);
12+
export const JSON_SCHEMA_KEY = MetadataAccessor.create<
13+
JSONSchema,
14+
ClassDecorator
15+
>('loopback:json-schema');

0 commit comments

Comments
 (0)