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 0.12.0 to 0.12.1

3

dist/TSHelper.d.ts

@@ -10,2 +10,3 @@ import * as ts from "typescript";

static isInDestructingAssignment(node: ts.Node): boolean;
static forTypeOrAnySupertype(type: ts.Type, checker: ts.TypeChecker, callback: (type: ts.Type) => boolean): boolean;
static isStringType(type: ts.Type): boolean;

@@ -19,3 +20,5 @@ static isArrayTypeNode(typeNode: ts.TypeNode): boolean;

static findFirstNodeAbove<T extends ts.Node>(node: ts.Node, callback: (n: ts.Node) => n is T): T;
static hasExplicitGetAccessor(type: ts.Type, name: ts.__String): boolean;
static hasGetAccessor(node: ts.Node, checker: ts.TypeChecker): boolean;
static hasExplicitSetAccessor(type: ts.Type, name: ts.__String): boolean;
static hasSetAccessor(node: ts.Node, checker: ts.TypeChecker): boolean;

@@ -22,0 +25,0 @@ static isBinaryAssignmentToken(token: ts.SyntaxKind): [boolean, ts.BinaryOperator];

50

dist/TSHelper.js

@@ -75,2 +75,20 @@ "use strict";

}
// iterate over a type and its bases until the callback returns true.
static forTypeOrAnySupertype(type, checker, callback) {
if (callback(type)) {
return true;
}
if (!type.isClassOrInterface() && type.symbol) {
type = checker.getDeclaredTypeOfSymbol(type.symbol);
}
const baseTypes = type.getBaseTypes();
if (baseTypes) {
for (const baseType of baseTypes) {
if (this.forTypeOrAnySupertype(baseType, checker, callback)) {
return true;
}
}
}
return false;
}
static isStringType(type) {

@@ -92,11 +110,3 @@ return (type.flags & ts.TypeFlags.String) !== 0

static isArrayType(type, checker) {
const baseTypes = type.getBaseTypes();
if (baseTypes) {
for (const baseType of baseTypes) {
if (this.isExplicitArrayType(baseType, checker)) {
return true;
}
}
}
return this.isExplicitArrayType(type, checker);
return this.forTypeOrAnySupertype(type, checker, t => this.isExplicitArrayType(t, checker));
}

@@ -167,2 +177,8 @@ static isTupleReturnCall(node, checker) {

}
static hasExplicitGetAccessor(type, name) {
if (type && type.symbol && type.symbol.members) {
const field = type.symbol.members.get(name);
return field && (field.flags & ts.SymbolFlags.GetAccessor) !== 0;
}
}
static hasGetAccessor(node, checker) {

@@ -172,9 +188,12 @@ if (ts.isPropertyAccessExpression(node)) {

const type = checker.getTypeAtLocation(node.expression);
if (type && type.symbol && type.symbol.members) {
const field = type.symbol.members.get(name);
return field && (field.flags & ts.SymbolFlags.GetAccessor) !== 0;
}
return this.forTypeOrAnySupertype(type, checker, t => this.hasExplicitGetAccessor(t, name));
}
return false;
}
static hasExplicitSetAccessor(type, name) {
if (type && type.symbol && type.symbol.members) {
const field = type.symbol.members.get(name);
return field && (field.flags & ts.SymbolFlags.SetAccessor) !== 0;
}
}
static hasSetAccessor(node, checker) {

@@ -184,6 +203,3 @@ if (ts.isPropertyAccessExpression(node)) {

const type = checker.getTypeAtLocation(node.expression);
if (type && type.symbol && type.symbol.members) {
const field = type.symbol.members.get(name);
return field && (field.flags & ts.SymbolFlags.SetAccessor) !== 0;
}
return this.forTypeOrAnySupertype(type, checker, t => this.hasExplicitSetAccessor(t, name));
}

@@ -190,0 +206,0 @@ return false;

{
"name": "typescript-to-lua",
"license": "MIT",
"version": "0.12.0",
"version": "0.12.1",
"repository": "https://github.com/Perryvw/TypescriptToLua",

@@ -6,0 +6,0 @@ "keywords": [

Sorry, the diff of this file is too big to display

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