import { metadata } from '../constants' ; export const Optional = ( ) => ( target , key , index ? ) : void => { const indexs = Reflect . getMetadata ( metadata . OPTIONAL_IDENTIFIER , target ) || [ ] ; const next = [ ... new Set ( indexs . concat ( index ) ) ] ; Reflect . defineMetadata ( metadata . OPTIONAL_IDENTIFIER , next , target , key ) ; } ;