Skip to content

Commit 5fe28fd

Browse files
sdirixlucas-koehler
authored andcommitted
Adjust uischema type guards to be compatible with 'strictNullChecks'
1 parent 6206b0d commit 5fe28fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/models/uischema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,13 @@ export const isLayout = (uischema: UISchemaElement): uischema is Layout =>
275275
(uischema as Layout).elements !== undefined;
276276

277277
export const isScopable = (obj: unknown): obj is Scopable =>
278-
obj && typeof obj === 'object';
278+
!!obj && typeof obj === 'object';
279279

280280
export const isScoped = (obj: unknown): obj is Scoped =>
281281
isScopable(obj) && typeof obj.scope === 'string';
282282

283283
export const isLabelable = (obj: unknown): obj is Labelable =>
284-
obj && typeof obj === 'object';
284+
!!obj && typeof obj === 'object';
285285

286286
export const isLabeled = <T = never>(obj: unknown): obj is Labeled<T> =>
287287
isLabelable(obj) && ['string', 'boolean'].includes(typeof obj.label);

0 commit comments

Comments
 (0)