private function convertTypeDefinitionSpecificData(array $data, MutableTypeDefinitionInterface $typeDefinition)
    {
        if ($typeDefinition instanceof MutableDocumentTypeDefinitionInterface) {
            if (!empty($data[JSONConstants::JSON_TYPE_CONTENTSTREAM_ALLOWED])) {
                $data[JSONConstants::JSON_TYPE_CONTENTSTREAM_ALLOWED] = ContentStreamAllowed::cast(
                    $data[JSONConstants::JSON_TYPE_CONTENTSTREAM_ALLOWED]
                );
            }
        } elseif ($typeDefinition instanceof MutableRelationshipTypeDefinitionInterface) {

            $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] = array_map(
                'strval',
                array_filter(
                    $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] ?? [],
                    function ($item) { return !empty($item); }
                )
            );
            $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] = array_map(
                'strval',
                array_filter(
                    $data[JSONConstants::JSON_TYPE_ALLOWED_SOURCE_TYPES] ?? [],
                    function ($item) { return !empty($item); }
                )
            );
            $data[JSONConstants::JSON_TYPE_ALLOWED_TARGET_TYPES] = array_map(
                'strval',
                array_filter(
                    $data[JSONConstants::JSON_TYPE_ALLOWED_TARGET_TYPES] ?? [],
                    function ($item) { return !empty($item); }
                )
            );

        }

        return $data;
    }