docs: function compatible(value, descriptor) {
    if (!value) {
      // If we're a null, then we can't validate.
      return false;
    } else if (!descriptor) {
      return true;
    }
  
    const descriptorType = typeof descriptor;
    if (descriptorType === 'string') {
      return typeof value === descriptor;
    } else if (descriptorType === 'function') {
      return descriptor(value);
    } else if (descriptorType === 'object') {
      let matched = true;
      Object.keys(descriptor).forEach((key) => {
        const fromValue = value[key];
        const fromDescriptor = descriptor[key];
        if (!compatible(fromValue, fromDescriptor)) {
          matched = false;
        }
      });
      return matched;
    }
  
    throw new Error('Unknown descriptor type: ' + descriptorType);
  }