typescript-to-lua 1.10.0-beta.0 → 1.10.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.
Files changed (112) hide show
  1. package/dist/lualib/5.0/Generator.lua +1 -1
  2. package/dist/lualib/5.0/SparseArraySpread.lua +1 -1
  3. package/dist/lualib/5.0/Unpack.lua +18 -1
  4. package/dist/lualib/5.0/lualib_bundle.lua +32 -15
  5. package/dist/lualib/5.0/lualib_module_info.json +3 -1
  6. package/dist/transformation/utils/diagnostics.js +1 -1
  7. package/dist/transformation/visitors/conditional.js +4 -0
  8. package/dist/transpilation/resolve.js +3 -3
  9. package/package.json +2 -2
  10. package/dist/lualib/ArrayConcat.lua +0 -22
  11. package/dist/lualib/ArrayEntries.lua +0 -13
  12. package/dist/lualib/ArrayEvery.lua +0 -8
  13. package/dist/lualib/ArrayFilter.lua +0 -11
  14. package/dist/lualib/ArrayFind.lua +0 -9
  15. package/dist/lualib/ArrayFindIndex.lua +0 -8
  16. package/dist/lualib/ArrayFlat.lua +0 -27
  17. package/dist/lualib/ArrayFlatMap.lua +0 -17
  18. package/dist/lualib/ArrayForEach.lua +0 -5
  19. package/dist/lualib/ArrayFrom.lua +0 -29
  20. package/dist/lualib/ArrayIncludes.lua +0 -19
  21. package/dist/lualib/ArrayIndexOf.lua +0 -24
  22. package/dist/lualib/ArrayIsArray.lua +0 -3
  23. package/dist/lualib/ArrayJoin.lua +0 -10
  24. package/dist/lualib/ArrayMap.lua +0 -7
  25. package/dist/lualib/ArrayPush.lua +0 -9
  26. package/dist/lualib/ArrayPushArray.lua +0 -8
  27. package/dist/lualib/ArrayReduce.lua +0 -23
  28. package/dist/lualib/ArrayReduceRight.lua +0 -23
  29. package/dist/lualib/ArrayReverse.lua +0 -12
  30. package/dist/lualib/ArraySetLength.lua +0 -12
  31. package/dist/lualib/ArraySlice.lua +0 -43
  32. package/dist/lualib/ArraySome.lua +0 -8
  33. package/dist/lualib/ArraySort.lua +0 -11
  34. package/dist/lualib/ArraySplice.lua +0 -77
  35. package/dist/lualib/ArrayToObject.lua +0 -7
  36. package/dist/lualib/ArrayUnshift.lua +0 -14
  37. package/dist/lualib/Await.lua +0 -54
  38. package/dist/lualib/Class.lua +0 -6
  39. package/dist/lualib/ClassExtends.lua +0 -24
  40. package/dist/lualib/CloneDescriptor.lua +0 -28
  41. package/dist/lualib/Decorate.lua +0 -36
  42. package/dist/lualib/DecorateParam.lua +0 -3
  43. package/dist/lualib/DelegatedYield.lua +0 -34
  44. package/dist/lualib/Delete.lua +0 -19
  45. package/dist/lualib/Error.lua +0 -77
  46. package/dist/lualib/FunctionBind.lua +0 -11
  47. package/dist/lualib/Generator.lua +0 -38
  48. package/dist/lualib/InstanceOf.lua +0 -18
  49. package/dist/lualib/InstanceOfObject.lua +0 -4
  50. package/dist/lualib/Iterator.lua +0 -40
  51. package/dist/lualib/LuaIteratorSpread.lua +0 -9
  52. package/dist/lualib/Map.lua +0 -140
  53. package/dist/lualib/MathAtan2.lua +0 -1
  54. package/dist/lualib/MathSign.lua +0 -8
  55. package/dist/lualib/New.lua +0 -5
  56. package/dist/lualib/Number.lua +0 -26
  57. package/dist/lualib/NumberIsFinite.lua +0 -3
  58. package/dist/lualib/NumberIsNaN.lua +0 -3
  59. package/dist/lualib/NumberToString.lua +0 -44
  60. package/dist/lualib/ObjectAssign.lua +0 -10
  61. package/dist/lualib/ObjectDefineProperty.lua +0 -59
  62. package/dist/lualib/ObjectEntries.lua +0 -9
  63. package/dist/lualib/ObjectFromEntries.lua +0 -20
  64. package/dist/lualib/ObjectGetOwnPropertyDescriptor.lua +0 -10
  65. package/dist/lualib/ObjectGetOwnPropertyDescriptors.lua +0 -7
  66. package/dist/lualib/ObjectKeys.lua +0 -9
  67. package/dist/lualib/ObjectRest.lua +0 -9
  68. package/dist/lualib/ObjectValues.lua +0 -9
  69. package/dist/lualib/ParseFloat.lua +0 -18
  70. package/dist/lualib/ParseInt.lua +0 -43
  71. package/dist/lualib/Promise.lua +0 -176
  72. package/dist/lualib/PromiseAll.lua +0 -44
  73. package/dist/lualib/PromiseAllSettled.lua +0 -48
  74. package/dist/lualib/PromiseAny.lua +0 -41
  75. package/dist/lualib/PromiseRace.lua +0 -28
  76. package/dist/lualib/Set.lua +0 -130
  77. package/dist/lualib/SetDescriptor.lua +0 -79
  78. package/dist/lualib/SourceMapTraceBack.lua +0 -54
  79. package/dist/lualib/SparseArrayNew.lua +0 -5
  80. package/dist/lualib/SparseArrayPush.lua +0 -9
  81. package/dist/lualib/SparseArraySpread.lua +0 -8
  82. package/dist/lualib/Spread.lua +0 -15
  83. package/dist/lualib/StringAccess.lua +0 -5
  84. package/dist/lualib/StringCharAt.lua +0 -9
  85. package/dist/lualib/StringCharCodeAt.lua +0 -13
  86. package/dist/lualib/StringEndsWith.lua +0 -6
  87. package/dist/lualib/StringIncludes.lua +0 -9
  88. package/dist/lualib/StringPadEnd.lua +0 -26
  89. package/dist/lualib/StringPadStart.lua +0 -26
  90. package/dist/lualib/StringReplace.lua +0 -20
  91. package/dist/lualib/StringReplaceAll.lua +0 -42
  92. package/dist/lualib/StringSlice.lua +0 -15
  93. package/dist/lualib/StringSplit.lua +0 -36
  94. package/dist/lualib/StringStartsWith.lua +0 -6
  95. package/dist/lualib/StringSubstr.lua +0 -15
  96. package/dist/lualib/StringSubstring.lua +0 -17
  97. package/dist/lualib/StringTrim.lua +0 -4
  98. package/dist/lualib/StringTrimEnd.lua +0 -4
  99. package/dist/lualib/StringTrimStart.lua +0 -4
  100. package/dist/lualib/Symbol.lua +0 -15
  101. package/dist/lualib/SymbolRegistry.lua +0 -17
  102. package/dist/lualib/TypeOf.lua +0 -10
  103. package/dist/lualib/Unpack.lua +0 -1
  104. package/dist/lualib/WeakMap.lua +0 -45
  105. package/dist/lualib/WeakSet.lua +0 -41
  106. package/dist/lualib/lualib_bundle.lua +0 -2518
  107. package/dist/lualib/lualib_module_info.json +0 -626
  108. package/dist/lualib/universal/universal/CountVarargs.lua +0 -3
  109. package/dist/lualib/universal/universal/Match.lua +0 -1
  110. package/dist/lualib/universal/universal/MathModf.lua +0 -1
  111. package/dist/lualib/universal/universal/SparseArraySpread.lua +0 -8
  112. package/dist/lualib/universal/universal/Unpack.lua +0 -1
