warscript 0.0.1-dev.3f45527 → 0.0.1-dev.40c20e7

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.
@@ -19,13 +19,16 @@ local ____frame_2Dcoordinates = require("engine.internal.misc.frame-coordinates"
19
19
  local FRAME_MAX_Y = ____frame_2Dcoordinates.FRAME_MAX_Y
20
20
  local FRAME_MIN_Y = ____frame_2Dcoordinates.FRAME_MIN_Y
21
21
  local getFrameMinXMaxX = ____frame_2Dcoordinates.getFrameMinXMaxX
22
+ local ____playerCamera = require("core.types.playerCamera")
23
+ local frameCoordinatesToWorld = ____playerCamera.frameCoordinatesToWorld
24
+ local worldCoordinatesToFrame = ____playerCamera.worldCoordinatesToFrame
25
+ local ____get_2Dterrain_2Dz = require("engine.internal.misc.get-terrain-z")
26
+ local getTerrainZ = ____get_2Dterrain_2Dz.getTerrainZ
22
27
  local frameClick = BlzFrameClick
23
28
  local frameGetEnable = BlzFrameGetEnable
24
29
  local frameIsVisible = BlzFrameIsVisible
25
30
  local frameSetEnable = BlzFrameSetEnable
26
31
  local frameSetScale = BlzFrameSetScale
27
- local getCameraTargetPositionX = GetCameraTargetPositionX
28
- local getCameraTargetPositionY = GetCameraTargetPositionY
29
32
  local ____rawget = _G.rawget
30
33
  local rawset = _G.rawset
31
34
  local invoke = Event.invoke
@@ -936,16 +939,19 @@ __TS__ObjectDefineProperty(
936
939
  local event = __TS__New(Event)
937
940
  local syncX = 0
938
941
  local syncY = 0
939
- local syncCamX = getCameraTargetPositionX()
940
- local syncCamY = getCameraTargetPositionY()
942
+ local syncFrameX = 0
943
+ local syncFrameY = 0
941
944
  local lastX = syncX
942
945
  local lastY = syncY
943
946
  self.onMouseMove:addListener(function(player, x, y)
944
947
  if player.isLocal then
945
948
  syncX = x
946
949
  syncY = y
947
- syncCamX = getCameraTargetPositionX()
948
- syncCamY = getCameraTargetPositionY()
950
+ syncFrameX, syncFrameY = worldCoordinatesToFrame(
951
+ x,
952
+ y,
953
+ getTerrainZ(x, y)
954
+ )
949
955
  lastX = x
950
956
  lastY = y
951
957
  invoke(event, x, y)
@@ -955,9 +961,8 @@ __TS__ObjectDefineProperty(
955
961
  if syncX == 0 and syncY == 0 then
956
962
  return
957
963
  end
958
- local x = syncX + (getCameraTargetPositionX() - syncCamX)
959
- local y = syncY + (getCameraTargetPositionY() - syncCamY)
960
- if x ~= lastX or y ~= lastY then
964
+ local x, y, ____, isDefinite = frameCoordinatesToWorld(syncFrameX, syncFrameY)
965
+ if isDefinite and (x ~= lastX or y ~= lastY) then
961
966
  lastX = x
962
967
  lastY = y
963
968
  invoke(event, x, y)
@@ -13,6 +13,8 @@ local ____frame_2Dcoordinates = require("engine.internal.misc.frame-coordinates"
13
13
  local FRAME_MAX_Y = ____frame_2Dcoordinates.FRAME_MAX_Y
14
14
  local FRAME_MIN_Y = ____frame_2Dcoordinates.FRAME_MIN_Y
15
15
  local getFrameMinXMaxX = ____frame_2Dcoordinates.getFrameMinXMaxX
16
+ local ____get_2Dterrain_2Dz = require("engine.internal.misc.get-terrain-z")
17
+ local getTerrainZ = ____get_2Dterrain_2Dz.getTerrainZ
16
18
  local getHandleId = GetHandleId
17
19
  local setCameraField = SetCameraField
18
20
  local getCameraField = GetCameraField
@@ -26,6 +28,7 @@ local resetToGameCamera = ResetToGameCamera
26
28
  local cos = math.cos
27
29
  local deg = math.deg
28
30
  local sin = math.sin
31
+ local sqrt = math.sqrt
29
32
  local memoized = {}
30
33
  ____exports.PlayerCamera = __TS__Class()
31
34
  local PlayerCamera = ____exports.PlayerCamera
@@ -233,4 +236,45 @@ ____exports.worldCoordinatesToFrame = function(x, y, z)
233
236
  local frameY = 0.42625 - yCenterScreenShift + (cameraAngleOfAttackSinRotationCos * dx + cameraAngleOfAttackSinRotationSin * dy - cameraAngleOfAttackCos * dz) / xPrime
234
237
  return frameX, frameY, xPrime < 0 and frameX >= frameMinX and frameX <= frameMaxX and frameY >= FRAME_MIN_Y and frameY <= FRAME_MAX_Y
235
238
  end
239
+ ---
240
+ -- @internal For use by internal systems only.
241
+ ____exports.frameCoordinatesToWorld = function(x, y)
242
+ if not isCameraViewPrecalculated then
243
+ precalculateCameraView()
244
+ end
245
+ local a = (x - 0.4) * scaleFactor
246
+ local b = (0.42625 - yCenterScreenShift - y) * scaleFactor
247
+ local nx = 1 / sqrt(1 + a * a + b * b)
248
+ local ny = sqrt(1 - (1 + b * b) * nx * nx)
249
+ local nz = sqrt(1 - nx * nx - ny * ny)
250
+ if a > 0 then
251
+ ny = -ny
252
+ end
253
+ if b < 0 then
254
+ nz = -nz
255
+ end
256
+ local nxPrime = cameraAngleOfAttackCosRotationCos * nx - cameraRotationSin * ny + cameraAngleOfAttackSinRotationCos * nz
257
+ local nyPrime = cameraAngleOfAttackCosRotationSin * nx + cameraRotationCos * ny + cameraAngleOfAttackSinRotationSin * nz
258
+ local nzPrime = -cameraAngleOfAttackSin * nx + cameraAngleOfAttackCos * nz
259
+ local zGuess = getTerrainZ(cameraEyeX, cameraEyeY)
260
+ local xGuess = cameraEyeX + nxPrime * (cameraEyeZ - zGuess) / nzPrime
261
+ local yGuess = cameraEyeY + nyPrime * (cameraEyeZ - zGuess) / nzPrime
262
+ local zWorld = getTerrainZ(xGuess, yGuess)
263
+ local deltaZ = zWorld - zGuess
264
+ zGuess = zWorld
265
+ local zWorldOld = zWorld
266
+ local deltaZOld = deltaZ
267
+ local i = 0
268
+ while (deltaZ > 1 or deltaZ < -1) and i < 50 do
269
+ xGuess = cameraEyeX + nxPrime * (cameraEyeZ - zGuess) / nzPrime
270
+ yGuess = cameraEyeY + nyPrime * (cameraEyeZ - zGuess) / nzPrime
271
+ zWorld = getTerrainZ(xGuess, yGuess)
272
+ deltaZ = zWorld - zGuess
273
+ zGuess = (deltaZOld * zWorld - deltaZ * zWorldOld) / (deltaZOld - deltaZ)
274
+ zWorldOld = zWorld
275
+ deltaZOld = deltaZ
276
+ i = i + 1
277
+ end
278
+ return xGuess, yGuess, zWorld, i < 50
279
+ end
236
280
  return ____exports
@@ -5,6 +5,14 @@ export declare class TileCell implements Readonly<Vec2> {
5
5
  readonly y: number;
6
6
  readonly z: undefined;
7
7
  protected constructor(id: number, x: number, y: number, z: undefined);
8
+ get up(): TileCell;
9
+ get down(): TileCell;
10
+ get left(): TileCell;
11
+ get right(): TileCell;
12
+ get terrainTypeId(): number;
13
+ set terrainTypeId(terrainTypeId: number);
14
+ get terrainVariance(): number;
15
+ set terrainVariance(terrainVariance: number);
8
16
  isInRangeOf(x: number, y: number, range: number): boolean;
9
17
  isInRangeOf(tileCell: TileCell, range: number): boolean;
10
18
  static getInRect(minX: number, minY: number, maxX: number, maxY: number): TileCell[];
@@ -1,7 +1,11 @@
1
1
  local ____lualib = require("lualib_bundle")
2
2
  local __TS__Class = ____lualib.__TS__Class
3
3
  local __TS__New = ____lualib.__TS__New
4
+ local __TS__SetDescriptor = ____lualib.__TS__SetDescriptor
4
5
  local ____exports = {}
6
+ local getTerrainType = GetTerrainType
7
+ local setTerrainType = SetTerrainType
8
+ local getTerrainVariance = GetTerrainVariance
5
9
  local abs = math.abs
6
10
  local ____type = math.type
7
11
  local ult = math.ult
@@ -97,4 +101,78 @@ function TileCell.of(x, y)
97
101
  nil
98
102
  )
99
103
  end
104
+ __TS__SetDescriptor(
105
+ TileCell.prototype,
106
+ "up",
107
+ {get = function(self)
108
+ return ____exports.TileCell.of(self.x, self.y + 128)
109
+ end},
110
+ true
111
+ )
112
+ __TS__SetDescriptor(
113
+ TileCell.prototype,
114
+ "down",
115
+ {get = function(self)
116
+ return ____exports.TileCell.of(self.x, self.y - 128)
117
+ end},
118
+ true
119
+ )
120
+ __TS__SetDescriptor(
121
+ TileCell.prototype,
122
+ "left",
123
+ {get = function(self)
124
+ return ____exports.TileCell.of(self.x - 128, self.y)
125
+ end},
126
+ true
127
+ )
128
+ __TS__SetDescriptor(
129
+ TileCell.prototype,
130
+ "right",
131
+ {get = function(self)
132
+ return ____exports.TileCell.of(self.x + 128, self.y)
133
+ end},
134
+ true
135
+ )
136
+ __TS__SetDescriptor(
137
+ TileCell.prototype,
138
+ "terrainTypeId",
139
+ {
140
+ get = function(self)
141
+ return getTerrainType(self.x, self.y)
142
+ end,
143
+ set = function(self, terrainTypeId)
144
+ setTerrainType(
145
+ self.x,
146
+ self.y,
147
+ terrainTypeId,
148
+ -1,
149
+ 1,
150
+ 1
151
+ )
152
+ end
153
+ },
154
+ true
155
+ )
156
+ __TS__SetDescriptor(
157
+ TileCell.prototype,
158
+ "terrainVariance",
159
+ {
160
+ get = function(self)
161
+ return getTerrainVariance(self.x, self.y)
162
+ end,
163
+ set = function(self, terrainVariance)
164
+ local x = self.x
165
+ local y = self.y
166
+ setTerrainType(
167
+ x,
168
+ y,
169
+ getTerrainType(x, y),
170
+ terrainVariance,
171
+ 1,
172
+ 1
173
+ )
174
+ end
175
+ },
176
+ true
177
+ )
100
178
  return ____exports
package/decl/native.d.ts CHANGED
@@ -5259,8 +5259,8 @@ declare function BlzRemoveAbilityStringLevelArrayField(
5259
5259
  level: number,
5260
5260
  value: string,
5261
5261
  ): boolean
5262
- declare function BlzGetItemAbilityByIndex(whichItem: jitem, index: number): jability | null
5263
- declare function BlzGetItemAbility(whichItem: jitem, abilCode: number): jability | null
5262
+ declare function BlzGetItemAbilityByIndex(whichItem: jitem, index: number): jability | undefined
5263
+ declare function BlzGetItemAbility(whichItem: jitem, abilCode: number): jability | undefined
5264
5264
  declare function BlzItemAddAbility(whichItem: jitem, abilCode: number): boolean
5265
5265
  declare function BlzGetItemBooleanField(whichItem: jitem, whichField: jitembooleanfield): boolean
5266
5266
  declare function BlzGetItemIntegerField(whichItem: jitem, whichField: jitemintegerfield): number
@@ -15,6 +15,7 @@ export declare abstract class Behavior<T extends AnyNotNil, PeriodicActionParame
15
15
  protected constructor(object: T);
16
16
  protected onDestroy(): Destructor;
17
17
  protected registerEvent<K extends string, Args extends any[]>(this: Behavior<any, PeriodicActionParameters> & Record<K, (this: this, ...args: Args) => unknown>, event: Event<[...Args]>, listener: K): void;
18
+ protected deregisterEvent(event: Event<any>): boolean;
18
19
  protected onPeriod(...parameters: PeriodicActionParameters): void;
19
20
  protected startPeriodicAction(interval: number, ...parameters: PeriodicActionParameters): void;
20
21
  protected stopPeriodicAction(): void;
@@ -118,8 +118,7 @@ function Behavior.prototype.registerEvent(self, event, listener)
118
118
  local behaviors = behaviorsByEvent[event]
119
119
  if behaviors ~= nil then
120
120
  for behavior in pairs(behaviors) do
121
- local ____self_6 = behavior
122
- ____self_6[listenerByBehavior[behavior]](____self_6, ...)
121
+ safeCall(behavior[listenerByBehavior[behavior]], behavior, ...)
123
122
  end
124
123
  end
125
124
  end)
@@ -128,6 +127,15 @@ function Behavior.prototype.registerEvent(self, event, listener)
128
127
  end
129
128
  behaviors:add(self)
130
129
  end
130
+ function Behavior.prototype.deregisterEvent(self, event)
131
+ local behaviors = behaviorsByEvent[event]
132
+ if behaviors ~= nil and behaviors:remove(self) then
133
+ eventsByBehavior[self][event] = nil
134
+ listenerByBehaviorByEvent[event][self] = nil
135
+ return true
136
+ end
137
+ return false
138
+ end
131
139
  function Behavior.prototype.onPeriod(self, ...)
132
140
  end
133
141
  function Behavior.prototype.startPeriodicAction(self, interval, ...)
@@ -21,6 +21,7 @@ local ____bonus = require("engine.internal.unit.bonus")
21
21
  local addOrUpdateOrRemoveUnitBonus = ____bonus.addOrUpdateOrRemoveUnitBonus
22
22
  local getUnitBonus = ____bonus.getUnitBonus
23
23
  local removeUnitBonus = ____bonus.removeUnitBonus
24
+ local safeCall = warpack.safeCall
24
25
  local behaviorsByEvent = {}
25
26
  local rangeByBehaviorByEvent = {}
26
27
  local listenerByBehaviorByEvent = {}
@@ -87,8 +88,7 @@ function UnitBehavior.prototype.registerInRangeUnitEvent(self, event, extractUni
87
88
  for behavior in pairs(behaviors) do
88
89
  local range = rangeByBehavior[behavior]
89
90
  if range ~= nil and unit:getCollisionDistanceTo(behavior.unit) <= range then
90
- local ____self_8 = behavior
91
- ____self_8[listenerByBehavior[behavior]](____self_8, ...)
91
+ safeCall(behavior[listenerByBehavior[behavior]], behavior, ...)
92
92
  end
93
93
  end
94
94
  end
@@ -13,7 +13,6 @@ local ____ability = require("engine.internal.item.ability")
13
13
  local abilityActionDummy = ____ability.abilityActionDummy
14
14
  local doAbilityAction = ____ability.doAbilityAction
15
15
  local doAbilityActionForceDummy = ____ability.doAbilityActionForceDummy
16
- local doUnitAbilityAction = ____ability.doUnitAbilityAction
17
16
  local startItemCooldown = ____ability.startItemCooldown
18
17
  local getUnitAbilityLevel = GetUnitAbilityLevel
19
18
  local setUnitAbilityLevel = SetUnitAbilityLevel
@@ -40,8 +39,6 @@ local getItemBooleanField = BlzGetItemBooleanField
40
39
  local setItemBooleanField = BlzSetItemBooleanField
41
40
  local unitHideAbility = BlzUnitHideAbility
42
41
  local unitDisableAbility = BlzUnitDisableAbility
43
- local unitRemoveAbility = UnitRemoveAbility
44
- local itemRemoveAbility = BlzItemRemoveAbility
45
42
  local match = string.match
46
43
  local ____type = _G.type
47
44
  local ____tostring = _G.tostring
@@ -429,7 +426,9 @@ function UnitAbility.prototype.interruptCast(self)
429
426
  self.owner:interruptCast(self.typeId)
430
427
  end
431
428
  function UnitAbility.prototype.onDestroy(self)
432
- doUnitAbilityAction(self.owner.handle, self.typeId, unitRemoveAbility, self.typeId)
429
+ if self.owner.state ~= 2 then
430
+ self.owner:removeAbility(self.typeId)
431
+ end
433
432
  return UnitAbility.____super.prototype.onDestroy(self)
434
433
  end
435
434
  __TS__SetDescriptor(
@@ -525,7 +524,9 @@ function ItemAbility.prototype.interruptCast(self)
525
524
  end
526
525
  end
527
526
  function ItemAbility.prototype.onDestroy(self)
528
- doAbilityAction(self.owner.handle, itemRemoveAbility, self.typeId)
527
+ if self.owner.state ~= 2 then
528
+ self.owner:removeAbility(self.typeId)
529
+ end
529
530
  return ItemAbility.____super.prototype.onDestroy(self)
530
531
  end
531
532
  __TS__SetDescriptor(
@@ -8,12 +8,10 @@ import { AbilityTypeId } from "../object-data/entry/ability-type";
8
8
  import type { ItemTypeId } from "../object-data/entry/item-type";
9
9
  type DefenseType = 0 | 1 | 2 | 3 | 4 | 5;
10
10
  declare const enum ItemPropertyKey {
11
- ABILITIES = 100,
12
- LUA_INDEX_BY_ABILITY_TYPE_ID = 101
11
+ ABILITIES = 100
13
12
  }
14
13
  export declare class Item extends Handle<jitem> {
15
14
  private readonly [ItemPropertyKey.ABILITIES];
16
- private readonly [ItemPropertyKey.LUA_INDEX_BY_ABILITY_TYPE_ID];
17
15
  constructor(handle: jitem);
18
16
  protected onDestroy(): HandleDestructor;
19
17
  static create<T extends Item>(this: typeof Item & (new (handle: jitem) => T), id: number, x: number, y: number, skinId?: number): T;
@@ -29,6 +29,7 @@ local ____vec2 = require("math.vec2")
29
29
  local distance = ____vec2.distance
30
30
  local itemChargesChangeEvent = __TS__New(Event)
31
31
  local itemAddAbility = BlzItemAddAbility
32
+ local itemRemoveAbility = BlzItemRemoveAbility
32
33
  local getItemAbility = BlzGetItemAbility
33
34
  local isItemPowerup = IsItemPowerup
34
35
  local getItemAbilityByIndex = BlzGetItemAbilityByIndex
@@ -138,13 +139,7 @@ Item.name = "Item"
138
139
  __TS__ClassExtends(Item, Handle)
139
140
  function Item.prototype.____constructor(self, handle)
140
141
  Handle.prototype.____constructor(self, handle)
141
- local abilities = doAbilityAction(handle, getItemAbilities, self)
142
- self[100] = abilities
143
- local luaIndexByAbilityTypeId = {}
144
- for i = 1, #abilities do
145
- luaIndexByAbilityTypeId[abilities[i].typeId] = i
146
- end
147
- self[101] = luaIndexByAbilityTypeId
142
+ self[100] = doAbilityAction(handle, getItemAbilities, self)
148
143
  end
149
144
  function Item.prototype.onDestroy(self)
150
145
  local owner = self.owner
@@ -196,31 +191,32 @@ function Item.prototype.addAbility(self, abilityTypeId)
196
191
  if nativeAbility ~= nil then
197
192
  local ability = ItemAbility:of(nativeAbility, abilityTypeId, self)
198
193
  local abilities = self[100]
199
- local luaIndex = #abilities + 1
200
- abilities[luaIndex] = ability
201
- self[101][abilityTypeId] = luaIndex
194
+ abilities[#abilities + 1] = ability
202
195
  return ability
203
196
  end
204
197
  return nil
205
198
  end
206
199
  function Item.prototype.removeAbility(self, abilityTypeId)
207
- local luaIndexByAbilityTypeId = self[101]
208
- local luaIndex = luaIndexByAbilityTypeId[abilityTypeId]
209
- if luaIndex ~= nil then
210
- local abilities = self[100]
211
- abilities[luaIndex]:destroy()
212
- tableRemove(abilities, luaIndex)
213
- luaIndexByAbilityTypeId[abilityTypeId] = nil
214
- return true
200
+ local abilities = self[100]
201
+ for i = 1, #abilities do
202
+ if abilities[i].typeId == abilityTypeId then
203
+ local ability = abilities[i]
204
+ tableRemove(abilities, i)
205
+ ability:destroy()
206
+ return true
207
+ end
215
208
  end
216
- return false
209
+ return doAbilityAction(self.handle, itemRemoveAbility, abilityTypeId)
217
210
  end
218
211
  function Item.prototype.hasAbility(self, abilityTypeId)
219
- return self[101][abilityTypeId] ~= nil
212
+ return doAbilityAction(self.handle, getItemAbility, abilityTypeId) ~= nil
220
213
  end
221
214
  function Item.prototype.getAbility(self, abilityTypeId)
222
- local ability = self[101][abilityTypeId] ~= nil and doAbilityAction(self.handle, getItemAbility, abilityTypeId)
223
- return ability and ItemAbility:of(ability, abilityTypeId, self) or nil
215
+ return ItemAbility:of(
216
+ doAbilityAction(self.handle, getItemAbility, abilityTypeId),
217
+ abilityTypeId,
218
+ self
219
+ )
224
220
  end
225
221
  function Item.getInRange(self, x, y, range)
226
222
  targetCollection = {}
@@ -438,7 +438,7 @@ rawset(
438
438
  condition(function()
439
439
  local unit = Unit:of(getTriggerUnit())
440
440
  if unit ~= nil then
441
- local ability = unit:getAbilityById(abilityTypeId)
441
+ local ability = unit:getAbility(abilityTypeId)
442
442
  if ability ~= nil then
443
443
  eventInvoke(event, unit, ability, orderTypeStringId)
444
444
  end
@@ -271,8 +271,8 @@ export declare class Unit extends Handle<junit> {
271
271
  setAbilityLevel(abilityId: number, level: number): number;
272
272
  getAbilityLevel(abilityId: number): number;
273
273
  hasAbility(abilityId: number): boolean;
274
- getAbilityById(abilityId: number): UnitAbility | undefined;
275
- removeAbility(abilityId: number): boolean;
274
+ getAbility(abilityId: number): UnitAbility | undefined;
275
+ removeAbility(abilityTypeId: number): boolean;
276
276
  hideAbility(abilityId: number, flag: boolean): void;
277
277
  getAbilityRemainingCooldown(abilityId: number): number;
278
278
  startAbilityCooldown(abilityId: number, cooldown: number): void;
@@ -935,20 +935,21 @@ end
935
935
  function Unit.prototype.hasAbility(self, abilityId)
936
936
  return getUnitAbilityLevel(self.handle, abilityId) > 0
937
937
  end
938
- function Unit.prototype.getAbilityById(self, abilityId)
938
+ function Unit.prototype.getAbility(self, abilityId)
939
939
  local ability = doUnitAbilityAction(self.handle, abilityId, getUnitAbility, abilityId)
940
940
  return UnitAbility:of(ability, abilityId, self)
941
941
  end
942
- function Unit.prototype.removeAbility(self, abilityId)
942
+ function Unit.prototype.removeAbility(self, abilityTypeId)
943
943
  local abilities = self.abilities
944
944
  for i = 1, #abilities do
945
- if abilities[i].typeId == abilityId then
946
- abilities[i]:destroy()
945
+ if abilities[i].typeId == abilityTypeId then
946
+ local ability = abilities[i]
947
947
  tremove(abilities, i)
948
+ ability:destroy()
948
949
  return true
949
950
  end
950
951
  end
951
- return false
952
+ return doUnitAbilityAction(self.handle, abilityTypeId, unitRemoveAbility, abilityTypeId)
952
953
  end
953
954
  function Unit.prototype.hideAbility(self, abilityId, flag)
954
955
  BlzUnitHideAbility(self.handle, abilityId, flag)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "warscript",
4
- "version": "0.0.1-dev.3f45527",
4
+ "version": "0.0.1-dev.40c20e7",
5
5
  "description": "A typescript library for Warcraft III using Warpack.",
6
6
  "keywords": [
7
7
  "warcraft",
package/patch-lualib.lua CHANGED
@@ -3,7 +3,7 @@ local lualib = _G.require("lualib_bundle")
3
3
  local next = _G.next
4
4
  local ____type = _G.type
5
5
  lualib.__TS__ArrayIsArray = function(value)
6
- return ____type(value) == "table" and (value[1] ~= nil or ({next(value)}) == nil) and value.constructor == nil
6
+ return ____type(value) == "table" and (value[1] ~= nil or (next(value)) == nil) and value.constructor == nil
7
7
  end
8
8
  local __TS__SetDescriptor = lualib.__TS__SetDescriptor
9
9
  lualib.__TS__ObjectDefineProperty = function(target, key, desc)