mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-22 01:22:54 +00:00
refactor: reintroduce validateThing method
This commit is contained in:
@@ -182,6 +182,20 @@ export function isSchemaWithDefinitions(schema: JSONSchema): schema is SchemaWit
|
||||
return typeof schema.definitions !== 'undefined';
|
||||
}
|
||||
|
||||
// tslint:disable: completed-docs
|
||||
/**
|
||||
* Guard method for determining if an object (a thing) has a type property with a type of string
|
||||
*
|
||||
* @param thing An object (thing)
|
||||
*/
|
||||
export function isThingWithType(thing: unknown): thing is { type: string; } {
|
||||
return typeof thing === 'object' &&
|
||||
thing !== null &&
|
||||
'type' in thing &&
|
||||
typeof (thing as { type: string; }).type === 'string';
|
||||
}
|
||||
// tslint:enable: completed-docs
|
||||
|
||||
/**
|
||||
* Get path that contains a tsconfig.json
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user