@@ -72,30 +72,22 @@ function getInputTokenValue(token) {
72
72
}
73
73
}
74
74
75
- function getStaticInputMetadata ( inputOptions ) {
75
+ function getStaticInputMetadata ( inputMapping ) {
76
76
const metadata = { } ;
77
77
78
- for ( const [ name , token ] of Object . entries ( inputOptions ) ) {
79
- if ( typeof token === 'string' ) {
80
- metadata [ input . staticDependency ( name ) ] = token ;
81
- metadata [ input . staticValue ( name ) ] = null ;
82
- } else if ( isInputToken ( token ) ) {
83
- const tokenShape = getInputTokenShape ( token ) ;
84
- const tokenValue = getInputTokenValue ( token ) ;
85
-
86
- metadata [ input . staticDependency ( name ) ] =
87
- ( tokenShape === 'input.dependency'
88
- ? tokenValue
89
- : null ) ;
90
-
91
- metadata [ input . staticValue ( name ) ] =
92
- ( tokenShape === 'input.value'
93
- ? tokenValue
94
- : null ) ;
95
- } else {
96
- metadata [ input . staticDependency ( name ) ] = null ;
97
- metadata [ input . staticValue ( name ) ] = null ;
98
- }
78
+ for ( const [ name , token ] of Object . entries ( inputMapping ) ) {
79
+ const tokenShape = getInputTokenShape ( token ) ;
80
+ const tokenValue = getInputTokenValue ( token ) ;
81
+
82
+ metadata [ input . staticDependency ( name ) ] =
83
+ ( tokenShape === 'input.dependency'
84
+ ? tokenValue
85
+ : null ) ;
86
+
87
+ metadata [ input . staticValue ( name ) ] =
88
+ ( tokenShape === 'input.value'
89
+ ? tokenValue
90
+ : null ) ;
99
91
}
100
92
101
93
return metadata ;
@@ -350,6 +342,8 @@ export function templateCompositeFrom(description) {
350
342
if ( typeof inputOptions [ name ] === 'string' ) {
351
343
inputMapping [ name ] = input . dependency ( inputOptions [ name ] ) ;
352
344
} else {
345
+ // This is always an input token, since only a string or
346
+ // an input token is a valid input option (asserted above).
353
347
inputMapping [ name ] = inputOptions [ name ] ;
354
348
}
355
349
} else if ( tokenValue . defaultValue ) {
0 commit comments