import {Decorators, Metadata} from 'aurelia-metadata';
import {ValueConverterResource} from './value-converter';

//ES7 Decorators
export function valueConverter(nameOrTarget){
  if(nameOrTarget === undefined || typeof nameOrTarget === 'string'){
    return function(target){
      Reflect.defineMetadata(Metadata.resource, new ValueConverterResource(nameOrTarget), target);
    }
  }

  Reflect.defineMetadata(Metadata.resource, new ValueConverterResource(), nameOrTarget);
}

Decorators.configure.parameterizedDecorator('valueConverter', valueConverter);

export function computedFrom(...rest){
  return function(target, key, descriptor){
    if (descriptor.set){
      throw new Error(`The computed property "${key}" cannot have a setter function.`);
    }
    descriptor.get.dependencies = rest;
    return descriptor;
  }
}

@@ -275,38 +275,24 @@
 %7B%0A      
-Reflect.define
 Metadata
 (Metadat
@@ -275,32 +275,39 @@
 %7B%0A      Metadata
+.define
 (Metadata.resour
@@ -378,30 +378,16 @@
 %0A%0A  
-Reflect.define
 Metadata
 (Met
@@ -382,16 +382,23 @@
 Metadata
+.define
 (Metadat

use new metadata api