isaacscript-common 21.9.0 → 22.0.0
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/index.rollup.d.ts +20 -20
- package/dist/isaacscript-common.lua +102 -138
- package/dist/lualib_bundle.lua +59 -100
- package/dist/src/functions/color.d.ts +1 -1
- package/dist/src/functions/color.d.ts.map +1 -1
- package/dist/src/functions/hex.d.ts +2 -2
- package/dist/src/functions/hex.d.ts.map +1 -1
- package/dist/src/functions/kColor.d.ts +1 -1
- package/dist/src/functions/kColor.d.ts.map +1 -1
- package/dist/src/functions/log.d.ts +1 -1
- package/dist/src/functions/log.d.ts.map +1 -1
- package/dist/src/functions/log.lua +5 -0
- package/dist/src/functions/positionVelocity.d.ts +1 -1
- package/dist/src/functions/positionVelocity.d.ts.map +1 -1
- package/dist/src/functions/roomGrid.d.ts +5 -5
- package/dist/src/functions/roomGrid.d.ts.map +1 -1
- package/dist/src/functions/ui.d.ts +8 -8
- package/dist/src/functions/ui.d.ts.map +1 -1
- package/dist/src/functions/vector.d.ts +1 -1
- package/dist/src/functions/vector.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/functions/color.ts +1 -1
- package/src/functions/hex.ts +2 -2
- package/src/functions/kColor.ts +1 -1
- package/src/functions/log.ts +7 -1
- package/src/functions/positionVelocity.ts +1 -1
- package/src/functions/roomGrid.ts +14 -5
- package/src/functions/ui.ts +8 -8
- package/src/functions/vector.ts +1 -1
package/dist/index.rollup.d.ts
CHANGED
|
@@ -3876,7 +3876,7 @@ export declare function find<T>(array: T[], func: (value: T, index: number, arra
|
|
|
3876
3876
|
* @param minimumDistance Optional. If specified, will ensure that the randomly generated position
|
|
3877
3877
|
* is equal to or greater than the distance provided.
|
|
3878
3878
|
*/
|
|
3879
|
-
export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Vector
|
|
3879
|
+
export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Readonly<Vector>;
|
|
3880
3880
|
|
|
3881
3881
|
declare type FireArgs<T extends ModCallbackCustom> = Parameters<AddCallbackParametersCustom[T][0]>;
|
|
3882
3882
|
|
|
@@ -5111,7 +5111,7 @@ export declare function getHorsePillColors(): PillColor[];
|
|
|
5111
5111
|
* - If the user does not have a HUD offset configured, this function will return `Vector(0, 0)`.
|
|
5112
5112
|
* - If the user has a HUD offset of 1.0 configured, this function will return `Vector(20, 12)`.
|
|
5113
5113
|
*/
|
|
5114
|
-
export declare function getHUDOffsetVector(): Vector
|
|
5114
|
+
export declare function getHUDOffsetVector(): Readonly<Vector>;
|
|
5115
5115
|
|
|
5116
5116
|
/**
|
|
5117
5117
|
* Helper function to get the name of a class from the Isaac API. This is contained within the
|
|
@@ -5871,7 +5871,7 @@ export declare function getRandomArrayIndex<T>(array: T[] | readonly T[], seedOr
|
|
|
5871
5871
|
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
5872
5872
|
* @param alpha Optional. The alpha value to use. Default is 1.
|
|
5873
5873
|
*/
|
|
5874
|
-
export declare function getRandomColor(seedOrRNG?: Seed | RNG, alpha?: number): Color
|
|
5874
|
+
export declare function getRandomColor(seedOrRNG?: Seed | RNG, alpha?: number): Readonly<Color>;
|
|
5875
5875
|
|
|
5876
5876
|
/**
|
|
5877
5877
|
* Helper function to get a random value from the provided enum.
|
|
@@ -5985,7 +5985,7 @@ export declare function getRandomJSONRoom(jsonRooms: JSONRoom[], seedOrRNG?: See
|
|
|
5985
5985
|
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
5986
5986
|
* @param alpha Optional. The alpha value to use. Default is 1.
|
|
5987
5987
|
*/
|
|
5988
|
-
export declare function getRandomKColor(seedOrRNG?: Seed | RNG, alpha?: number): KColor
|
|
5988
|
+
export declare function getRandomKColor(seedOrRNG?: Seed | RNG, alpha?: number): Readonly<KColor>;
|
|
5989
5989
|
|
|
5990
5990
|
/**
|
|
5991
5991
|
* Helper function to get a random `Seed` value to be used in spawning entities and so on. Use this
|
|
@@ -6014,7 +6014,7 @@ export declare function getRandomSetElement<T>(set: Set<T> | ReadonlySet<T>, see
|
|
|
6014
6014
|
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
6015
6015
|
* `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
6016
6016
|
*/
|
|
6017
|
-
export declare function getRandomVector(seedOrRNG?: Seed | RNG): Vector
|
|
6017
|
+
export declare function getRandomVector(seedOrRNG?: Seed | RNG): Readonly<Vector>;
|
|
6018
6018
|
|
|
6019
6019
|
/**
|
|
6020
6020
|
* Helper function to get a read-only copy of the room descriptor for every room on the level. This
|
|
@@ -6443,19 +6443,19 @@ export declare function getRoomVisitedCount(roomGridIndex?: int): int;
|
|
|
6443
6443
|
*/
|
|
6444
6444
|
export declare function getSacks(sackSubType?: SackSubType): EntityPickupSack[];
|
|
6445
6445
|
|
|
6446
|
-
export declare function getScreenBottomCenterPos(): Vector
|
|
6446
|
+
export declare function getScreenBottomCenterPos(): Readonly<Vector>;
|
|
6447
6447
|
|
|
6448
|
-
export declare function getScreenBottomLeftPos(): Vector
|
|
6448
|
+
export declare function getScreenBottomLeftPos(): Readonly<Vector>;
|
|
6449
6449
|
|
|
6450
|
-
export declare function getScreenBottomRightPos(): Vector
|
|
6450
|
+
export declare function getScreenBottomRightPos(): Readonly<Vector>;
|
|
6451
6451
|
|
|
6452
|
-
export declare function getScreenCenterPos(): Vector
|
|
6452
|
+
export declare function getScreenCenterPos(): Readonly<Vector>;
|
|
6453
6453
|
|
|
6454
|
-
export declare function getScreenTopCenterPos(): Vector
|
|
6454
|
+
export declare function getScreenTopCenterPos(): Readonly<Vector>;
|
|
6455
6455
|
|
|
6456
|
-
export declare function getScreenTopLeftPos(): Vector
|
|
6456
|
+
export declare function getScreenTopLeftPos(): Readonly<Vector>;
|
|
6457
6457
|
|
|
6458
|
-
export declare function getScreenTopRightPos(): Vector
|
|
6458
|
+
export declare function getScreenTopRightPos(): Readonly<Vector>;
|
|
6459
6459
|
|
|
6460
6460
|
/**
|
|
6461
6461
|
* Helper function to get all possible combinations of the given set. This includes the combination
|
|
@@ -6817,7 +6817,7 @@ export declare const GRID_INDEX_CENTER_OF_1X1_ROOM = 67;
|
|
|
6817
6817
|
*
|
|
6818
6818
|
* For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`.
|
|
6819
6819
|
*/
|
|
6820
|
-
export declare function gridCoordinatesToWorldPosition(x: int, y: int): Vector
|
|
6820
|
+
export declare function gridCoordinatesToWorldPosition(x: int, y: int): Readonly<Vector>;
|
|
6821
6821
|
|
|
6822
6822
|
declare class GridEntityCollisionDetection extends Feature {
|
|
6823
6823
|
v: {
|
|
@@ -6909,14 +6909,14 @@ declare class GridEntityUpdateDetection extends Feature {
|
|
|
6909
6909
|
* For example, in a 1x1 room, grid index 0 is equal to "Vector(-1, -1) and grid index 16 is equal
|
|
6910
6910
|
* to "Vector(0, 0)".
|
|
6911
6911
|
*/
|
|
6912
|
-
export declare function gridIndexToGridPosition(gridIndex: int, roomShape: RoomShape): Vector
|
|
6912
|
+
export declare function gridIndexToGridPosition(gridIndex: int, roomShape: RoomShape): Readonly<Vector>;
|
|
6913
6913
|
|
|
6914
6914
|
/**
|
|
6915
6915
|
* Helper function to convert a grid position `Vector` to a world position `Vector`.
|
|
6916
6916
|
*
|
|
6917
6917
|
* For example, the coordinates of (0, 0) are equal to `Vector(80, 160)`.
|
|
6918
6918
|
*/
|
|
6919
|
-
export declare function gridPositionToWorldPosition(gridPosition: Vector): Vector
|
|
6919
|
+
export declare function gridPositionToWorldPosition(gridPosition: Vector): Readonly<Vector>;
|
|
6920
6920
|
|
|
6921
6921
|
/**
|
|
6922
6922
|
* Helper function to see if a particular entity has armor. In this context, armor refers to the
|
|
@@ -7015,7 +7015,7 @@ export declare enum HealthType {
|
|
|
7015
7015
|
* @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
|
|
7016
7016
|
* @param alpha Optional. Range is from 0 to 1. Default is 1. (The same as the `Color` constructor.)
|
|
7017
7017
|
*/
|
|
7018
|
-
export declare function hexToColor(hexString: string, alpha?: number): Color
|
|
7018
|
+
export declare function hexToColor(hexString: string, alpha?: number): Readonly<Color>;
|
|
7019
7019
|
|
|
7020
7020
|
/**
|
|
7021
7021
|
* Converts a hex string like "#33aa33" to a Color object.
|
|
@@ -7023,7 +7023,7 @@ export declare function hexToColor(hexString: string, alpha?: number): Color;
|
|
|
7023
7023
|
* @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
|
|
7024
7024
|
* @param alpha Range is from 0 to 1. Default is 1.
|
|
7025
7025
|
*/
|
|
7026
|
-
export declare function hexToKColor(hexString: string, alpha?: number): KColor
|
|
7026
|
+
export declare function hexToKColor(hexString: string, alpha?: number): Readonly<KColor>;
|
|
7027
7027
|
|
|
7028
7028
|
/**
|
|
7029
7029
|
* Helper type to make the given array/map/set/object recursively read-only.
|
|
@@ -8617,7 +8617,7 @@ export declare function lockDoor(door: GridEntityDoor): void;
|
|
|
8617
8617
|
* @param includeParentFunction Optional. Whether to prefix the message with the function name and
|
|
8618
8618
|
* line number, as shown in the above example. Default is true.
|
|
8619
8619
|
*/
|
|
8620
|
-
export declare function log(this: void, msg: string, includeParentFunction?: boolean): void;
|
|
8620
|
+
export declare function log(this: void, msg: string | number, includeParentFunction?: boolean): void;
|
|
8621
8621
|
|
|
8622
8622
|
/** Helper function for printing out every entity (or filtered entity) in the current room. */
|
|
8623
8623
|
export declare function logAllEntities(this: void, includeBackgroundEffects: boolean, entityTypeFilter?: EntityType): void;
|
|
@@ -15651,7 +15651,7 @@ export declare function willReviveFromSpiritShackles(player: EntityPlayer): bool
|
|
|
15651
15651
|
*
|
|
15652
15652
|
* In this context, the grid position of the top-left wall is "Vector(-1, -1)".
|
|
15653
15653
|
*/
|
|
15654
|
-
export declare function worldPositionToGridPosition(worldPos: Vector): Vector
|
|
15654
|
+
export declare function worldPositionToGridPosition(worldPos: Vector): Readonly<Vector>;
|
|
15655
15655
|
|
|
15656
15656
|
/**
|
|
15657
15657
|
* Helper function to convert a world position `Vector` to a grid position `Vector`.
|
|
@@ -15660,7 +15660,7 @@ export declare function worldPositionToGridPosition(worldPos: Vector): Vector;
|
|
|
15660
15660
|
*
|
|
15661
15661
|
* This is similar to the `worldPositionToGridPosition` function, but the values are not rounded.
|
|
15662
15662
|
*/
|
|
15663
|
-
export declare function worldPositionToGridPositionFast(worldPos: Vector): Vector
|
|
15663
|
+
export declare function worldPositionToGridPositionFast(worldPos: Vector): Readonly<Vector>;
|
|
15664
15664
|
|
|
15665
15665
|
/**
|
|
15666
15666
|
* Helper function to see if a certain damage amount would deal "permanent" damage to Tainted
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 22.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -813,13 +813,7 @@ local function __TS__AsyncAwaiter(generator)
|
|
|
813
813
|
function(____, resolve, reject)
|
|
814
814
|
local adopt, fulfilled, step, resolved, asyncCoroutine
|
|
815
815
|
function adopt(self, value)
|
|
816
|
-
|
|
817
|
-
if __TS__InstanceOf(value, __TS__Promise) then
|
|
818
|
-
____temp_0 = value
|
|
819
|
-
else
|
|
820
|
-
____temp_0 = __TS__Promise.resolve(value)
|
|
821
|
-
end
|
|
822
|
-
return ____temp_0
|
|
816
|
+
return __TS__InstanceOf(value, __TS__Promise) and value or __TS__Promise.resolve(value)
|
|
823
817
|
end
|
|
824
818
|
function fulfilled(self, value)
|
|
825
819
|
local success, resultOrError = coroutine.resume(asyncCoroutine, value)
|
|
@@ -836,8 +830,8 @@ local function __TS__AsyncAwaiter(generator)
|
|
|
836
830
|
if coroutine.status(asyncCoroutine) == "dead" then
|
|
837
831
|
resolve(nil, result)
|
|
838
832
|
else
|
|
839
|
-
local
|
|
840
|
-
|
|
833
|
+
local ____self_0 = adopt(nil, result)
|
|
834
|
+
____self_0["then"](____self_0, fulfilled, reject)
|
|
841
835
|
end
|
|
842
836
|
end
|
|
843
837
|
resolved = false
|
|
@@ -846,8 +840,8 @@ local function __TS__AsyncAwaiter(generator)
|
|
|
846
840
|
asyncCoroutine,
|
|
847
841
|
function(____, v)
|
|
848
842
|
resolved = true
|
|
849
|
-
local
|
|
850
|
-
|
|
843
|
+
local ____self_1 = adopt(nil, v)
|
|
844
|
+
____self_1["then"](____self_1, resolve, reject)
|
|
851
845
|
end
|
|
852
846
|
)
|
|
853
847
|
if success then
|
|
@@ -954,7 +948,7 @@ do
|
|
|
954
948
|
local descriptors = rawget(metatable, "_descriptors")
|
|
955
949
|
if descriptors then
|
|
956
950
|
local descriptor = descriptors[key]
|
|
957
|
-
if descriptor then
|
|
951
|
+
if descriptor ~= nil then
|
|
958
952
|
if descriptor.get then
|
|
959
953
|
return descriptor.get(self)
|
|
960
954
|
end
|
|
@@ -970,7 +964,7 @@ do
|
|
|
970
964
|
local descriptors = rawget(metatable, "_descriptors")
|
|
971
965
|
if descriptors then
|
|
972
966
|
local descriptor = descriptors[key]
|
|
973
|
-
if descriptor then
|
|
967
|
+
if descriptor ~= nil then
|
|
974
968
|
if descriptor.set then
|
|
975
969
|
descriptor.set(self, value)
|
|
976
970
|
else
|
|
@@ -1023,7 +1017,7 @@ local function __TS__Decorate(decorators, target, key, desc)
|
|
|
1023
1017
|
local i = #decorators
|
|
1024
1018
|
while i >= 0 do
|
|
1025
1019
|
local decorator = decorators[i + 1]
|
|
1026
|
-
if decorator then
|
|
1020
|
+
if decorator ~= nil then
|
|
1027
1021
|
local oldResult = result
|
|
1028
1022
|
if key == nil then
|
|
1029
1023
|
result = decorator(nil, result)
|
|
@@ -1096,7 +1090,7 @@ do
|
|
|
1096
1090
|
if isClassicLua or caller and caller.func ~= error then
|
|
1097
1091
|
return description
|
|
1098
1092
|
else
|
|
1099
|
-
return (
|
|
1093
|
+
return (description .. "\n") .. tostring(self.stack)
|
|
1100
1094
|
end
|
|
1101
1095
|
end
|
|
1102
1096
|
end
|
|
@@ -1107,7 +1101,7 @@ do
|
|
|
1107
1101
|
{__call = function(____, _self, message) return __TS__New(Type, message) end}
|
|
1108
1102
|
)
|
|
1109
1103
|
end
|
|
1110
|
-
local
|
|
1104
|
+
local ____initErrorClass_1 = initErrorClass
|
|
1111
1105
|
local ____class_0 = __TS__Class()
|
|
1112
1106
|
____class_0.name = ""
|
|
1113
1107
|
function ____class_0.prototype.____constructor(self, message)
|
|
@@ -1118,31 +1112,25 @@ do
|
|
|
1118
1112
|
self.name = "Error"
|
|
1119
1113
|
self.stack = getErrorStack(nil, self.constructor.new)
|
|
1120
1114
|
local metatable = getmetatable(self)
|
|
1121
|
-
if not metatable.__errorToStringPatched then
|
|
1115
|
+
if metatable and not metatable.__errorToStringPatched then
|
|
1122
1116
|
metatable.__errorToStringPatched = true
|
|
1123
1117
|
metatable.__tostring = wrapErrorToString(nil, metatable.__tostring)
|
|
1124
1118
|
end
|
|
1125
1119
|
end
|
|
1126
1120
|
function ____class_0.prototype.__tostring(self)
|
|
1127
|
-
|
|
1128
|
-
if self.message ~= "" then
|
|
1129
|
-
____temp_1 = (self.name .. ": ") .. self.message
|
|
1130
|
-
else
|
|
1131
|
-
____temp_1 = self.name
|
|
1132
|
-
end
|
|
1133
|
-
return ____temp_1
|
|
1121
|
+
return self.message ~= "" and (self.name .. ": ") .. self.message or self.name
|
|
1134
1122
|
end
|
|
1135
|
-
Error =
|
|
1123
|
+
Error = ____initErrorClass_1(nil, ____class_0, "Error")
|
|
1136
1124
|
local function createErrorClass(self, name)
|
|
1137
|
-
local
|
|
1138
|
-
local
|
|
1139
|
-
|
|
1140
|
-
__TS__ClassExtends(
|
|
1141
|
-
function
|
|
1142
|
-
|
|
1125
|
+
local ____initErrorClass_3 = initErrorClass
|
|
1126
|
+
local ____class_2 = __TS__Class()
|
|
1127
|
+
____class_2.name = ____class_2.name
|
|
1128
|
+
__TS__ClassExtends(____class_2, Error)
|
|
1129
|
+
function ____class_2.prototype.____constructor(self, ...)
|
|
1130
|
+
____class_2.____super.prototype.____constructor(self, ...)
|
|
1143
1131
|
self.name = name
|
|
1144
1132
|
end
|
|
1145
|
-
return
|
|
1133
|
+
return ____initErrorClass_3(nil, ____class_2, name)
|
|
1146
1134
|
end
|
|
1147
1135
|
RangeError = createErrorClass(nil, "RangeError")
|
|
1148
1136
|
ReferenceError = createErrorClass(nil, "ReferenceError")
|
|
@@ -1312,13 +1300,13 @@ do
|
|
|
1312
1300
|
self.size = self.size - 1
|
|
1313
1301
|
local next = self.nextKey[key]
|
|
1314
1302
|
local previous = self.previousKey[key]
|
|
1315
|
-
if next and previous then
|
|
1303
|
+
if next ~= nil and previous ~= nil then
|
|
1316
1304
|
self.nextKey[previous] = next
|
|
1317
1305
|
self.previousKey[next] = previous
|
|
1318
|
-
elseif next then
|
|
1306
|
+
elseif next ~= nil then
|
|
1319
1307
|
self.firstKey = next
|
|
1320
1308
|
self.previousKey[next] = nil
|
|
1321
|
-
elseif previous then
|
|
1309
|
+
elseif previous ~= nil then
|
|
1322
1310
|
self.lastKey = previous
|
|
1323
1311
|
self.nextKey[previous] = nil
|
|
1324
1312
|
else
|
|
@@ -1504,13 +1492,7 @@ do
|
|
|
1504
1492
|
end
|
|
1505
1493
|
|
|
1506
1494
|
local function __TS__ObjectDefineProperty(target, key, desc)
|
|
1507
|
-
local
|
|
1508
|
-
if type(key) == "number" then
|
|
1509
|
-
____temp_0 = key + 1
|
|
1510
|
-
else
|
|
1511
|
-
____temp_0 = key
|
|
1512
|
-
end
|
|
1513
|
-
local luaKey = ____temp_0
|
|
1495
|
+
local luaKey = type(key) == "number" and key + 1 or key
|
|
1514
1496
|
local value = rawget(target, luaKey)
|
|
1515
1497
|
local hasGetterOrSetter = desc.get ~= nil or desc.set ~= nil
|
|
1516
1498
|
local descriptor
|
|
@@ -1524,39 +1506,39 @@ local function __TS__ObjectDefineProperty(target, key, desc)
|
|
|
1524
1506
|
descriptor = desc
|
|
1525
1507
|
else
|
|
1526
1508
|
local valueExists = value ~= nil
|
|
1527
|
-
local
|
|
1528
|
-
local
|
|
1529
|
-
local
|
|
1509
|
+
local ____desc_set_4 = desc.set
|
|
1510
|
+
local ____desc_get_5 = desc.get
|
|
1511
|
+
local ____temp_0
|
|
1530
1512
|
if desc.configurable ~= nil then
|
|
1531
|
-
|
|
1513
|
+
____temp_0 = desc.configurable
|
|
1532
1514
|
else
|
|
1533
|
-
|
|
1515
|
+
____temp_0 = valueExists
|
|
1534
1516
|
end
|
|
1535
|
-
local
|
|
1517
|
+
local ____temp_1
|
|
1536
1518
|
if desc.enumerable ~= nil then
|
|
1537
|
-
|
|
1519
|
+
____temp_1 = desc.enumerable
|
|
1538
1520
|
else
|
|
1539
|
-
|
|
1521
|
+
____temp_1 = valueExists
|
|
1540
1522
|
end
|
|
1541
|
-
local
|
|
1523
|
+
local ____temp_2
|
|
1542
1524
|
if desc.writable ~= nil then
|
|
1543
|
-
|
|
1525
|
+
____temp_2 = desc.writable
|
|
1544
1526
|
else
|
|
1545
|
-
|
|
1527
|
+
____temp_2 = valueExists
|
|
1546
1528
|
end
|
|
1547
|
-
local
|
|
1529
|
+
local ____temp_3
|
|
1548
1530
|
if desc.value ~= nil then
|
|
1549
|
-
|
|
1531
|
+
____temp_3 = desc.value
|
|
1550
1532
|
else
|
|
1551
|
-
|
|
1533
|
+
____temp_3 = value
|
|
1552
1534
|
end
|
|
1553
1535
|
descriptor = {
|
|
1554
|
-
set =
|
|
1555
|
-
get =
|
|
1556
|
-
configurable =
|
|
1557
|
-
enumerable =
|
|
1558
|
-
writable =
|
|
1559
|
-
value =
|
|
1536
|
+
set = ____desc_set_4,
|
|
1537
|
+
get = ____desc_get_5,
|
|
1538
|
+
configurable = ____temp_0,
|
|
1539
|
+
enumerable = ____temp_1,
|
|
1540
|
+
writable = ____temp_2,
|
|
1541
|
+
value = ____temp_3
|
|
1560
1542
|
}
|
|
1561
1543
|
end
|
|
1562
1544
|
__TS__SetDescriptor(target, luaKey, descriptor)
|
|
@@ -1626,14 +1608,8 @@ end
|
|
|
1626
1608
|
|
|
1627
1609
|
local function __TS__ParseFloat(numberString)
|
|
1628
1610
|
local infinityMatch = __TS__Match(numberString, "^%s*(-?Infinity)")
|
|
1629
|
-
if infinityMatch then
|
|
1630
|
-
|
|
1631
|
-
if __TS__StringAccess(infinityMatch, 0) == "-" then
|
|
1632
|
-
____temp_0 = -math.huge
|
|
1633
|
-
else
|
|
1634
|
-
____temp_0 = math.huge
|
|
1635
|
-
end
|
|
1636
|
-
return ____temp_0
|
|
1611
|
+
if infinityMatch ~= nil then
|
|
1612
|
+
return __TS__StringAccess(infinityMatch, 0) == "-" and -math.huge or math.huge
|
|
1637
1613
|
end
|
|
1638
1614
|
local number = tonumber(__TS__Match(numberString, "^%s*(-?%d+%.?%d*)"))
|
|
1639
1615
|
return number or 0 / 0
|
|
@@ -1664,27 +1640,15 @@ do
|
|
|
1664
1640
|
if base == nil then
|
|
1665
1641
|
base = 10
|
|
1666
1642
|
local hexMatch = __TS__Match(numberString, "^%s*-?0[xX]")
|
|
1667
|
-
if hexMatch then
|
|
1643
|
+
if hexMatch ~= nil then
|
|
1668
1644
|
base = 16
|
|
1669
|
-
|
|
1670
|
-
if __TS__Match(hexMatch, "-") then
|
|
1671
|
-
____TS__Match_result__0_0 = "-" .. __TS__StringSubstring(numberString, #hexMatch)
|
|
1672
|
-
else
|
|
1673
|
-
____TS__Match_result__0_0 = __TS__StringSubstring(numberString, #hexMatch)
|
|
1674
|
-
end
|
|
1675
|
-
numberString = ____TS__Match_result__0_0
|
|
1645
|
+
numberString = __TS__Match(hexMatch, "-") and "-" .. __TS__StringSubstring(numberString, #hexMatch) or __TS__StringSubstring(numberString, #hexMatch)
|
|
1676
1646
|
end
|
|
1677
1647
|
end
|
|
1678
1648
|
if base < 2 or base > 36 then
|
|
1679
1649
|
return 0 / 0
|
|
1680
1650
|
end
|
|
1681
|
-
local
|
|
1682
|
-
if base <= 10 then
|
|
1683
|
-
____temp_1 = __TS__StringSubstring(parseIntBasePattern, 0, base)
|
|
1684
|
-
else
|
|
1685
|
-
____temp_1 = __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
|
|
1686
|
-
end
|
|
1687
|
-
local allowedDigits = ____temp_1
|
|
1651
|
+
local allowedDigits = base <= 10 and __TS__StringSubstring(parseIntBasePattern, 0, base) or __TS__StringSubstring(parseIntBasePattern, 0, 10 + 2 * (base - 10))
|
|
1688
1652
|
local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
|
|
1689
1653
|
local number = tonumber(
|
|
1690
1654
|
__TS__Match(numberString, pattern),
|
|
@@ -1923,13 +1887,13 @@ do
|
|
|
1923
1887
|
self.size = self.size - 1
|
|
1924
1888
|
local next = self.nextKey[value]
|
|
1925
1889
|
local previous = self.previousKey[value]
|
|
1926
|
-
if next and previous then
|
|
1890
|
+
if next ~= nil and previous ~= nil then
|
|
1927
1891
|
self.nextKey[previous] = next
|
|
1928
1892
|
self.previousKey[next] = previous
|
|
1929
|
-
elseif next then
|
|
1893
|
+
elseif next ~= nil then
|
|
1930
1894
|
self.firstKey = next
|
|
1931
1895
|
self.previousKey[next] = nil
|
|
1932
|
-
elseif previous then
|
|
1896
|
+
elseif previous ~= nil then
|
|
1933
1897
|
self.lastKey = previous
|
|
1934
1898
|
self.nextKey[previous] = nil
|
|
1935
1899
|
else
|
|
@@ -2117,7 +2081,7 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2117
2081
|
if thread == nil and message == nil and level == nil then
|
|
2118
2082
|
trace = originalTraceback()
|
|
2119
2083
|
elseif __TS__StringIncludes(_VERSION, "Lua 5.0") then
|
|
2120
|
-
trace = originalTraceback((("[Level " .. tostring(level)) .. "] ") .. message)
|
|
2084
|
+
trace = originalTraceback((("[Level " .. tostring(level)) .. "] ") .. tostring(message))
|
|
2121
2085
|
else
|
|
2122
2086
|
trace = originalTraceback(thread, message, level)
|
|
2123
2087
|
end
|
|
@@ -2126,12 +2090,12 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2126
2090
|
end
|
|
2127
2091
|
local function replacer(____, file, srcFile, line)
|
|
2128
2092
|
local fileSourceMap = _G.__TS__sourcemap[file]
|
|
2129
|
-
if fileSourceMap and fileSourceMap[line] then
|
|
2093
|
+
if fileSourceMap ~= nil and fileSourceMap[line] ~= nil then
|
|
2130
2094
|
local data = fileSourceMap[line]
|
|
2131
2095
|
if type(data) == "number" then
|
|
2132
2096
|
return (srcFile .. ":") .. tostring(data)
|
|
2133
2097
|
end
|
|
2134
|
-
return (
|
|
2098
|
+
return (data.file .. ":") .. tostring(data.line)
|
|
2135
2099
|
end
|
|
2136
2100
|
return (file .. ":") .. line
|
|
2137
2101
|
end
|
|
@@ -2142,14 +2106,14 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2142
2106
|
)
|
|
2143
2107
|
local function stringReplacer(____, file, line)
|
|
2144
2108
|
local fileSourceMap = _G.__TS__sourcemap[file]
|
|
2145
|
-
if fileSourceMap and fileSourceMap[line] then
|
|
2109
|
+
if fileSourceMap ~= nil and fileSourceMap[line] ~= nil then
|
|
2146
2110
|
local chunkName = __TS__Match(file, "%[string \"([^\"]+)\"%]")
|
|
2147
2111
|
local sourceName = string.gsub(chunkName, ".lua$", ".ts")
|
|
2148
2112
|
local data = fileSourceMap[line]
|
|
2149
2113
|
if type(data) == "number" then
|
|
2150
2114
|
return (sourceName .. ":") .. tostring(data)
|
|
2151
2115
|
end
|
|
2152
|
-
return (
|
|
2116
|
+
return (data.file .. ":") .. tostring(data.line)
|
|
2153
2117
|
end
|
|
2154
2118
|
return (file .. ":") .. line
|
|
2155
2119
|
end
|
|
@@ -2269,13 +2233,7 @@ do
|
|
|
2269
2233
|
return source
|
|
2270
2234
|
end
|
|
2271
2235
|
local before = sub(source, 1, startPos - 1)
|
|
2272
|
-
local
|
|
2273
|
-
if type(replaceValue) == "string" then
|
|
2274
|
-
____temp_0 = replaceValue
|
|
2275
|
-
else
|
|
2276
|
-
____temp_0 = replaceValue(nil, searchValue, startPos - 1, source)
|
|
2277
|
-
end
|
|
2278
|
-
local replacement = ____temp_0
|
|
2236
|
+
local replacement = type(replaceValue) == "string" and replaceValue or replaceValue(nil, searchValue, startPos - 1, source)
|
|
2279
2237
|
local after = sub(source, endPos + 1)
|
|
2280
2238
|
return (before .. replacement) .. after
|
|
2281
2239
|
end
|
|
@@ -2430,6 +2388,7 @@ do
|
|
|
2430
2388
|
return key
|
|
2431
2389
|
end
|
|
2432
2390
|
end
|
|
2391
|
+
return nil
|
|
2433
2392
|
end
|
|
2434
2393
|
end
|
|
2435
2394
|
|
|
@@ -15469,43 +15428,6 @@ function ____exports.shouldFireTrinketType(self, fireArgs, optionalArgs)
|
|
|
15469
15428
|
local callbackTrinketType = table.unpack(optionalArgs)
|
|
15470
15429
|
return callbackTrinketType == nil or callbackTrinketType == trinketType
|
|
15471
15430
|
end
|
|
15472
|
-
return ____exports
|
|
15473
|
-
end,
|
|
15474
|
-
["src.functions.log"] = function(...)
|
|
15475
|
-
local ____exports = {}
|
|
15476
|
-
function ____exports.getParentFunctionDescription(levels)
|
|
15477
|
-
if levels == nil then
|
|
15478
|
-
levels = 3
|
|
15479
|
-
end
|
|
15480
|
-
if debug ~= nil then
|
|
15481
|
-
local debugTable = debug.getinfo(levels)
|
|
15482
|
-
if debugTable ~= nil then
|
|
15483
|
-
return (tostring(debugTable.name) .. ":") .. tostring(debugTable.linedefined)
|
|
15484
|
-
end
|
|
15485
|
-
end
|
|
15486
|
-
if SandboxGetParentFunctionDescription ~= nil then
|
|
15487
|
-
return SandboxGetParentFunctionDescription(levels)
|
|
15488
|
-
end
|
|
15489
|
-
return nil
|
|
15490
|
-
end
|
|
15491
|
-
function ____exports.log(msg, includeParentFunction)
|
|
15492
|
-
if includeParentFunction == nil then
|
|
15493
|
-
includeParentFunction = true
|
|
15494
|
-
end
|
|
15495
|
-
local ____includeParentFunction_0
|
|
15496
|
-
if includeParentFunction then
|
|
15497
|
-
____includeParentFunction_0 = ____exports.getParentFunctionDescription()
|
|
15498
|
-
else
|
|
15499
|
-
____includeParentFunction_0 = nil
|
|
15500
|
-
end
|
|
15501
|
-
local parentFunctionDescription = ____includeParentFunction_0
|
|
15502
|
-
local debugMsg = parentFunctionDescription == nil and msg or (parentFunctionDescription .. " - ") .. msg
|
|
15503
|
-
Isaac.DebugString(debugMsg)
|
|
15504
|
-
end
|
|
15505
|
-
function ____exports.logAndPrint(self, msg)
|
|
15506
|
-
____exports.log(msg)
|
|
15507
|
-
print(msg)
|
|
15508
|
-
end
|
|
15509
15431
|
return ____exports
|
|
15510
15432
|
end,
|
|
15511
15433
|
["src.functions.types"] = function(...)
|
|
@@ -15562,6 +15484,48 @@ end
|
|
|
15562
15484
|
function ____exports.isUserdata(self, variable)
|
|
15563
15485
|
return type(variable) == "userdata"
|
|
15564
15486
|
end
|
|
15487
|
+
return ____exports
|
|
15488
|
+
end,
|
|
15489
|
+
["src.functions.log"] = function(...)
|
|
15490
|
+
local ____exports = {}
|
|
15491
|
+
local ____types = require("src.functions.types")
|
|
15492
|
+
local isNumber = ____types.isNumber
|
|
15493
|
+
function ____exports.getParentFunctionDescription(levels)
|
|
15494
|
+
if levels == nil then
|
|
15495
|
+
levels = 3
|
|
15496
|
+
end
|
|
15497
|
+
if debug ~= nil then
|
|
15498
|
+
local debugTable = debug.getinfo(levels)
|
|
15499
|
+
if debugTable ~= nil then
|
|
15500
|
+
return (tostring(debugTable.name) .. ":") .. tostring(debugTable.linedefined)
|
|
15501
|
+
end
|
|
15502
|
+
end
|
|
15503
|
+
if SandboxGetParentFunctionDescription ~= nil then
|
|
15504
|
+
return SandboxGetParentFunctionDescription(levels)
|
|
15505
|
+
end
|
|
15506
|
+
return nil
|
|
15507
|
+
end
|
|
15508
|
+
function ____exports.log(msg, includeParentFunction)
|
|
15509
|
+
if includeParentFunction == nil then
|
|
15510
|
+
includeParentFunction = true
|
|
15511
|
+
end
|
|
15512
|
+
if isNumber(nil, msg) then
|
|
15513
|
+
msg = tostring(msg)
|
|
15514
|
+
end
|
|
15515
|
+
local ____includeParentFunction_0
|
|
15516
|
+
if includeParentFunction then
|
|
15517
|
+
____includeParentFunction_0 = ____exports.getParentFunctionDescription()
|
|
15518
|
+
else
|
|
15519
|
+
____includeParentFunction_0 = nil
|
|
15520
|
+
end
|
|
15521
|
+
local parentFunctionDescription = ____includeParentFunction_0
|
|
15522
|
+
local debugMsg = parentFunctionDescription == nil and msg or (parentFunctionDescription .. " - ") .. msg
|
|
15523
|
+
Isaac.DebugString(debugMsg)
|
|
15524
|
+
end
|
|
15525
|
+
function ____exports.logAndPrint(self, msg)
|
|
15526
|
+
____exports.log(msg)
|
|
15527
|
+
print(msg)
|
|
15528
|
+
end
|
|
15565
15529
|
return ____exports
|
|
15566
15530
|
end,
|
|
15567
15531
|
["src.functions.sort"] = function(...)
|