bookbrainz/bookbrainz-site

View on GitHub
src/client/helpers/react-validators.js

Summary

Maintainability
A
0 mins
Test Coverage
import PropTypes from 'prop-types';


export const entityTypeProperty = PropTypes.oneOf([
    'author',
    'edition',
    'editionGroup',
    'publisher',
    'series',
    'work'
]);

export const labeledProperty = PropTypes.shape({
    id: PropTypes.number,
    label: PropTypes.string
});

export const namedProperty = PropTypes.shape({
    id: PropTypes.number,
    name: PropTypes.string
});