diff --git a/src/decorators/index.ts b/src/decorators/index.ts index 4d53467..08f75d4 100644 --- a/src/decorators/index.ts +++ b/src/decorators/index.ts @@ -1,3 +1,4 @@ export * from './exclude'; export * from './memoize'; -export * from './pluck'; \ No newline at end of file +export * from './pluck'; +export * from './strong'; \ No newline at end of file diff --git a/src/decorators/strong.ts b/src/decorators/strong.ts new file mode 100644 index 0000000..cb62a75 --- /dev/null +++ b/src/decorators/strong.ts @@ -0,0 +1,9 @@ +export const STRONG_CLASS_KEY = 'serde:strong_class'; + +export function Strong(): Function { + return function(target: any) { + if (!Reflect.hasMetadata(STRONG_CLASS_KEY, target)) { + Reflect.defineMetadata(STRONG_CLASS_KEY, 'is_strong_typed', target); + } + } +} \ No newline at end of file