Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typescript-to-lua

Package Overview
Dependencies
Maintainers
2
Versions
157
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typescript-to-lua - npm Package Compare versions

Comparing version 1.16.3 to 1.17.0

4

dist/transformation/utils/language-extensions.d.ts

@@ -53,3 +53,5 @@ import * as ts from "typescript";

TableAddKeyType = "TableAddKey",
TableAddKeyMethodType = "TableAddKeyMethod"
TableAddKeyMethodType = "TableAddKeyMethod",
TableIsEmptyType = "TableIsEmpty",
TableIsEmptyMethodType = "TableIsEmptyMethod"
}

@@ -56,0 +58,0 @@ export declare function getExtensionKindForType(context: TransformationContext, type: ts.Type): ExtensionKind | undefined;

@@ -58,2 +58,4 @@ "use strict";

ExtensionKind["TableAddKeyMethodType"] = "TableAddKeyMethod";
ExtensionKind["TableIsEmptyType"] = "TableIsEmpty";
ExtensionKind["TableIsEmptyMethodType"] = "TableIsEmptyMethod";
})(ExtensionKind || (exports.ExtensionKind = ExtensionKind = {}));

@@ -117,27 +119,3 @@ const extensionValues = new Set(Object.values(ExtensionKind));

exports.getIterableExtensionKindForNode = getIterableExtensionKindForNode;
exports.methodExtensionKinds = new Set([
ExtensionKind.AdditionOperatorMethodType,
ExtensionKind.SubtractionOperatorMethodType,
ExtensionKind.MultiplicationOperatorMethodType,
ExtensionKind.DivisionOperatorMethodType,
ExtensionKind.ModuloOperatorMethodType,
ExtensionKind.PowerOperatorMethodType,
ExtensionKind.FloorDivisionOperatorMethodType,
ExtensionKind.BitwiseAndOperatorMethodType,
ExtensionKind.BitwiseOrOperatorMethodType,
ExtensionKind.BitwiseExclusiveOrOperatorMethodType,
ExtensionKind.BitwiseLeftShiftOperatorMethodType,
ExtensionKind.BitwiseRightShiftOperatorMethodType,
ExtensionKind.ConcatOperatorMethodType,
ExtensionKind.LessThanOperatorMethodType,
ExtensionKind.GreaterThanOperatorMethodType,
ExtensionKind.NegationOperatorMethodType,
ExtensionKind.BitwiseNotOperatorMethodType,
ExtensionKind.LengthOperatorMethodType,
ExtensionKind.TableDeleteMethodType,
ExtensionKind.TableGetMethodType,
ExtensionKind.TableHasMethodType,
ExtensionKind.TableSetMethodType,
ExtensionKind.TableAddKeyMethodType,
]);
exports.methodExtensionKinds = new Set(Object.values(ExtensionKind).filter(key => key.endsWith("Method")));
function getNaryCallExtensionArgs(context, node, kind, numArgs) {

@@ -144,0 +122,0 @@ let expressions;

@@ -23,2 +23,4 @@ "use strict";

[language_extensions_1.ExtensionKind.TableAddKeyMethodType]: transformTableAddKeyExpression,
[language_extensions_1.ExtensionKind.TableIsEmptyType]: transformTableIsEmptyExpression,
[language_extensions_1.ExtensionKind.TableIsEmptyMethodType]: transformTableIsEmptyExpression,
};

@@ -75,2 +77,11 @@ function transformTableDeleteExpression(context, node, extensionKind) {

}
function transformTableIsEmptyExpression(context, node, extensionKind) {
const args = (0, language_extensions_1.getUnaryCallExtensionArg)(context, node, extensionKind);
if (!args) {
return lua.createNilLiteral();
}
const table = context.transformExpression(args);
// next(arg0) == nil
return lua.createBinaryExpression(lua.createCallExpression(lua.createIdentifier("next"), [table], node), lua.createNilLiteral(), lua.SyntaxKind.EqualityOperator, node);
}
//# sourceMappingURL=table.js.map
{
"name": "typescript-to-lua",
"version": "1.16.3",
"version": "1.17.0",
"description": "A generic TypeScript to Lua transpiler. Write your code in TypeScript and publish Lua!",

@@ -5,0 +5,0 @@ "repository": "https://github.com/TypeScriptToLua/TypeScriptToLua",

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