You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-docgen-typescript

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-docgen-typescript - npm Package Compare versions

Comparing version

to
1.12.3

21

lib/__tests__/parser.js

@@ -693,14 +693,23 @@ "use strict";

it('should filter out forbidden symbols', function () {
// @ts-ignore
var result = parser_1.getDefaultExportForFile({ fileName: 'a-b' });
var result = parser_1.getDefaultExportForFile({
fileName: 'a-b'
});
chai_1.assert.equal(result, 'ab');
});
it('should remove leading non-letters', function () {
// @ts-ignore
var result = parser_1.getDefaultExportForFile({ fileName: '---123aba' });
var result = parser_1.getDefaultExportForFile({
fileName: '---123aba'
});
chai_1.assert.equal(result, 'aba');
});
it('should preserve numbers in the middle', function () {
var result = parser_1.getDefaultExportForFile({
fileName: '1Body2Text3'
});
chai_1.assert.equal(result, 'Body2Text3');
});
it('should not return empty string', function () {
// @ts-ignore
var result = parser_1.getDefaultExportForFile({ fileName: '---123' });
var result = parser_1.getDefaultExportForFile({
fileName: '---123'
});
chai_1.assert.equal(result.length > 0, true);

@@ -707,0 +716,0 @@ });

@@ -526,2 +526,3 @@ "use strict";

return (expr.left &&
expr.left.name &&
expr.left.name.escapedText ===

@@ -573,3 +574,5 @@ propertyName);

// So, you could not take filename as is
var identifier = filename.replace(/[^A-Za-z]*|[^0-9.]*/g, '');
var identifier = filename
.replace(/^[^A-Z]*/gi, '')
.replace(/[^A-Z0-9]*/gi, '');
return identifier.length ? identifier : 'DefaultName';

@@ -576,0 +579,0 @@ }

{
"name": "react-docgen-typescript",
"version": "1.12.2",
"version": "1.12.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet