typescript-plugin-inner-jsx
Advanced tools
Comparing version 0.1.4 to 0.1.5
# Typescript Inner JSX Plugin Changelog | ||
## 0.1.5 | ||
- Inner object now contains components which come from parent function parameters (HOC components). | ||
## 0.1.4 | ||
@@ -4,0 +8,0 @@ |
@@ -34,2 +34,17 @@ "use strict"; | ||
/** | ||
* Gets function parameters | ||
* @param node | ||
*/ | ||
function getFunctionParameters(node) { | ||
const parameters = {}; | ||
if (node && (typescript_1.isFunctionExpression(node) || typescript_1.isArrowFunction(node))) { | ||
node.parameters.forEach(parameter => { | ||
if (typescript_1.isIdentifier(parameter.name)) { | ||
parameters[parameter.name.text] = parameter.name; | ||
} | ||
}); | ||
} | ||
return parameters; | ||
} | ||
/** | ||
* Gets all node's variable names | ||
@@ -142,4 +157,5 @@ * @param node | ||
} | ||
dict = Object.assign({}, dict, getImports(cbNode), getVariables(cbNode), getScope(node.parent)); | ||
dict = Object.assign({}, dict, getImports(cbNode), getVariables(cbNode), getFunctionParameters(cbNode.parent)); | ||
}); | ||
dict = Object.assign({}, dict, getScope(node.parent)); | ||
return dict; | ||
@@ -146,0 +162,0 @@ } |
{ | ||
"name": "typescript-plugin-inner-jsx", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "Typescript transformer which adds references to inner JSX components to parent React components.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -57,7 +57,7 @@ # Typescript Inner JSX Plugin | ||
To build with transformer please use provided custom compiler `bin/build`. | ||
To build with transformer please use provided custom compiler `build-with-transform-jsx`. | ||
Example: | ||
``` | ||
./node_modules/typescript-plugin-inner-jsx/bin/build -t es5 --outDir dist/es5 --declaration --inlineSourceMap --inlineSources --config ./tsconfig.json | ||
build-with-transform-jsx -t es5 --outDir dist/es5 --declaration --inlineSourceMap --inlineSources --config ./tsconfig.json | ||
``` | ||
@@ -64,0 +64,0 @@ |
25961
436