Chalarangelo/30-seconds-of-code

View on GitHub
src/blocks/serializers/pageSerializer.js

Summary

Maintainability
A
0 mins
Test Coverage
export const pageSerializer = {
  name: 'PageSerializer',
  methods: {
    params: (page, { withParams } = {}) => {
      if (!withParams) return undefined;
      return page.params;
    },
  },
  attributes: ['props', 'params'],
};