isaacscript-common 31.2.1 → 31.2.2
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 +11 -6
- package/dist/isaacscript-common.lua +5 -5
- package/dist/src/types/Decrement.d.ts +3 -2
- package/dist/src/types/Decrement.d.ts.map +1 -1
- package/dist/src/types/Increment.d.ts +3 -2
- package/dist/src/types/Increment.d.ts.map +1 -1
- package/dist/src/types/Tuple.d.ts +5 -4
- package/dist/src/types/Tuple.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/types/Decrement.ts +5 -3
- package/src/types/Increment.ts +5 -3
- package/src/types/Tuple.ts +10 -7
package/dist/index.rollup.d.ts
CHANGED
|
@@ -1035,6 +1035,10 @@ export declare function anyPlayerHoldingItem(): boolean;
|
|
|
1035
1035
|
*/
|
|
1036
1036
|
export declare function anyPlayerIs(...matchingCharacters: PlayerType[]): boolean;
|
|
1037
1037
|
|
|
1038
|
+
declare type Arr<N extends number, T extends unknown[] = []> = T["length"] extends N ? T : Arr<N, [...T, unknown]>;
|
|
1039
|
+
|
|
1040
|
+
declare type Arr_2<N extends number, T extends unknown[] = []> = T["length"] extends N ? T : Arr_2<N, [...T, unknown]>;
|
|
1041
|
+
|
|
1038
1042
|
/**
|
|
1039
1043
|
* Helper function for determining if two arrays contain the exact same elements. Note that this
|
|
1040
1044
|
* only performs a shallow comparison.
|
|
@@ -3196,7 +3200,7 @@ declare class DebugDisplay extends Feature {
|
|
|
3196
3200
|
*
|
|
3197
3201
|
* From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type
|
|
3198
3202
|
*/
|
|
3199
|
-
export declare type Decrement<N extends number> =
|
|
3203
|
+
export declare type Decrement<N extends number> = Arr<N> extends [unknown, ...infer U] ? U["length"] : never;
|
|
3200
3204
|
|
|
3201
3205
|
/**
|
|
3202
3206
|
* `deepCopy` is a semi-generic deep cloner. It will recursively copy all of the values so that none
|
|
@@ -7548,7 +7552,7 @@ export declare function inCrawlSpace(): boolean;
|
|
|
7548
7552
|
*
|
|
7549
7553
|
* From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type
|
|
7550
7554
|
*/
|
|
7551
|
-
export declare type Increment<N extends number> = [...
|
|
7555
|
+
export declare type Increment<N extends number> = [...Arr_2<N>, unknown]["length"] & number;
|
|
7552
7556
|
|
|
7553
7557
|
/**
|
|
7554
7558
|
* Helper function to detect if the current room is one of the rooms in the Death Certificate area.
|
|
@@ -16965,11 +16969,12 @@ export declare interface TSTLClassMetatable {
|
|
|
16965
16969
|
/**
|
|
16966
16970
|
* Helper type to represent a tuple of length N.
|
|
16967
16971
|
*
|
|
16968
|
-
*
|
|
16969
|
-
*
|
|
16970
|
-
* From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type
|
|
16972
|
+
* From:
|
|
16973
|
+
* https://stackoverflow.com/questions/52489261/typescript-can-i-define-an-n-length-tuple-type/52490977#52490977
|
|
16971
16974
|
*/
|
|
16972
|
-
export declare type Tuple<N extends number
|
|
16975
|
+
export declare type Tuple<T, N extends number> = N extends N ? number extends N ? T[] : _TupleOf<T, N, []> : never;
|
|
16976
|
+
|
|
16977
|
+
declare type _TupleOf<T, N extends number, R extends unknown[]> = R["length"] extends N ? R : _TupleOf<T, N, [T, ...R]>;
|
|
16973
16978
|
|
|
16974
16979
|
export declare type TupleToIntersection<T extends unknown[]> = T extends [
|
|
16975
16980
|
infer F,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 31.2.
|
|
3
|
+
isaacscript-common 31.2.2
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -53818,10 +53818,6 @@ return ____exports
|
|
|
53818
53818
|
end,
|
|
53819
53819
|
["src.types.AllButLast"] = function(...)
|
|
53820
53820
|
local ____exports = {}
|
|
53821
|
-
return ____exports
|
|
53822
|
-
end,
|
|
53823
|
-
["src.types.Tuple"] = function(...)
|
|
53824
|
-
local ____exports = {}
|
|
53825
53821
|
return ____exports
|
|
53826
53822
|
end,
|
|
53827
53823
|
["src.types.Decrement"] = function(...)
|
|
@@ -53858,6 +53854,10 @@ return ____exports
|
|
|
53858
53854
|
end,
|
|
53859
53855
|
["src.types.StartsWithUppercase"] = function(...)
|
|
53860
53856
|
local ____exports = {}
|
|
53857
|
+
return ____exports
|
|
53858
|
+
end,
|
|
53859
|
+
["src.types.Tuple"] = function(...)
|
|
53860
|
+
local ____exports = {}
|
|
53861
53861
|
return ____exports
|
|
53862
53862
|
end,
|
|
53863
53863
|
["src.types.TupleToUnion"] = function(...)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Tuple } from "./Tuple";
|
|
2
1
|
/**
|
|
3
2
|
* Helper type to subtract one from a number type.
|
|
4
3
|
*
|
|
5
4
|
* From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type
|
|
6
5
|
*/
|
|
7
|
-
export type Decrement<N extends number> =
|
|
6
|
+
export type Decrement<N extends number> = Arr<N> extends [unknown, ...infer U] ? U["length"] : never;
|
|
7
|
+
type Arr<N extends number, T extends unknown[] = []> = T["length"] extends N ? T : Arr<N, [...T, unknown]>;
|
|
8
|
+
export {};
|
|
8
9
|
//# sourceMappingURL=Decrement.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Decrement.d.ts","sourceRoot":"","sources":["../../../src/types/Decrement.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Decrement.d.ts","sourceRoot":"","sources":["../../../src/types/Decrement.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC,GAC1E,CAAC,CAAC,QAAQ,CAAC,GACX,KAAK,CAAC;AAEV,KAAK,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GACxE,CAAC,GACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { Tuple } from "./Tuple";
|
|
2
1
|
/**
|
|
3
2
|
* Helper type to add one to a number type.
|
|
4
3
|
*
|
|
5
4
|
* From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type
|
|
6
5
|
*/
|
|
7
|
-
export type Increment<N extends number> = [...
|
|
6
|
+
export type Increment<N extends number> = [...Arr<N>, unknown]["length"] & number;
|
|
7
|
+
type Arr<N extends number, T extends unknown[] = []> = T["length"] extends N ? T : Arr<N, [...T, unknown]>;
|
|
8
|
+
export {};
|
|
8
9
|
//# sourceMappingURL=Increment.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Increment.d.ts","sourceRoot":"","sources":["../../../src/types/Increment.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Increment.d.ts","sourceRoot":"","sources":["../../../src/types/Increment.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,MAAM,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,GACtE,MAAM,CAAC;AAET,KAAK,GAAG,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GACxE,CAAC,GACD,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Helper type to represent a tuple of length N.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type
|
|
4
|
+
* From:
|
|
5
|
+
* https://stackoverflow.com/questions/52489261/typescript-can-i-define-an-n-length-tuple-type/52490977#52490977
|
|
7
6
|
*/
|
|
8
|
-
export type Tuple<N extends number
|
|
7
|
+
export type Tuple<T, N extends number> = N extends N ? number extends N ? T[] : _TupleOf<T, N, []> : never;
|
|
8
|
+
type _TupleOf<T, N extends number, R extends unknown[]> = R["length"] extends N ? R : _TupleOf<T, N, [T, ...R]>;
|
|
9
|
+
export {};
|
|
9
10
|
//# sourceMappingURL=Tuple.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tuple.d.ts","sourceRoot":"","sources":["../../../src/types/Tuple.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Tuple.d.ts","sourceRoot":"","sources":["../../../src/types/Tuple.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,GAChD,MAAM,SAAS,CAAC,GACd,CAAC,EAAE,GACH,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GACpB,KAAK,CAAC;AACV,KAAK,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,GAC3E,CAAC,GACD,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/types/Decrement.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import type { Tuple } from "./Tuple";
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Helper type to subtract one from a number type.
|
|
5
3
|
*
|
|
6
4
|
* From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type
|
|
7
5
|
*/
|
|
8
|
-
export type Decrement<N extends number> =
|
|
6
|
+
export type Decrement<N extends number> = Arr<N> extends [unknown, ...infer U]
|
|
9
7
|
? U["length"]
|
|
10
8
|
: never;
|
|
9
|
+
|
|
10
|
+
type Arr<N extends number, T extends unknown[] = []> = T["length"] extends N
|
|
11
|
+
? T
|
|
12
|
+
: Arr<N, [...T, unknown]>;
|
package/src/types/Increment.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { Tuple } from "./Tuple";
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Helper type to add one to a number type.
|
|
5
3
|
*
|
|
6
4
|
* From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type
|
|
7
5
|
*/
|
|
8
|
-
export type Increment<N extends number> = [...
|
|
6
|
+
export type Increment<N extends number> = [...Arr<N>, unknown]["length"] &
|
|
9
7
|
number;
|
|
8
|
+
|
|
9
|
+
type Arr<N extends number, T extends unknown[] = []> = T["length"] extends N
|
|
10
|
+
? T
|
|
11
|
+
: Arr<N, [...T, unknown]>;
|
package/src/types/Tuple.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Helper type to represent a tuple of length N.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* From: https://stackoverflow.com/questions/54243431/typescript-increment-number-type
|
|
4
|
+
* From:
|
|
5
|
+
* https://stackoverflow.com/questions/52489261/typescript-can-i-define-an-n-length-tuple-type/52490977#52490977
|
|
7
6
|
*/
|
|
8
|
-
export type Tuple<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export type Tuple<T, N extends number> = N extends N
|
|
8
|
+
? number extends N
|
|
9
|
+
? T[]
|
|
10
|
+
: _TupleOf<T, N, []>
|
|
11
|
+
: never;
|
|
12
|
+
type _TupleOf<T, N extends number, R extends unknown[]> = R["length"] extends N
|
|
13
|
+
? R
|
|
14
|
+
: _TupleOf<T, N, [T, ...R]>;
|