import { MultiClass } from '@mockingbird/common' ; import { MockOptions } from '../types/mock-options.type' ; export interface PropertyDecoratorValue { readonly value : MockOptions ; sObject ( ) : boolean ; isMultiClass ( ) : boolean ; isCallback ( ) : boolean ; isEnum ( ) : boolean ; isRegex ( ) : boolean ; } export class PropertyDecoratorValue { private readonly type : string ; public constructor ( public readonly value ) { this . type = typeof value ; } public isObject ( ) { return this . type === 'object' ; } public isMultiClass ( ) { return this . isObject ( ) && ( this . value as MultiClass ) . hasOwnProperty ( 'type' ) ; } public isCallback ( ) { return this . type === 'function' ; } public isEnum ( ) { return this . isObject ( ) && this . value . hasOwnProperty ( 'enum' ) ; } public isRegex ( ) { return this . value instanceof RegExp ; } }