Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

react-docgen

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-docgen - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

.travis.yml

1

dist/handlers/index.js

@@ -16,2 +16,3 @@ /*

exports.propTypeHandler = require('./propTypeHandler');
exports.propTypeCompositionHandler = require('./propTypeCompositionHandler');
exports.propDocBlockHandler = require('./propDocBlockHandler');

24

dist/handlers/propTypeHandler.js

@@ -25,2 +25,3 @@ /*

var printValue = require('../utils/printValue');
var propTypeCompositionHandler = require('./propTypeCompositionHandler');
var recast = require('recast');

@@ -71,3 +72,3 @@ var resolveToModule = require('../utils/resolveToModule');

function amendPropTypes(documentation, path) {
function amendPropTypes(documentation, path, componentPath) {
path.get('properties').each(function(propertyPath) {

@@ -96,4 +97,5 @@ switch (propertyPath.node.type) {

break;
case types.MemberExpression.name:
amendComposes(documentation, resolvedValuePath);
default:
// for backwards compatibility
propTypeCompositionHandler(documentation, componentPath);
break;

@@ -112,15 +114,15 @@ }

propTypesPath = resolveToValue(propTypesPath);
if (!propTypesPath || !types.ObjectExpression.check(propTypesPath.node)) {
if (!propTypesPath) {
return;
}
if (!types.ObjectExpression.check(propTypesPath.node)) {
// maybe composition
// for backwards compatibility
propTypeCompositionHandler(documentation, path);
return;
}
switch (propTypesPath.node.type) {
case types.ObjectExpression.name:
amendPropTypes(documentation, propTypesPath);
break;
case types.MemberExpression.name:
amendComposes(documentation, propTypesPath);
}
amendPropTypes(documentation, propTypesPath, path);
}
module.exports = propTypeHandler;

@@ -58,2 +58,3 @@ /*

parse: defaultParse,
defaultHandlers:defaultHandlers,
handlers:handlers,

@@ -60,0 +61,0 @@ resolver:resolver,

{
"name": "react-docgen",
"version": "1.0.2",
"version": "1.1.0",
"description": "A CLI and toolkit to extract information from React components for documentation generation.",

@@ -5,0 +5,0 @@ "repository": {

@@ -1,2 +0,2 @@

# react-docgen
# react-docgen [![Build Status](https://travis-ci.org/reactjs/react-docgen.svg?branch=master)](https://travis-ci.org/reactjs/react-docgen)

@@ -3,0 +3,0 @@ `react-docgen` is a CLI and toolbox to help extracting information from React components, and generate documentation from it.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc