From 642c0d3a3bcb395c378d196e56a58964d5df7147 Mon Sep 17 00:00:00 2001 From: Qiaosen Huang Date: Sun, 6 Aug 2017 23:08:50 +0800 Subject: [PATCH] fix parseValue --- package.json | 2 +- src/configuration/ConfigurationStore.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0495928..73683a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@t2ee/core", - "version": "0.1.18", + "version": "0.1.19", "description": "@t2ee core library", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/src/configuration/ConfigurationStore.ts b/src/configuration/ConfigurationStore.ts index ac04181..fccd3f6 100644 --- a/src/configuration/ConfigurationStore.ts +++ b/src/configuration/ConfigurationStore.ts @@ -91,8 +91,12 @@ export default class ConfigurationStore { } } else if (value.split('.')[0] in ConfigurationStore.types) { // simple object const values: string[] = value.split('.'); - const rest: string = values.slice(1).join('.'); - value = _.get(ConfigurationStore.types[values[0]], rest); + if (values.length === 1) { + value = ConfigurationStore.types[values[0]]; + } else { + const rest: string = values.slice(1).join('.'); + value = _.get(ConfigurationStore.types[values[0]], rest); + } } return value; }