docs: function shape(obj) {
    const wrappedValidator = PropTypes.shape(obj);
    const shapeFields = Object.keys(obj);
  
    const propType = (props, propName, componentName, ...rest) => {
      const propValue = props[propName];
      if (!propValue) {
        return null;
      }
      // Check that the object has the declared shape.
      const err = wrappedValidator(props, propName, componentName, ...rest);
      if (err) {
        return err;
      }
      // Check that no extraneous fields are present.
      const fields = Object.getOwnPropertyNames(propValue).filter(field => {
        return shapeFields.indexOf(field) === -1;
      });
      if (fields.length) {
        return new Error(
          `invalid property "${propName}" provided to component ` +
          `"${componentName}": the provided object includes properties that ` +
          `are not declared in the shape: ${fields.join(', ')}`
        );
      }
      return null;
    };
  
    propType[SHAPE] = new Declaration(obj);
    propType.frozen = frozenWrapper(propType);
    propType.isRequired = isRequiredWrapper(propType);
    propType.frozen.isRequired = isRequiredWrapper(propType.frozen);
    return propType;
  }