This repository has been archived by the owner on May 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lualib_bundle.lua
1477 lines (1417 loc) · 39.3 KB
/
lualib_bundle.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
function __TS__ArrayConcat(arr1, ...)
local args = ({...})
local out = {}
for ____, val in ipairs(arr1) do
out[#out + 1] = val
end
for ____, arg in ipairs(args) do
if pcall(
function() return #arg end
) and type(arg) ~= "string" then
local argAsArray = arg
for ____, val in ipairs(argAsArray) do
out[#out + 1] = val
end
else
out[#out + 1] = arg
end
end
return out
end
function __TS__ArrayEvery(arr, callbackfn)
do
local i = 0
while i < #arr do
if not callbackfn(_G, arr[i + 1], i, arr) then
return false
end
i = i + 1
end
end
return true
end
function __TS__ArrayFilter(arr, callbackfn)
local result = {}
do
local i = 0
while i < #arr do
if callbackfn(_G, arr[i + 1], i, arr) then
result[#result + 1] = arr[i + 1]
end
i = i + 1
end
end
return result
end
function __TS__ArrayForEach(arr, callbackFn)
do
local i = 0
while i < #arr do
callbackFn(_G, arr[i + 1], i, arr)
i = i + 1
end
end
end
function __TS__ArrayFind(arr, predicate)
local len = #arr
local k = 0
while k < len do
local elem = arr[k + 1]
if predicate(_G, elem, k, arr) then
return elem
end
k = k + 1
end
return nil
end
function __TS__ArrayFindIndex(arr, callbackFn)
do
local i = 0
local len = #arr
while i < len do
if callbackFn(_G, arr[i + 1], i, arr) then
return i
end
i = i + 1
end
end
return -1
end
function __TS__ArrayIndexOf(arr, searchElement, fromIndex)
local len = #arr
if len == 0 then
return -1
end
local n = 0
if fromIndex then
n = fromIndex
end
if n >= len then
return -1
end
local k
if n >= 0 then
k = n
else
k = len + n
if k < 0 then
k = 0
end
end
do
local i = k
while i < len do
if arr[i + 1] == searchElement then
return i
end
i = i + 1
end
end
return -1
end
function __TS__ArrayMap(arr, callbackfn)
local newArray = {}
do
local i = 0
while i < #arr do
newArray[i + 1] = callbackfn(_G, arr[i + 1], i, arr)
i = i + 1
end
end
return newArray
end
function __TS__ArrayPush(arr, ...)
local items = ({...})
for ____, item in ipairs(items) do
arr[#arr + 1] = item
end
return #arr
end
function __TS__ArrayReduce(arr, callbackFn, ...)
local len = #arr
local k = 0
local accumulator = nil
if select("#", ...) ~= 0 then
accumulator = select(1, ...)
elseif len > 0 then
accumulator = arr[1]
k = 1
else
error("Reduce of empty array with no initial value", 0)
end
for i = k, len - 1 do
accumulator = callbackFn(_G, accumulator, arr[i + 1], i, arr)
end
return accumulator
end
function __TS__ArrayReduceRight(arr, callbackFn, ...)
local len = #arr
local k = len - 1
local accumulator = nil
if select("#", ...) ~= 0 then
accumulator = select(1, ...)
elseif len > 0 then
accumulator = arr[k + 1]
k = k - 1
else
error("Reduce of empty array with no initial value", 0)
end
for i = k, 0, -1 do
accumulator = callbackFn(_G, accumulator, arr[i + 1], i, arr)
end
return accumulator
end
function __TS__ArrayReverse(arr)
local i = 0
local j = #arr - 1
while i < j do
local temp = arr[j + 1]
arr[j + 1] = arr[i + 1]
arr[i + 1] = temp
i = i + 1
j = j - 1
end
return arr
end
function __TS__ArrayShift(arr)
return table.remove(arr, 1)
end
function __TS__ArrayUnshift(arr, ...)
local items = ({...})
do
local i = #items - 1
while i >= 0 do
table.insert(arr, 1, items[i + 1])
i = i - 1
end
end
return #arr
end
function __TS__ArraySort(arr, compareFn)
if compareFn ~= nil then
table.sort(
arr,
function(a, b) return compareFn(_G, a, b) < 0 end
)
else
table.sort(arr)
end
return arr
end
function __TS__ArraySlice(list, first, last)
local len = #list
local relativeStart = first or 0
local k
if relativeStart < 0 then
k = math.max(len + relativeStart, 0)
else
k = math.min(relativeStart, len)
end
local relativeEnd = last
if last == nil then
relativeEnd = len
end
local final
if relativeEnd < 0 then
final = math.max(len + relativeEnd, 0)
else
final = math.min(relativeEnd, len)
end
local out = {}
local n = 0
while k < final do
out[n + 1] = list[k + 1]
k = k + 1
n = n + 1
end
return out
end
function __TS__ArraySome(arr, callbackfn)
do
local i = 0
while i < #arr do
if callbackfn(_G, arr[i + 1], i, arr) then
return true
end
i = i + 1
end
end
return false
end
function __TS__ArraySplice(list, ...)
local len = #list
local actualArgumentCount = select("#", ...)
local start = select(1, ...)
local deleteCount = select(2, ...)
local actualStart
if start < 0 then
actualStart = math.max(len + start, 0)
else
actualStart = math.min(start, len)
end
local itemCount = math.max(actualArgumentCount - 2, 0)
local actualDeleteCount
if actualArgumentCount == 0 then
actualDeleteCount = 0
elseif actualArgumentCount == 1 then
actualDeleteCount = len - actualStart
else
actualDeleteCount = math.min(
math.max(deleteCount or 0, 0),
len - actualStart
)
end
local out = {}
do
local k = 0
while k < actualDeleteCount do
local from = actualStart + k
if list[from + 1] then
out[k + 1] = list[from + 1]
end
k = k + 1
end
end
if itemCount < actualDeleteCount then
do
local k = actualStart
while k < len - actualDeleteCount do
local from = k + actualDeleteCount
local to = k + itemCount
if list[from + 1] then
list[to + 1] = list[from + 1]
else
list[to + 1] = nil
end
k = k + 1
end
end
do
local k = len
while k > len - actualDeleteCount + itemCount do
list[k] = nil
k = k - 1
end
end
elseif itemCount > actualDeleteCount then
do
local k = len - actualDeleteCount
while k > actualStart do
local from = k + actualDeleteCount - 1
local to = k + itemCount - 1
if list[from + 1] then
list[to + 1] = list[from + 1]
else
list[to + 1] = nil
end
k = k - 1
end
end
end
local j = actualStart
for i = 3, actualArgumentCount do
list[j + 1] = select(i, ...)
j = j + 1
end
do
local k = #list - 1
while k >= len - actualDeleteCount + itemCount do
list[k + 1] = nil
k = k - 1
end
end
return out
end
function __TS__ArrayToObject(array)
local object = {}
do
local i = 0
while i < #array do
object[i] = array[i + 1]
i = i + 1
end
end
return object
end
function __TS__ArrayFlat(array, depth)
if depth == nil then
depth = 1
end
local result = {}
for ____, value in ipairs(array) do
if depth > 0 and type(value) == "table" and (value[1] ~= nil or next(value, nil) == nil) then
result = __TS__ArrayConcat(
result,
__TS__ArrayFlat(value, depth - 1)
)
else
result[#result + 1] = value
end
end
return result
end
function __TS__ArrayFlatMap(array, callback)
local result = {}
do
local i = 0
while i < #array do
local value = callback(_G, array[i + 1], i, array)
if type(value) == "table" and (value[1] ~= nil or next(value, nil) == nil) then
result = __TS__ArrayConcat(result, value)
else
result[#result + 1] = value
end
i = i + 1
end
end
return result
end
function __TS__ArraySetLength(arr, length)
if length < 0 or length ~= length or length == math.huge or math.floor(length) ~= length then
error(
"invalid array length: " .. tostring(length),
0
)
end
do
local i = #arr - 1
while i >= length do
arr[i + 1] = nil
i = i - 1
end
end
return length
end
function __TS__ClassIndex(classTable, key)
while true do
local getters = rawget(classTable, "____getters")
if getters then
local getter
getter = getters[key]
if getter then
return getter(classTable)
end
end
classTable = rawget(classTable, "____super")
if not classTable then
break
end
local val = rawget(classTable, key)
if val ~= nil then
return val
end
end
end
function __TS__ClassNewIndex(classTable, key, val)
local tbl = classTable
repeat
do
local setters = rawget(tbl, "____setters")
if setters then
local setter
setter = setters[key]
if setter then
setter(tbl, val)
return
end
end
tbl = rawget(tbl, "____super")
end
until not tbl
rawset(classTable, key, val)
end
function __TS__Decorate(decorators, target, key, desc)
local result = target
do
local i = #decorators
while i >= 0 do
local decorator = decorators[i + 1]
if decorator then
local oldResult = result
if key == nil then
result = decorator(_G, result)
elseif desc ~= nil then
result = decorator(_G, target, key, result)
else
result = decorator(_G, target, key)
end
result = result or oldResult
end
i = i - 1
end
end
return result
end
function __TS__FunctionCall(fn, thisArg, ...)
local args = ({...})
return fn(
thisArg,
(unpack or table.unpack)(args)
)
end
function __TS__GetErrorStack(self, constructor)
local level = 1
while true do
local info = debug.getinfo(level, "f")
level = level + 1
if not info then
level = 1
break
elseif info.func == constructor then
break
end
end
return debug.traceback(nil, level)
end
function __TS__WrapErrorToString(self, getDescription)
return function(self)
local description = __TS__FunctionCall(getDescription, self)
local caller = debug.getinfo(3, "f")
if _VERSION == "Lua 5.1" or (caller and caller.func ~= error) then
return description
else
return tostring(description) .. "\n" .. tostring(self.stack)
end
end
end
function __TS__InitErrorClass(self, Type, name)
Type.name = name
return setmetatable(
Type,
{
__call = function(____, _self, message) return Type.new(message) end
}
)
end
Error = __TS__InitErrorClass(
_G,
(function()
local ____ = {}
____.name = "____"
____.__index = ____
____.prototype = {}
____.prototype.__index = ____.prototype
____.prototype.constructor = ____
function ____.new(...)
local self = setmetatable({}, ____.prototype)
self:____constructor(...)
return self
end
function ____.prototype.____constructor(self, message)
if message == nil then
message = ""
end
self.message = message
self.name = "Error"
self.stack = __TS__GetErrorStack(_G, self.constructor.new)
local metatable = getmetatable(self)
if not metatable.__errorToStringPatched then
metatable.__errorToStringPatched = true
metatable.__tostring = __TS__WrapErrorToString(_G, metatable.__tostring)
end
end
function ____.prototype.__tostring(self)
return ((self.message ~= "") and function() return tostring(self.name) .. ": " .. tostring(self.message) end or function() return self.name end)()
end
return ____
end)(),
"Error"
)
for ____, errorName in ipairs({"RangeError", "ReferenceError", "SyntaxError", "TypeError", "URIError"}) do
_G[errorName] = __TS__InitErrorClass(
_G,
(function()
local ____ = {}
____.name = "____"
____.__index = ____
____.prototype = {}
____.prototype.__index = ____.prototype
____.prototype.constructor = ____
____.____super = Error
setmetatable(____, ____.____super)
setmetatable(____.prototype, ____.____super.prototype)
function ____.new(...)
local self = setmetatable({}, ____.prototype)
self:____constructor(...)
return self
end
function ____.prototype.____constructor(self, ...)
Error.prototype.____constructor(self, ...)
self.name = errorName
end
return ____
end)(),
errorName
)
end
function __TS__FunctionApply(fn, thisArg, args)
if args then
return fn(
thisArg,
(unpack or table.unpack)(args)
)
else
return fn(thisArg)
end
end
function __TS__FunctionBind(fn, thisArg, ...)
local boundArgs = ({...})
return function(____, ...)
local args = ({...})
do
local i = 0
while i < #boundArgs do
table.insert(args, i + 1, boundArgs[i + 1])
i = i + 1
end
end
return fn(
thisArg,
(unpack or table.unpack)(args)
)
end
end
function __TS__Index(classProto)
return function(tbl, key)
local proto = classProto
while true do
local val = rawget(proto, key)
if val ~= nil then
return val
end
local getters = rawget(proto, "____getters")
if getters then
local getter
getter = getters[key]
if getter then
return getter(tbl)
end
end
local base = rawget(
rawget(proto, "constructor"),
"____super"
)
if not base then
break
end
proto = rawget(base, "prototype")
end
end
end
local ____symbolMetatable = {
__tostring = function(self)
if self.description == nil then
return "Symbol()"
else
return "Symbol(" .. tostring(self.description) .. ")"
end
end
}
function __TS__Symbol(description)
return setmetatable({description = description}, ____symbolMetatable)
end
Symbol = {
iterator = __TS__Symbol("Symbol.iterator"),
hasInstance = __TS__Symbol("Symbol.hasInstance"),
species = __TS__Symbol("Symbol.species"),
toStringTag = __TS__Symbol("Symbol.toStringTag")
}
function __TS__InstanceOf(obj, classTbl)
if type(classTbl) ~= "table" then
error("Right-hand side of \'instanceof\' is not an object", 0)
end
if classTbl[Symbol.hasInstance] ~= nil then
return not not classTbl[Symbol.hasInstance](classTbl, obj)
end
if obj ~= nil then
local luaClass = obj.constructor
while luaClass ~= nil do
if luaClass == classTbl then
return true
end
luaClass = luaClass.____super
end
end
return false
end
function __TS__InstanceOfObject(value)
local valueType = type(value)
return valueType == "table" or valueType == "function"
end
function __TS__Iterator(iterable)
if iterable[Symbol.iterator] then
local iterator = iterable[Symbol.iterator](iterable)
return function()
local result = iterator:next()
if not result.done then
return result.value
else
return nil
end
end
else
local i = 0
return function()
i = i + 1
return iterable[i]
end
end
end
Map = (function()
local Map = {}
Map.name = "Map"
Map.__index = Map
Map.prototype = {}
Map.prototype.__index = Map.prototype
Map.prototype.constructor = Map
function Map.new(...)
local self = setmetatable({}, Map.prototype)
self:____constructor(...)
return self
end
function Map.prototype.____constructor(self, entries)
self[Symbol.toStringTag] = "Map"
self.items = {}
self.size = 0
self.nextKey = {}
self.previousKey = {}
if entries == nil then
return
end
local iterable = entries
if iterable[Symbol.iterator] then
local iterator = iterable[Symbol.iterator](iterable)
while true do
local result = iterator:next()
if result.done then
break
end
local value = result.value
self:set(value[1], value[2])
end
else
local array = entries
for ____, kvp in ipairs(array) do
self:set(kvp[1], kvp[2])
end
end
end
function Map.prototype.clear(self)
self.items = {}
self.nextKey = {}
self.previousKey = {}
self.firstKey = nil
self.lastKey = nil
self.size = 0
return
end
function Map.prototype.delete(self, key)
local contains = self:has(key)
if contains then
self.size = self.size - 1
local next = self.nextKey[key]
local previous = self.previousKey[key]
if next and previous then
self.nextKey[previous] = next
self.previousKey[next] = previous
elseif next then
self.firstKey = next
self.previousKey[next] = nil
elseif previous then
self.lastKey = previous
self.nextKey[previous] = nil
else
self.firstKey = nil
self.lastKey = nil
end
self.nextKey[key] = nil
self.previousKey[key] = nil
end
self.items[key] = nil
return contains
end
function Map.prototype.forEach(self, callback)
for key in __TS__Iterator(
self:keys()
) do
callback(_G, self.items[key], key, self)
end
return
end
function Map.prototype.get(self, key)
return self.items[key]
end
function Map.prototype.has(self, key)
return self.nextKey[key] ~= nil or self.lastKey == key
end
function Map.prototype.set(self, key, value)
local isNewValue = not self:has(key)
if isNewValue then
self.size = self.size + 1
end
self.items[key] = value
if self.firstKey == nil then
self.firstKey = key
self.lastKey = key
elseif isNewValue then
self.nextKey[self.lastKey] = key
self.previousKey[key] = self.lastKey
self.lastKey = key
end
return self
end
Map.prototype[Symbol.iterator] = function(self)
return self:entries()
end
function Map.prototype.entries(self)
local items = self.items
local nextKey = self.nextKey
local key = self.firstKey
return {
[Symbol.iterator] = function(self)
return self
end,
next = function(self)
local result = {done = not key, value = {key, items[key]}}
key = nextKey[key]
return result
end
}
end
function Map.prototype.keys(self)
local nextKey = self.nextKey
local key = self.firstKey
return {
[Symbol.iterator] = function(self)
return self
end,
next = function(self)
local result = {done = not key, value = key}
key = nextKey[key]
return result
end
}
end
function Map.prototype.values(self)
local items = self.items
local nextKey = self.nextKey
local key = self.firstKey
return {
[Symbol.iterator] = function(self)
return self
end,
next = function(self)
local result = {done = not key, value = items[key]}
key = nextKey[key]
return result
end
}
end
Map[Symbol.species] = Map
return Map
end)()
function __TS__NewIndex(classProto)
return function(tbl, key, val)
local proto = classProto
while true do
local setters = rawget(proto, "____setters")
if setters then
local setter
setter = setters[key]
if setter then
setter(tbl, val)
return
end
end
local base = rawget(
rawget(proto, "constructor"),
"____super"
)
if not base then
break
end
proto = rawget(base, "prototype")
end
rawset(tbl, key, val)
end
end
function __TS__Number(value)
local valueType = type(value)
if valueType == "number" then
return value
elseif valueType == "string" then
local numberValue = tonumber(value)
if numberValue then
return numberValue
end
if value == "Infinity" then
return math.huge
end
if value == "-Infinity" then
return -math.huge
end
local stringWithoutSpaces = string.gsub(value, "%s", "")
if stringWithoutSpaces == "" then
return 0
end
return (0 / 0)
elseif valueType == "boolean" then
return value and 1 or 0
else
return (0 / 0)
end
end
function __TS__NumberIsFinite(value)
return type(value) == "number" and value == value and value ~= math.huge and value ~= -math.huge
end
function __TS__NumberIsNaN(value)
return value ~= value
end
local ____radixChars = "0123456789abcdefghijklmnopqrstuvwxyz"
function __TS__NumberToString(self, radix)
if radix == nil or radix == 10 or self == math.huge or self == -math.huge or self ~= self then
return tostring(self)
end
radix = math.floor(radix)
if radix < 2 or radix > 36 then
error("toString() radix argument must be between 2 and 36", 0)
end
local integer, fraction = math.modf(
math.abs(self)
)
local result = ""
if radix == 8 then
result = string.format("%o", integer)
elseif radix == 16 then
result = string.format("%x", integer)
else
repeat
do
result = tostring(
string.sub(____radixChars, (integer % radix) + 1, (integer % radix) + 1)
) .. tostring(result)
integer = math.floor(integer / radix)
end
until not (integer ~= 0)
end
if fraction ~= 0 then
result = tostring(result) .. "."
local delta = 1e-16
repeat
do
fraction = fraction * radix
delta = delta * radix
local digit = math.floor(fraction)
result = tostring(result) .. tostring(
string.sub(____radixChars, digit + 1, digit + 1)
)
fraction = fraction - digit
end
until not (fraction >= delta)
end
if self < 0 then
result = "-" .. tostring(result)
end
return result
end
function __TS__ObjectAssign(to, ...)
local sources = ({...})
if to == nil then
return to
end
for ____, source in ipairs(sources) do
for key in pairs(source) do
to[key] = source[key]
end
end
return to
end
function __TS__ObjectEntries(obj)
local result = {}
for key in pairs(obj) do
result[#result + 1] = {key, obj[key]}
end
return result
end
function __TS__ObjectFromEntries(entries)
local obj = {}
local iterable = entries
if iterable[Symbol.iterator] then
local iterator = iterable[Symbol.iterator](iterable)
while true do
local result = iterator:next()
if result.done then
break
end
local value = result.value
obj[value[1]] = value[2]
end
else
for ____, entry in ipairs(entries) do
obj[entry[1]] = entry[2]
end
end
return obj
end
function __TS__ObjectKeys(obj)
local result = {}