Richard Knight 6 gadi atpakaļ
vecāks
revīzija
cfc923e2f7

+ 0 - 2
src/app/dynaform/interfaces/index.ts

@@ -1,5 +1,3 @@
-
-
 export interface ValueTransformer {
 	inputFn: (value: string) => { modifier: string, value: string };
 	outputFn: (modifier: string, value: string) => string;

+ 8 - 1
src/app/dynaform/libs/index.ts

@@ -18,12 +18,17 @@ import { reduce } from 'lodash/fp';
 
 const fb = new FormBuilder();
 
+// ---------------------------------------------------------------------------------------------------------------------
+// Helper Funstions
+
 const addProp = (obj, key, val) => { obj[key] = val; return obj; };
 
+// Is Group
 // Helper function to distinguish group from field
 const isGroup = metaFoG => metaFoG.meta;
 
-// Adds any missing 'name' properties to Fields and Groups using property's key, recursively
+// Add Missing Names
+// Helper function to add any missing 'name' properties to Fields and Groups using property's key, recursively
 const addNameIfMissing = (metaFoG, key) => metaFoG.name ? metaFoG : addProp(metaFoG, 'name', key);
 const addNameToSelfAndChildren = ( [key, metaFoG] ) => {
 	metaFoG = addNameIfMissing(metaFoG, key);
@@ -36,6 +41,8 @@ const addMissingNames = metaG => Object.entries(metaG)
 	.map(addNameToSelfAndChildren)
 	.reduce((res, [key, val]) => addProp(res, key, val), {});
 
+// ---------------------------------------------------------------------------------------------------------------------
+
 // Build Form Control
 // TODO: Flesh out function to build validators
 const buildControlState = metaF => ({ value: metaF.value || metaF.default, disabled: metaF.isDisabled });