react-docgen
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -20,2 +20,3 @@ /* | ||
var getPropertyValuePath = require('../utils/getPropertyValuePath'); | ||
var printValue = require('../utils/printValue'); | ||
var recast = require('recast'); | ||
@@ -34,3 +35,3 @@ var resolveToValue = require('../utils/resolveToValue'); | ||
node = path.node; | ||
defaultValue = recast.print(path).code; | ||
defaultValue = printValue(path); | ||
} | ||
@@ -37,0 +38,0 @@ if (typeof defaultValue !== 'undefined') { |
@@ -24,2 +24,3 @@ /* | ||
var isReactModuleName = require('../utils/isReactModuleName'); | ||
var printValue = require('../utils/printValue'); | ||
var recast = require('recast'); | ||
@@ -80,3 +81,3 @@ var resolveToModule = require('../utils/resolveToModule'); | ||
getPropType(valuePath) : | ||
{name: 'custom', raw: recast.print(valuePath).code}; | ||
{name: 'custom', raw: printValue(valuePath)}; | ||
@@ -83,0 +84,0 @@ if (type) { |
@@ -18,2 +18,3 @@ /* | ||
var getPropertyName = require('./getPropertyName'); | ||
var printValue = require('./printValue'); | ||
var recast = require('recast'); | ||
@@ -27,3 +28,3 @@ var resolveToValue = require('./resolveToValue'); | ||
return { | ||
value: recast.print(elementPath).code, | ||
value: printValue(elementPath), | ||
computed: !types.Literal.check(elementPath.node) | ||
@@ -38,3 +39,3 @@ }; | ||
type.computed = true; | ||
type.value = recast.print(argumentPath).code; | ||
type.value = printValue(argumentPath); | ||
} else { | ||
@@ -50,3 +51,3 @@ type.value = getEnumValues(argumentPath); | ||
type.computed = true; | ||
type.value = recast.print(argumentPath).code; | ||
type.value = printValue(argumentPath); | ||
} else { | ||
@@ -63,3 +64,3 @@ type.value = argumentPath.get('elements').map(getPropType); | ||
if (subType.name === 'unknown') { | ||
type.value = recast.print(argumentPath).code; | ||
type.value = printValue(argumentPath); | ||
type.computed = true; | ||
@@ -92,3 +93,3 @@ } else { | ||
name: 'instanceOf', | ||
value: recast.print(argumentPath).code | ||
value: printValue(argumentPath) | ||
}; | ||
@@ -153,3 +154,3 @@ } | ||
} else { | ||
descriptor = {name: 'custom', raw: recast.print(path).code}; | ||
descriptor = {name: 'custom', raw: printValue(path)}; | ||
} | ||
@@ -156,0 +157,0 @@ } |
{ | ||
"name": "react-docgen", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A CLI and toolkit to extract information from React components for documentation generation.", | ||
@@ -15,3 +15,3 @@ "repository": { | ||
"scripts": { | ||
"watch": "jsx lib/ dist/ --harmony --strip-types -w", | ||
"watch": "jsx src/ dist/ --harmony --strip-types -w", | ||
"build": "rm -rf dist/ && jsx src/ dist/ --harmony --strip-types --no-cache-dir", | ||
@@ -39,5 +39,9 @@ "prepublish": "npm run build", | ||
"scriptPreprocessor": "./tests/preprocessor", | ||
"testPathDirs": ["src"], | ||
"unmockedModulePathPatterns": ["tests/utils"] | ||
"testPathDirs": [ | ||
"src" | ||
], | ||
"unmockedModulePathPatterns": [ | ||
"tests/utils" | ||
] | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60593
39
1483