@@ -1,130 +0,0 @@
1
- local Set
2
- do
3
- Set = __TS__Class()
4
- Set.name = "Set"
5
- function Set.prototype.____constructor(self, values)
6
- self[Symbol.toStringTag] = "Set"
7
- self.size = 0
8
- self.nextKey = {}
9
- self.previousKey = {}
10
- if values == nil then
11
- return
12
- end
13
- local iterable = values
14
- if iterable[Symbol.iterator] then
15
- local iterator = iterable[Symbol.iterator](iterable)
16
- while true do
17
- local result = iterator:next()
18
- if result.done then
19
- break
20
- end
21
- self:add(result.value)
22
- end
23
- else
24
- local array = values
25
- for ____, value in ipairs(array) do
26
- self:add(value)
27
- end
28
- end
29
- end
30
- function Set.prototype.add(self, value)
31
- local isNewValue = not self:has(value)
32
- if isNewValue then
33
- self.size = self.size + 1
34
- end
35
- if self.firstKey == nil then
36
- self.firstKey = value
37
- self.lastKey = value
38
- elseif isNewValue then
39
- self.nextKey[self.lastKey] = value
40
- self.previousKey[value] = self.lastKey
41
- self.lastKey = value
42
- end
43
- return self
44
- end
45
- function Set.prototype.clear(self)
46
- self.nextKey = {}
47
- self.previousKey = {}
48
- self.firstKey = nil
49
- self.lastKey = nil
50
- self.size = 0
51
- end
52
- function Set.prototype.delete(self, value)
53
- local contains = self:has(value)
54
- if contains then
55
- self.size = self.size - 1
56
- local next = self.nextKey[value]
57
- local previous = self.previousKey[value]
58
- if next and previous then
59
- self.nextKey[previous] = next
60
- self.previousKey[next] = previous
61
- elseif next then
62
- self.firstKey = next
63
- self.previousKey[next] = nil
64
- elseif previous then
65
- self.lastKey = previous
66
- self.nextKey[previous] = nil
67
- else
68
- self.firstKey = nil
69
- self.lastKey = nil
70
- end
71
- self.nextKey[value] = nil
72
- self.previousKey[value] = nil
73
- end
74
- return contains
75
- end
76
- function Set.prototype.forEach(self, callback)
77
- for ____, key in __TS__Iterator(self:keys()) do
78
- callback(nil, key, key, self)
79
- end
80
- end
81
- function Set.prototype.has(self, value)
82
- return self.nextKey[value] ~= nil or self.lastKey == value
83
- end
84
- Set.prototype[Symbol.iterator] = function(self)
85
- return self:values()
86
- end
87
- function Set.prototype.entries(self)
88
- local nextKey = self.nextKey
89
- local key = self.firstKey
90
- return {
91
- [Symbol.iterator] = function(self)
92
- return self
93
- end,
94
- next = function(self)
95
- local result = {done = not key, value = {key, key}}
96
- key = nextKey[key]
97
- return result
98
- end
99
- }
100
- end
101
- function Set.prototype.keys(self)
102
- local nextKey = self.nextKey
103
- local key = self.firstKey
104
- return {
105
- [Symbol.iterator] = function(self)
106
- return self
107
- end,
108
- next = function(self)
109
- local result = {done = not key, value = key}
110
- key = nextKey[key]
111
- return result
112
- end
113
- }
114
- end
115
- function Set.prototype.values(self)
116
- local nextKey = self.nextKey
117
- local key = self.firstKey
118
- return {
119
- [Symbol.iterator] = function(self)
120
- return self
121
- end,
122
- next = function(self)
123
- local result = {done = not key, value = key}
124
- key = nextKey[key]
125
- return result
126
- end
127
- }
128
- end
129
- Set[Symbol.species] = Set
130
- end
@@ -1,79 +0,0 @@
1
- local __TS__SetDescriptor
2
- do
3
- local function descriptorIndex(self, key)
4
- local value = rawget(self, key)
5
- if value ~= nil then
6
- return value
7
- end
8
- local metatable = getmetatable(self)
9
- while metatable do
10
- local rawResult = rawget(metatable, key)
11
- if rawResult ~= nil then
12
- return rawResult
13
- end
14
- local descriptors = rawget(metatable, "_descriptors")
15
- if descriptors then
16
- local descriptor = descriptors[key]
17
- if descriptor then
18
- if descriptor.get then
19
- return descriptor.get(self)
20
- end
21
- return descriptor.value
22
- end
23
- end
24
- metatable = getmetatable(metatable)
25
- end
26
- end
27
- local function descriptorNewIndex(self, key, value)
28
- local metatable = getmetatable(self)
29
- while metatable do
30
- local descriptors = rawget(metatable, "_descriptors")
31
- if descriptors then
32
- local descriptor = descriptors[key]
33
- if descriptor then
34
- if descriptor.set then
35
- descriptor.set(self, value)
36
- else
37
- if descriptor.writable == false then
38
- error(
39
- ((("Cannot assign to read only property '" .. key) .. "' of object '") .. tostring(self)) .. "'",
40
- 0
41
- )
42
- end
43
- descriptor.value = value
44
- end
45
- return
46
- end
47
- end
48
- metatable = getmetatable(metatable)
49
- end
50
- rawset(self, key, value)
51
- end
52
- function __TS__SetDescriptor(target, key, desc, isPrototype)
53
- if isPrototype == nil then
54
- isPrototype = false
55
- end
56
- local ____isPrototype_0
57
- if isPrototype then
58
- ____isPrototype_0 = target
59
- else
60
- ____isPrototype_0 = getmetatable(target)
61
- end
62
- local metatable = ____isPrototype_0
63
- if not metatable then
64
- metatable = {}
65
- setmetatable(target, metatable)
66
- end
67
- local value = rawget(target, key)
68
- if value ~= nil then
69
- rawset(target, key, nil)
70
- end
71
- if not rawget(metatable, "_descriptors") then
72
- metatable._descriptors = {}
73
- end
74
- local descriptor = __TS__CloneDescriptor(desc)
75
- metatable._descriptors[key] = descriptor
76
- metatable.__index = descriptorIndex
77
- metatable.__newindex = descriptorNewIndex
78
- end
79
- end
@@ -1,54 +0,0 @@
1
- local function __TS__SourceMapTraceBack(fileName, sourceMap)
2
- _G.__TS__sourcemap = _G.__TS__sourcemap or ({})
3
- _G.__TS__sourcemap[fileName] = sourceMap
4
- if _G.__TS__originalTraceback == nil then
5
- local originalTraceback = debug.traceback
6
- _G.__TS__originalTraceback = originalTraceback
7
- debug.traceback = function(thread, message, level)
8
- local trace
9
- if thread == nil and message == nil and level == nil then
10
- trace = originalTraceback()
11
- else
12
- trace = originalTraceback(thread, message, level)
13
- end
14
- if type(trace) ~= "string" then
15
- return trace
16
- end
17
- local function replacer(____, file, srcFile, line)
18
- local fileSourceMap = _G.__TS__sourcemap[file]
19
- if fileSourceMap and fileSourceMap[line] then
20
- local data = fileSourceMap[line]
21
- if type(data) == "number" then
22
- return (srcFile .. ":") .. tostring(data)
23
- end
24
- return (tostring(data.file) .. ":") .. tostring(data.line)
25
- end
26
- return (file .. ":") .. line
27
- end
28
- local result = string.gsub(
29
- trace,
30
- "(%S+)%.lua:(%d+)",
31
- function(file, line) return replacer(nil, file .. ".lua", file .. ".ts", line) end
32
- )
33
- local function stringReplacer(____, file, line)
34
- local fileSourceMap = _G.__TS__sourcemap[file]
35
- if fileSourceMap and fileSourceMap[line] then
36
- local chunkName = string.match(file, "%[string \"([^\"]+)\"%]")
37
- local sourceName = string.gsub(chunkName, ".lua$", ".ts")
38
- local data = fileSourceMap[line]
39
- if type(data) == "number" then
40
- return (sourceName .. ":") .. tostring(data)
41
- end
42
- return (tostring(data.file) .. ":") .. tostring(data.line)
43
- end
44
- return (file .. ":") .. line
45
- end
46
- result = string.gsub(
47
- result,
48
- "(%[string \"[^\"]+\"%]):(%d+)",
49
- function(file, line) return stringReplacer(nil, file, line) end
50
- )
51
- return result
52
- end
53
- end
54
- end
@@ -1,5 +0,0 @@
1
- local function __TS__SparseArrayNew(...)
2
- local sparseArray = {...}
3
- sparseArray.sparseLength = select("#", ...)
4
- return sparseArray
5
- end
@@ -1,9 +0,0 @@
1
- local function __TS__SparseArrayPush(sparseArray, ...)
2
- local args = {...}
3
- local argsLen = select("#", ...)
4
- local listLen = sparseArray.sparseLength
5
- for i = 1, argsLen do
6
- sparseArray[listLen + i] = args[i]
7
- end
8
- sparseArray.sparseLength = listLen + argsLen
9
- end
@@ -1,8 +0,0 @@
1
- local function __TS__SparseArraySpread(sparseArray)
2
- local ____unpack_0 = unpack
3
- if ____unpack_0 == nil then
4
- ____unpack_0 = table.unpack
5
- end
6
- local _unpack = ____unpack_0
7
- return _unpack(sparseArray, 1, sparseArray.sparseLength)
8
- end
@@ -1,15 +0,0 @@
1
- local function __TS__Spread(iterable)
2
- local arr = {}
3
- if type(iterable) == "string" then
4
- for i = 0, #iterable - 1 do
5
- arr[i + 1] = __TS__StringAccess(iterable, i)
6
- end
7
- else
8
- local len = 0
9
- for ____, item in __TS__Iterator(iterable) do
10
- len = len + 1
11
- arr[len] = item
12
- end
13
- end
14
- return __TS__Unpack(arr)
15
- end
@@ -1,5 +0,0 @@
1
- local function __TS__StringAccess(self, index)
2
- if index >= 0 and index < #self then
3
- return string.sub(self, index + 1, index + 1)
4
- end
5
- end
@@ -1,9 +0,0 @@
1
- local function __TS__StringCharAt(self, pos)
2
- if pos ~= pos then
3
- pos = 0
4
- end
5
- if pos < 0 then
6
- return ""
7
- end
8
- return string.sub(self, pos + 1, pos + 1)
9
- end
@@ -1,13 +0,0 @@
1
- local function __TS__StringCharCodeAt(self, index)
2
- if index ~= index then
3
- index = 0
4
- end
5
- if index < 0 then
6
- return 0 / 0
7
- end
8
- local ____string_byte_result_0 = string.byte(self, index + 1)
9
- if ____string_byte_result_0 == nil then
10
- ____string_byte_result_0 = 0 / 0
11
- end
12
- return ____string_byte_result_0
13
- end
@@ -1,6 +0,0 @@
1
- local function __TS__StringEndsWith(self, searchString, endPosition)
2
- if endPosition == nil or endPosition > #self then
3
- endPosition = #self
4
- end
5
- return string.sub(self, endPosition - #searchString + 1, endPosition) == searchString
6
- end
@@ -1,9 +0,0 @@
1
- local function __TS__StringIncludes(self, searchString, position)
2
- if not position then
3
- position = 1
4
- else
5
- position = position + 1
6
- end
7
- local index = string.find(self, searchString, position, true)
8
- return index ~= nil
9
- end
@@ -1,26 +0,0 @@
1
- local function __TS__StringPadEnd(self, maxLength, fillString)
2
- if fillString == nil then
3
- fillString = " "
4
- end
5
- if maxLength ~= maxLength then
6
- maxLength = 0
7
- end
8
- if maxLength == -math.huge or maxLength == math.huge then
9
- error("Invalid string length", 0)
10
- end
11
- if #self >= maxLength or #fillString == 0 then
12
- return self
13
- end
14
- maxLength = maxLength - #self
15
- if maxLength > #fillString then
16
- fillString = fillString .. string.rep(
17
- fillString,
18
- math.floor(maxLength / #fillString)
19
- )
20
- end
21
- return self .. string.sub(
22
- fillString,
23
- 1,
24
- math.floor(maxLength)
25
- )
26
- end
@@ -1,26 +0,0 @@
1
- local function __TS__StringPadStart(self, maxLength, fillString)
2
- if fillString == nil then
3
- fillString = " "
4
- end
5
- if maxLength ~= maxLength then
6
- maxLength = 0
7
- end
8
- if maxLength == -math.huge or maxLength == math.huge then
9
- error("Invalid string length", 0)
10
- end
11
- if #self >= maxLength or #fillString == 0 then
12
- return self
13
- end
14
- maxLength = maxLength - #self
15
- if maxLength > #fillString then
16
- fillString = fillString .. string.rep(
17
- fillString,
18
- math.floor(maxLength / #fillString)
19
- )
20
- end
21
- return string.sub(
22
- fillString,
23
- 1,
24
- math.floor(maxLength)
25
- ) .. self
26
- end
@@ -1,20 +0,0 @@
1
- local __TS__StringReplace
2
- do
3
- local sub = string.sub
4
- function __TS__StringReplace(source, searchValue, replaceValue)
5
- local startPos, endPos = string.find(source, searchValue, nil, true)
6
- if not startPos then
7
- return source
8
- end
9
- local before = sub(source, 1, startPos - 1)
10
- local ____temp_0
11
- if type(replaceValue) == "string" then
12
- ____temp_0 = replaceValue
13
- else
14
- ____temp_0 = replaceValue(nil, searchValue, startPos - 1, source)
15
- end
16
- local replacement = ____temp_0
17
- local after = sub(source, endPos + 1)
18
- return (before .. replacement) .. after
19
- end
20
- end
@@ -1,42 +0,0 @@
1
- local __TS__StringReplaceAll
2
- do
3
- local sub = string.sub
4
- local find = string.find
5
- function __TS__StringReplaceAll(source, searchValue, replaceValue)
6
- if type(replaceValue) == "string" then
7
- local concat = table.concat(
8
- __TS__StringSplit(source, searchValue),
9
- replaceValue
10
- )
11
- if #searchValue == 0 then
12
- return (replaceValue .. concat) .. replaceValue
13
- end
14
- return concat
15
- end
16
- local parts = {}
17
- local partsIndex = 1
18
- if #searchValue == 0 then
19
- parts[1] = replaceValue(nil, "", 0, source)
20
- partsIndex = 2
21
- for i = 1, #source do
22
- parts[partsIndex] = sub(source, i, i)
23
- parts[partsIndex + 1] = replaceValue(nil, "", i, source)
24
- partsIndex = partsIndex + 2
25
- end
26
- else
27
- local currentPos = 1
28
- while true do
29
- local startPos, endPos = find(source, searchValue, currentPos, true)
30
- if not startPos then
31
- break
32
- end
33
- parts[partsIndex] = sub(source, currentPos, startPos - 1)
34
- parts[partsIndex + 1] = replaceValue(nil, searchValue, startPos - 1, source)
35
- partsIndex = partsIndex + 2
36
- currentPos = endPos + 1
37
- end
38
- parts[partsIndex] = sub(source, currentPos)
39
- end
40
- return table.concat(parts)
41
- end
42
- end
@@ -1,15 +0,0 @@
1
- local function __TS__StringSlice(self, start, ____end)
2
- if start == nil or start ~= start then
3
- start = 0
4
- end
5
- if ____end ~= ____end then
6
- ____end = 0
7
- end
8
- if start >= 0 then
9
- start = start + 1
10
- end
11
- if ____end ~= nil and ____end < 0 then
12
- ____end = ____end - 1
13
- end
14
- return string.sub(self, start, ____end)
15
- end
@@ -1,36 +0,0 @@
1
- local __TS__StringSplit
2
- do
3
- local sub = string.sub
4
- local find = string.find
5
- function __TS__StringSplit(source, separator, limit)
6
- if limit == nil then
7
- limit = 4294967295
8
- end
9
- if limit == 0 then
10
- return {}
11
- end
12
- local result = {}
13
- local resultIndex = 1
14
- if separator == nil or separator == "" then
15
- for i = 1, #source do
16
- result[resultIndex] = sub(source, i, i)
17
- resultIndex = resultIndex + 1
18
- end
19
- else
20
- local currentPos = 1
21
- while resultIndex <= limit do
22
- local startPos, endPos = find(source, separator, currentPos, true)
23
- if not startPos then
24
- break
25
- end
26
- result[resultIndex] = sub(source, currentPos, startPos - 1)
27
- resultIndex = resultIndex + 1
28
- currentPos = endPos + 1
29
- end
30
- if resultIndex <= limit then
31
- result[resultIndex] = sub(source, currentPos)
32
- end
33
- end
34
- return result
35
- end
36
- end
@@ -1,6 +0,0 @@
1
- local function __TS__StringStartsWith(self, searchString, position)
2
- if position == nil or position < 0 then
3
- position = 0
4
- end
5
- return string.sub(self, position + 1, #searchString + position) == searchString
6
- end
@@ -1,15 +0,0 @@
1
- local function __TS__StringSubstr(self, from, length)
2
- if from ~= from then
3
- from = 0
4
- end
5
- if length ~= nil then
6
- if length ~= length or length <= 0 then
7
- return ""
8
- end
9
- length = length + from
10
- end
11
- if from >= 0 then
12
- from = from + 1
13
- end
14
- return string.sub(self, from, length)
15
- end
@@ -1,17 +0,0 @@
1
- local function __TS__StringSubstring(self, start, ____end)
2
- if ____end ~= ____end then
3
- ____end = 0
4
- end
5
- if ____end ~= nil and start > ____end then
6
- start, ____end = ____end, start
7
- end
8
- if start >= 0 then
9
- start = start + 1
10
- else
11
- start = 1
12
- end
13
- if ____end ~= nil and ____end < 0 then
14
- ____end = 0
15
- end
16
- return string.sub(self, start, ____end)
17
- end
@@ -1,4 +0,0 @@
1
- local function __TS__StringTrim(self)
2
- local result = string.gsub(self, "^[%s ]*(.-)[%s ]*$", "%1")
3
- return result
4
- end
@@ -1,4 +0,0 @@
1
- local function __TS__StringTrimEnd(self)
2
- local result = string.gsub(self, "[%s ]*$", "")
3
- return result
4
- end
@@ -1,4 +0,0 @@
1
- local function __TS__StringTrimStart(self)
2
- local result = string.gsub(self, "^[%s ]*", "")
3
- return result
4
- end
@@ -1,15 +0,0 @@
1
- local __TS__Symbol, Symbol
2
- do
3
- local symbolMetatable = {__tostring = function(self)
4
- return ("Symbol(" .. (self.description or "")) .. ")"
5
- end}
6
- function __TS__Symbol(description)
7
- return setmetatable({description = description}, symbolMetatable)
8
- end
9
- Symbol = {
10
- iterator = __TS__Symbol("Symbol.iterator"),
11
- hasInstance = __TS__Symbol("Symbol.hasInstance"),
12
- species = __TS__Symbol("Symbol.species"),
13
- toStringTag = __TS__Symbol("Symbol.toStringTag")
14
- }
15
- end
@@ -1,17 +0,0 @@
1
- local __TS__SymbolRegistryFor, __TS__SymbolRegistryKeyFor
2
- do
3
- local symbolRegistry = {}
4
- function __TS__SymbolRegistryFor(key)
5
- if not symbolRegistry[key] then
6
- symbolRegistry[key] = __TS__Symbol(key)
7
- end
8
- return symbolRegistry[key]
9
- end
10
- function __TS__SymbolRegistryKeyFor(sym)
11
- for key in pairs(symbolRegistry) do
12
- if symbolRegistry[key] == sym then
13
- return key
14
- end
15
- end
16
- end
17
- end
@@ -1,10 +0,0 @@
1
- local function __TS__TypeOf(value)
2
- local luaType = type(value)
3
- if luaType == "table" then
4
- return "object"
5
- elseif luaType == "nil" then
6
- return "undefined"
7
- else
8
- return luaType
9
- end
10
- end
@@ -1 +0,0 @@
1
- local __TS__Unpack = table.unpack or unpack