Socket
Socket
Sign inDemoInstall

rollup-plugin-dts

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-dts - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

5

CHANGELOG.md

@@ -0,1 +1,6 @@

### 1.1.6 2019-07-31
- further improve computed property handling
- add support for `bigint` type
### 1.1.5 2019-07-01

@@ -2,0 +7,0 @@

66

dist/rollup-plugin-dts.js

@@ -422,2 +422,3 @@ 'use strict';

ts.SyntaxKind.ThisType,
ts.SyntaxKind.BigIntKeyword,
]);

@@ -525,3 +526,47 @@ class DeclarationScope {

}
convertEntityName(node) {
if (ts.isIdentifier(node)) {
return createIdentifier(node);
}
return withStartEnd({
type: "MemberExpression",
computed: false,
object: this.convertEntityName(node.left),
property: createIdentifier(node.right),
},
// TODO: clean up all the `start` handling!
{ start: node.getStart(), end: node.end });
}
convertPropertyAccess(node) {
// hm, we only care about property access expressions here…
if (ts.isIdentifier(node.expression)) {
return createIdentifier(node.expression);
}
if (ts.isPropertyAccessExpression(node.expression)) {
return withStartEnd({
type: "MemberExpression",
computed: false,
object: this.convertPropertyAccess(node.expression),
property: createIdentifier(node.name),
},
// TODO: clean up all the `start` handling!
{ start: node.getStart(), end: node.end });
}
throw new UnsupportedSyntaxError(node.expression);
}
convertComputedPropertyName(node) {
if (!node.name || !ts.isComputedPropertyName(node.name)) {
return;
}
const { expression } = node.name;
if (ts.isIdentifier(expression)) {
return this.pushReference(createIdentifier(expression));
}
if (ts.isPropertyAccessExpression(expression)) {
return this.pushReference(this.convertPropertyAccess(expression));
}
throw new UnsupportedSyntaxError(expression);
}
convertParametersAndType(node) {
this.convertComputedPropertyName(node);
const typeVariables = this.convertTypeParameters(node.typeParameters);

@@ -547,9 +592,3 @@ for (const param of node.parameters) {

if (ts.isPropertyDeclaration(node) || ts.isPropertySignature(node) || ts.isIndexSignatureDeclaration(node)) {
if (node.name && ts.isComputedPropertyName(node.name)) {
const { expression } = node.name;
if (!ts.isEntityName(expression)) {
throw new UnsupportedSyntaxError(expression);
}
this.pushReference(this.convertEntityName(expression));
}
this.convertComputedPropertyName(node);
this.convertTypeNode(node.type);

@@ -706,15 +745,2 @@ continue;

}
convertEntityName(node) {
if (ts.isIdentifier(node)) {
return createIdentifier(node);
}
return withStartEnd({
type: "MemberExpression",
computed: false,
object: this.convertEntityName(node.left),
property: createIdentifier(node.right),
},
// TODO: clean up all the `start` handling!
{ start: node.getStart(), end: node.end });
}
convertNamespace(node) {

@@ -721,0 +747,0 @@ this.pushScope();

{
"name": "rollup-plugin-dts",
"version": "1.1.5",
"version": "1.1.6",
"description": "An experiment to generate .d.ts rollup files",

@@ -62,5 +62,5 @@ "keywords": [

"@types/fs-extra": "^8.0.0",
"@types/jest": "^24.0.15",
"@types/node": "^12.0.10",
"@types/react": "^16.8.22",
"@types/jest": "^24.0.16",
"@types/node": "^12.6.8",
"@types/react": "^16.8.23",
"esm": "^3.2.25",

@@ -71,13 +71,13 @@ "fs-extra": "^8.1.0",

"react": "^16.8.6",
"rollup": "^1.16.3",
"rollup": "^1.17.0",
"ts-jest": "^24.0.2",
"typescript": "3.5.2"
"typescript": "3.5.3"
},
"peerDependencies": {
"rollup": "^1.16.3",
"typescript": "^3.5.2"
"rollup": "^1.17.0",
"typescript": "^3.5.3"
},
"optionalDependencies": {
"@babel/code-frame": "^7.0.0"
"@babel/code-frame": "^7.5.5"
}
}

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