5htp-core 0.3.9-1 → 0.3.9-3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "5htp-core",
3
3
  "description": "Convenient TypeScript framework designed for Performance and Productivity.",
4
- "version": "0.3.9-1",
4
+ "version": "0.3.9-3",
5
5
  "author": "Gaetan Le Gac (https://github.com/gaetanlegac)",
6
6
  "repository": "git://github.com/gaetanlegac/5htp-core.git",
7
7
  "license": "MIT",
@@ -124,7 +124,8 @@ export default class SchemaValidators {
124
124
  const checkChoice = ( choice: any ) => {
125
125
 
126
126
  // Choice object = extract value
127
- if (typeof choice === 'object' && ('value' in choice) && typeof choice.value !== 'object')
127
+ // We check for choice objec via the label prop, as the value can be undefined (and so, not transmitted)
128
+ if (typeof choice === 'object' && ('label' in choice) && typeof choice.label === 'string' && typeof choice.value !== 'object')
128
129
  choice = choice.value;
129
130
 
130
131
  // If choices list rpovided, check if the choice is in the choices list
@@ -88,13 +88,8 @@ export default class ConfigParser {
88
88
  // We assume that when we run 5htp dev, we're in local
89
89
  // Otherwise, we're in production environment (docker)
90
90
  console.log("[app] Using environment:", process.env.NODE_ENV);
91
- return process.env.NODE_ENV === 'development' ? {
92
- name: 'local',
93
- profile: 'dev'
94
- } : {
95
- name: 'server',
96
- profile: 'prod',
97
- }
91
+ const envFileName = this.appDir + '/env.yaml';
92
+ return this.loadYaml( envFileName );
98
93
  }
99
94
 
100
95
  public identity() {