Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: accept map serializers in composeSerializers() #66

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

angeloashmore
Copy link
Member

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR updates composeSerializers() to accept map serializers. The change simplifies how map and function serializers can be composed.

Before this PR:

import { composeSerializers, wrapMapSerializer } from "@prismicio/richtext";

const serializer = composeSerializers(
  wrapMapSerializer(myMapSerializer),
  myFunctionSerializer
);

After this PR:

import { composeSerializers } from "@prismicio/richtext";

const serializer = composeSerializers(myMapSerializer, myFunctionSerializer);

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

🐻‍❄️

@github-actions
Copy link

size-limit report 📦

Path Size
dist/index.js 978 B (+1.99% 🔺)
dist/index.cjs 1.9 KB (+1.1% 🔺)

@codecov-commenter
Copy link

Codecov Report

Merging #66 (ffc3b7f) into master (b5d3c12) will not change coverage.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff            @@
##            master       #66   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          528       535    +7     
  Branches        46        47    +1     
=========================================
+ Hits           528       535    +7     
Files Changed Coverage Δ
src/composeSerializers.ts 100.00% <100.00%> (ø)

Copy link
Member

@lihbr lihbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@angeloashmore angeloashmore merged commit 495456d into master Aug 17, 2023
1 check passed
@angeloashmore angeloashmore deleted the aa/composeSerializers-support-map branch August 17, 2023 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants