typescript-to-proptypes
Advanced tools
Comparing version 2.1.2 to 2.2.0
@@ -5,2 +5,12 @@ # Changelog | ||
## [2.2.0](https://github.com/merceyz/typescript-to-proptypes/compare/v2.1.2...v2.2.0) (2020-09-14) | ||
### Features | ||
- add TS@3.8 support ([#29](https://github.com/merceyz/typescript-to-proptypes/issues/29)) ([40f0358](https://github.com/merceyz/typescript-to-proptypes/commit/40f0358bc691e3c5b892276626d9dc554b4c2b6e)) | ||
### Performance Improvements | ||
- **parser:** use set instead of array for stack ([426dd39](https://github.com/merceyz/typescript-to-proptypes/commit/426dd39bd17c5fb1990c0e023d108bc9df1d8b10)) | ||
### [2.1.2](https://github.com/merceyz/typescript-to-proptypes/compare/v2.1.1...v2.1.2) (2020-09-13) | ||
@@ -7,0 +17,0 @@ |
@@ -233,3 +233,3 @@ "use strict"; | ||
const propsFilename = sourceFile !== undefined ? sourceFile.fileName : undefined; | ||
programNode.body.push(t.componentNode(name, properties.map((x) => checkSymbol(x, [type.id])), propsFilename)); | ||
programNode.body.push(t.componentNode(name, properties.map((x) => checkSymbol(x, new Set([type.id]))), propsFilename)); | ||
} | ||
@@ -291,3 +291,3 @@ function checkSymbol(symbol, typeStack) { | ||
// To prevent getting stuck in an infinite loop we just set it to an objectNode | ||
if (typeStack.includes(type.id)) { | ||
if (typeStack.has(type.id)) { | ||
return t.objectNode(); | ||
@@ -358,6 +358,6 @@ } | ||
if (properties.length) { | ||
if (shouldResolveObject({ name, propertyCount: properties.length, depth: typeStack.length })) { | ||
const filtered = properties.filter((symbol) => shouldInclude({ name: symbol.getName(), depth: typeStack.length + 1 })); | ||
if (shouldResolveObject({ name, propertyCount: properties.length, depth: typeStack.size })) { | ||
const filtered = properties.filter((symbol) => shouldInclude({ name: symbol.getName(), depth: typeStack.size + 1 })); | ||
if (filtered.length > 0) { | ||
return t.interfaceNode(filtered.map((x) => checkSymbol(x, [...typeStack, type.id]))); | ||
return t.interfaceNode(filtered.map((x) => checkSymbol(x, new Set([...typeStack.values(), type.id])))); | ||
} | ||
@@ -364,0 +364,0 @@ } |
{ | ||
"name": "typescript-to-proptypes", | ||
"version": "2.1.2", | ||
"version": "2.2.0", | ||
"description": "Generate proptypes from typescript declarations", | ||
@@ -56,3 +56,3 @@ "main": "dist/index.js", | ||
"tslib": "^1.13.0", | ||
"typescript": "3.5.2", | ||
"typescript": "3.8.3", | ||
"uuid": "^8.1.0" | ||
@@ -59,0 +59,0 @@ }, |
Sorry, the diff of this file is not supported yet
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
117974
+ Addedtypescript@3.8.3(transitive)
- Removedtypescript@3.5.2(transitive)
Updatedtypescript@3.8.3