Socket
Socket
Sign inDemoInstall

typescript-to-proptypes

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-to-proptypes - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

6

CHANGELOG.md

@@ -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 @@

15

dist/injector.js

@@ -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)) {

10

package.json
{
"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

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