import 'reflect-metadata' ; import { BasicObject } from '../db' ; const METADATA_KEY = Symbol ( '__s3db' ) ; param target param values export function updateMetadata ( toTarget , values ) { const target = toTarget . constructor || toTarget ; const keyName = target . name . toLowerCase ( ) ; let metadata = Reflect . getMetadata ( METADATA_KEY , target ) || { } ; metadata = { ... metadata , ... { [ keyName ] : values } } ; Reflect . defineMetadata ( METADATA_KEY , metadata , target ) ; } param target export function getMetadata ( toTarget ) { const target = toTarget . constructor || toTarget ; const keyName = target . name . toLowerCase ( ) ; const metadata = Reflect . getOwnMetadata ( METADATA_KEY , target ) ; return metadata ? metadata [ keyName ] : undefined ; } /**
 * Helper for getting a value on a target object.
 */ export function getValue ( target , propertyName ) { return ( target as any ) [ propertyName ] ; } param target param propertyName param value export function setValue ( target , propertyName , value ) { ; ( target as any ) [ propertyName ] = value ; }