Skip to content

TypeScriptToLua plugin that replaces calls to the TSTL `delete` function with a statement setting a value to `nil`.

License

Notifications You must be signed in to change notification settings

thinknathan/tstl-simple-delete

Repository files navigation

tstl-simple-delete

CI GitHub License

TypeScriptToLua plugin that replaces calls to the TSTL delete function with a statement setting a value to nil.

This repo offers an alternate implementation to the simplifyDelete option in gb-tstl-utils.

❗ Use this and any code transformation plugin with caution. Mistakes are possible.

Example

__TS__Delete(x, y) becomes x[y] = nil

Installation

Requires TSTL >= 1.22.0.

  1. Install this plugin
yarn add tstl-simple-delete -D
# or
npm install tstl-simple-delete --save-dev
  1. Add tstl-simple-delete to tstl.luaPlugins in tsconfig.json
{
	"tstl": {
		"luaPlugins": [
+			{
+				"name": "tstl-simple-delete"
+			}
		],
	}
}

License

CC0

About

TypeScriptToLua plugin that replaces calls to the TSTL `delete` function with a statement setting a value to `nil`.

Topics

Resources

License

Stars

Watchers

Forks