const componentPath = rootSchema.$id.split('/');
const componentType = path.basename(rootSchema.$id).split('.')[0];
return n.$id.replace(/#.*$/g, '');
export function getSchemaName(schemaId: string | undefined): string {
return (schemaId && schemaId.split('/').pop()?.split('.').shift()) || '';
}
export function getSchemaModule(schemaId: string | undefined): string {
return (schemaId && schemaId.split('/')[3]) || '';
}
Stuff like this:
Should all be handled by common JSON Schema
$idhelpers (like the last two).