typescript-to-lua 1.11.0 → 1.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/LuaLib.d.ts CHANGED
@@ -50,7 +50,6 @@ export declare enum LuaLibFeature {
50
50
  MathAtan2 = "MathAtan2",
51
51
  MathModf = "MathModf",
52
52
  MathSign = "MathSign",
53
- Modulo50 = "Modulo50",
54
53
  New = "New",
55
54
  Number = "Number",
56
55
  NumberIsFinite = "NumberIsFinite",
package/dist/LuaLib.js CHANGED
@@ -54,7 +54,6 @@ var LuaLibFeature;
54
54
  LuaLibFeature["MathAtan2"] = "MathAtan2";
55
55
  LuaLibFeature["MathModf"] = "MathModf";
56
56
  LuaLibFeature["MathSign"] = "MathSign";
57
- LuaLibFeature["Modulo50"] = "Modulo50";
58
57
  LuaLibFeature["New"] = "New";
59
58
  LuaLibFeature["Number"] = "Number";
60
59
  LuaLibFeature["NumberIsFinite"] = "NumberIsFinite";
@@ -20,7 +20,7 @@ do
20
20
  do
21
21
  result = __TS__StringAccess(
22
22
  radixChars,
23
- __TS__Modulo50(integer, radix)
23
+ math.mod(integer, radix)
24
24
  ) .. result
25
25
  integer = math.floor(integer / radix)
26
26
  end
@@ -1445,10 +1445,6 @@ local function __TS__MathSign(val)
1445
1445
  return 0
1446
1446
  end
1447
1447
 
1448
- local function __TS__Modulo50(a, b)
1449
- return a - math.floor(a / b) * b
1450
- end
1451
-
1452
1448
  local function __TS__Number(value)
1453
1449
  local valueType = type(value)
1454
1450
  if valueType == "number" then
@@ -1506,7 +1502,7 @@ do
1506
1502
  do
1507
1503
  result = __TS__StringAccess(
1508
1504
  radixChars,
1509
- __TS__Modulo50(integer, radix)
1505
+ math.mod(integer, radix)
1510
1506
  ) .. result
1511
1507
  integer = math.floor(integer / radix)
1512
1508
  end
@@ -2533,7 +2529,6 @@ return {
2533
2529
  __TS__MathAtan2 = __TS__MathAtan2,
2534
2530
  __TS__MathModf = __TS__MathModf,
2535
2531
  __TS__MathSign = __TS__MathSign,
2536
- __TS__Modulo50 = __TS__Modulo50,
2537
2532
  __TS__New = __TS__New,
2538
2533
  __TS__Number = __TS__Number,
2539
2534
  __TS__NumberIsFinite = __TS__NumberIsFinite,
@@ -319,11 +319,6 @@
319
319
  "__TS__MathSign"
320
320
  ]
321
321
  },
322
- "Modulo50": {
323
- "exports": [
324
- "__TS__Modulo50"
325
- ]
326
- },
327
322
  "New": {
328
323
  "exports": [
329
324
  "__TS__New"
@@ -349,7 +344,6 @@
349
344
  "__TS__NumberToString"
350
345
  ],
351
346
  "dependencies": [
352
- "Modulo50",
353
347
  "StringAccess",
354
348
  "MathModf"
355
349
  ]
@@ -1384,10 +1384,6 @@ local function __TS__MathSign(val)
1384
1384
  return 0
1385
1385
  end
1386
1386
 
1387
- local function __TS__Modulo50(a, b)
1388
- return a - math.floor(a / b) * b
1389
- end
1390
-
1391
1387
  local function __TS__Number(value)
1392
1388
  local valueType = type(value)
1393
1389
  if valueType == "number" then
@@ -2476,7 +2472,6 @@ return {
2476
2472
  __TS__MathAtan2 = __TS__MathAtan2,
2477
2473
  __TS__MathModf = __TS__MathModf,
2478
2474
  __TS__MathSign = __TS__MathSign,
2479
- __TS__Modulo50 = __TS__Modulo50,
2480
2475
  __TS__New = __TS__New,
2481
2476
  __TS__Number = __TS__Number,
2482
2477
  __TS__NumberIsFinite = __TS__NumberIsFinite,
@@ -319,11 +319,6 @@
319
319
  "__TS__MathSign"
320
320
  ]
321
321
  },
322
- "Modulo50": {
323
- "exports": [
324
- "__TS__Modulo50"
325
- ]
326
- },
327
322
  "New": {
328
323
  "exports": [
329
324
  "__TS__New"
@@ -44,7 +44,8 @@ function transformBinaryOperationWithNoPrecedingStatements(context, left, right,
44
44
  return transformNullishCoalescingOperationNoPrecedingStatements(context, node, left, right);
45
45
  }
46
46
  if (operator === ts.SyntaxKind.PercentToken && context.luaTarget === CompilerOptions_1.LuaTarget.Lua50) {
47
- return (0, lualib_1.transformLuaLibFunction)(context, lualib_1.LuaLibFeature.Modulo50, node, left, right);
47
+ const mathMod = lua.createTableIndexExpression(lua.createIdentifier("math"), lua.createStringLiteral("mod"));
48
+ return lua.createCallExpression(mathMod, [left, right], node);
48
49
  }
49
50
  let luaOperator = simpleOperatorsToLua[operator];
50
51
  // Check if we need to use string concat operator
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-to-lua",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
4
4
  "description": "A generic TypeScript to Lua transpiler. Write your code in TypeScript and publish Lua!",
5
5
  "repository": "https://github.com/TypeScriptToLua/TypeScriptToLua",
6
6
  "homepage": "https://typescripttolua.github.io/",
@@ -1,3 +0,0 @@
1
- local function __TS__Modulo50(a, b)
2
- return a - math.floor(a / b) * b
3
- end
@@ -1,3 +0,0 @@
1
- local function __TS__Modulo50(a, b)
2
- return a - math.floor(a / b) * b
3
- end