refactor: update all

This commit is contained in:
openstappsbot
2023-01-30 08:34:22 +00:00
committed by Rainer Killinger
parent bdaa1f0201
commit 3b0014abac
6 changed files with 279 additions and 460 deletions

View File

@@ -54,7 +54,7 @@ export function isThing(something: unknown): something is SCThing {
export function isThingWithTranslations(
thing: SCThingWithoutReferences,
): thing is SCThingWithoutReferences & {translations: SCTranslations<SCThingTranslatableProperties>} {
return typeof thing.translations !== 'undefined';
return thing.translations !== undefined;
}
/**
@@ -108,11 +108,11 @@ export function isSearchResponse(something: unknown): something is SCSearchRespo
return (
Array.isArray(somethingObject.data) &&
Array.isArray(somethingObject.facets) &&
typeof somethingObject.pagination !== 'undefined' &&
somethingObject.pagination !== undefined &&
typeof somethingObject.pagination.count === 'number' &&
typeof somethingObject.pagination.offset === 'number' &&
typeof somethingObject.pagination.total === 'number' &&
typeof somethingObject.stats !== 'undefined' &&
somethingObject.stats !== undefined &&
typeof somethingObject.stats.time === 'number'
);
}