New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ts-liveserver/ts-transpiler

Package Overview
Dependencies
Maintainers
2
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ts-liveserver/ts-transpiler - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

5

__tests__/transformers/CommonJsTransformer.test.ts

@@ -101,2 +101,7 @@ import CommonJsTransformer from '../../src/transformers/CommonJsTransformer'

})
it('Should convert define.property with value', async () => {
const input =
'Object.defineProperty(exports, "__esModule", { value: true })'
expect(await transformWithPlugin(input)).toMatchSnapshot()
})
it('Should convert ObjectLiteralExpression', async () => {

@@ -103,0 +108,0 @@ const input = 'module.exports = { a: b, c: d }'

@@ -69,2 +69,12 @@ "use strict";

}
const propertyValue = thirdArgument.properties
.filter((property) => typescript_1.default.isPropertyAssignment(property))
.find((property) => typescript_1.default.isPropertyAssignment(property) &&
typescript_1.default.isIdentifier(property.name) &&
property.name.text === 'value');
if (propertyValue &&
typescript_1.default.isPropertyAssignment(propertyValue) &&
propertyValue.initializer) {
return typescript_1.default.factory.createBinaryExpression(typescript_1.default.factory.createPropertyAccessExpression(typescript_1.default.factory.createIdentifier(KEYNAME_EXPORTS), typescript_1.default.factory.createIdentifier(secondArgument.text)), typescript_1.default.SyntaxKind.EqualsToken, propertyValue.initializer);
}
}

@@ -71,0 +81,0 @@ }

2

package.json
{
"name": "@ts-liveserver/ts-transpiler",
"version": "0.0.5",
"version": "0.0.6",
"main": "dist/index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -98,2 +98,24 @@ import TypeScript from 'typescript'

}
const propertyValue = thirdArgument.properties
.filter((property) => TypeScript.isPropertyAssignment(property))
.find(
(property) =>
TypeScript.isPropertyAssignment(property) &&
TypeScript.isIdentifier(property.name) &&
property.name.text === 'value',
)
if (
propertyValue &&
TypeScript.isPropertyAssignment(propertyValue) &&
propertyValue.initializer
) {
return TypeScript.factory.createBinaryExpression(
TypeScript.factory.createPropertyAccessExpression(
TypeScript.factory.createIdentifier(KEYNAME_EXPORTS),
TypeScript.factory.createIdentifier(secondArgument.text),
),
TypeScript.SyntaxKind.EqualsToken,
propertyValue.initializer,
)
}
}

@@ -100,0 +122,0 @@ }

Sorry, the diff of this file is not supported yet

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