Closed lihbr closed 2 years ago
Merging #24 (ca708f2) into master (71035a2) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #24 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 15 17 +2
=========================================
+ Hits 15 17 +2
Impacted Files | Coverage Δ | |
---|---|---|
src/fields.ts | 100.00% <100.00%> (ø) |
|
src/index.ts | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 71035a2...ca708f2. Read the comment docs.
Alright, should be good, let me know 👌
Awesome, updates look good to me!
Types of changes
Description
Since the API follows carefully the oEmbed spec, this PR refactors the embed field definition to follow the specification and allow for better type guarding. See:
Have been deprecated:
EmbedType
, replaced byOEmbedType
CommonEmbedData
, replaced byPhotoOEmbed
,VideoOEmbed
,LinkOEmbed
,RichOEmbed
, orAnyOEmbed
I changed
EmbedField
first generic to extendAnyOEmbed
(previouslyRecord<string, unknown>
) to enforce provided type to extend a valid oEmbed response. This is technically a breaking change for TypeScript users that were using that generic, however, as long as they were extendingCommonEmbedData
they won't face any issue. Given the specificity of it we can consider it as a minor one I think, more of a bug fix.Fixes: https://github.com/prismicio/prismic-client/issues/216 (if this PR lands, you might need to update your comment there for the posterity of that question @angeloashmore)
Checklist:
🦩