File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
libs/components/config/src/lib Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -137,11 +137,12 @@ describe('SkyAppRuntimeConfigParams', () => {
137137 }
138138 ) ;
139139
140+ // TODO: In a breaking change, remove the `as unknown` declarations.
140141 expect ( params . get ( 'a1' ) ) . toBe ( 'b' ) ;
141- expect ( params . get ( 'a2' ) ) . toBe ( undefined ) ;
142+ expect ( params . get ( 'a2' ) as unknown ) . toBe ( undefined ) ;
142143 expect ( params . get ( 'a3' ) ) . toBe ( 'd' ) ;
143144 expect ( params . get ( 'a4' ) ) . toBe ( 'x' ) ;
144- expect ( params . get ( 'a5' ) ) . toBe ( undefined ) ;
145+ expect ( params . get ( 'a5' ) as unknown ) . toBe ( undefined ) ;
145146 } ) ;
146147
147148 it ( 'should allow default values to be overridden by the query string' , ( ) => {
Original file line number Diff line number Diff line change @@ -121,17 +121,20 @@ export class SkyAppRuntimeConfigParams {
121121 * Returns the decoded value of the requested param.
122122 * @param key The parameter's key.
123123 */
124- public get ( key : string ) : string | undefined {
124+ public get ( key : string ) : string {
125125 if ( this . has ( key ) ) {
126126 return decodeURIComponent ( this . #params[ key ] ) ;
127127 }
128- return ;
128+
129+ // TODO: Return `string | undefined` in a breaking change.
130+ return undefined as unknown as string ;
129131 }
130132
131133 /**
132134 * Returns the params object.
133135 * @param excludeDefaults Exclude params that have default values
134136 */
137+ // TODO: Return a more specific type in a breaking change.
135138 public getAll ( excludeDefaults ?: boolean ) : Object {
136139 const filteredParams : { [ key : string ] : string } = { } ;
137140
You can’t perform that action at this time.
0 commit comments