typescript-to-proptypes
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -5,2 +5,8 @@ # Changelog | ||
### [2.1.1](https://github.com/merceyz/typescript-to-proptypes/compare/v2.1.0...v2.1.1) (2020-08-17) | ||
### Bug Fixes | ||
- **injector:** check previous validator source for string literal keys ([5d06cfb](https://github.com/merceyz/typescript-to-proptypes/commit/5d06cfb0373d43b7a9c19fa2bb456b5efbb38e50)) | ||
## [2.1.0](https://github.com/merceyz/typescript-to-proptypes/compare/v2.0.1...v2.1.0) (2020-06-18) | ||
@@ -7,0 +13,0 @@ |
@@ -87,3 +87,11 @@ "use strict"; | ||
const validatorSource = code.slice(property.value.start, property.value.end); | ||
previousPropTypesSource.set(property.key.name, validatorSource); | ||
if (babelTypes.isIdentifier(property.key)) { | ||
previousPropTypesSource.set(property.key.name, validatorSource); | ||
} | ||
else if (babelTypes.isStringLiteral(property.key)) { | ||
previousPropTypesSource.set(property.key.value, validatorSource); | ||
} | ||
else { | ||
console.warn(`${state.filename}: Possibly missed original proTypes source. Can only determine names for 'Identifiers' and 'StringLiteral' but received '${property.key.type}'.`); | ||
} | ||
} | ||
@@ -248,5 +256,8 @@ }); | ||
} | ||
else { | ||
else if (babelTypes.isIdentifier(x.key)) { | ||
usedProps.push(x.key.name); | ||
} | ||
else { | ||
console.warn('Possibly used prop missed because object property key was not an Identifier or StringLiteral.'); | ||
} | ||
} | ||
@@ -253,0 +264,0 @@ else if (babelTypes.isIdentifier(x.argument)) { |
{ | ||
"name": "typescript-to-proptypes", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "Generate proptypes from typescript declarations", | ||
@@ -49,6 +49,6 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@babel/core": "^7.5.4", | ||
"@babel/plugin-syntax-class-properties": "^7.2.0", | ||
"@babel/plugin-syntax-jsx": "^7.2.0", | ||
"@babel/types": "^7.5.0", | ||
"@babel/core": "^7.11.1", | ||
"@babel/plugin-syntax-class-properties": "^7.10.4", | ||
"@babel/plugin-syntax-jsx": "^7.10.4", | ||
"@babel/types": "^7.11.0", | ||
"doctrine": "^3.0.0", | ||
@@ -55,0 +55,0 @@ "lodash": "^4.17.14", |
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
117002
1490