0
0
Fork 0

Revert "Support JSON-LD named graph (#31288)" (#31355)

This commit is contained in:
Claire 2024-08-09 15:48:54 +02:00 committed by GitHub
parent cbdd8edf68
commit 8a5b57f668
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 29 deletions

View file

@ -101,9 +101,7 @@ class LinkDetailsExtractor
end
def json
@json ||= root_array(Oj.load(@data))
.map { |node| JSON::LD::API.compact(node, 'https://schema.org') }
.find { |node| SUPPORTED_TYPES.include?(node['type']) } || {}
@json ||= root_array(Oj.load(@data)).compact.find { |obj| SUPPORTED_TYPES.include?(obj['@type']) } || {}
end
end