The @Value Decorator
Main
Usage
@Value(propertyKey: string)// ./src/main/resources/properties.json
{
"mandarine": {
"hello-message": "Bonjour!"
},
"customKey": "Here goes my custom value"
}import { Value } from "https://deno.land/x/mandarinets/mod.ts";
export class ValueDecoratorTest {
@Value('customKey')
public static customKey: string;
@Value('mandarine.hello-message')
public bonjour: string;
}
console.log(ValueDecoratorTest.customKey); // Here goes my custom value
console.log(new ValueDecoratorTest().bonjour); // Bonjour!Last updated