isaacscript-common 69.1.0 → 69.3.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 +14 -0
- package/dist/isaacscript-common.lua +16 -1
- package/dist/src/functions/collectibles.d.ts +2 -0
- package/dist/src/functions/collectibles.d.ts.map +1 -1
- package/dist/src/functions/collectibles.lua +2 -0
- package/dist/src/functions/string.d.ts +12 -0
- package/dist/src/functions/string.d.ts.map +1 -1
- package/dist/src/functions/string.lua +17 -0
- package/package.json +2 -2
- package/src/functions/collectibles.ts +2 -0
- package/src/functions/string.ts +39 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -9217,6 +9217,8 @@ export declare function isGenesisRoom(roomDescriptor: RoomDescriptor): boolean;
|
|
|
9217
9217
|
* Returns whether the given collectible is a "glitched" item. All items are replaced by glitched
|
|
9218
9218
|
* items once a player has TMTRAINER. However, glitched items can also "naturally" appear in secret
|
|
9219
9219
|
* rooms and I AM ERROR rooms if the "Corrupted Data" achievement is unlocked.
|
|
9220
|
+
*
|
|
9221
|
+
* Under the hood, this checks if the sub-type of the collectible is greater than 4,000,000,000.
|
|
9220
9222
|
*/
|
|
9221
9223
|
export declare function isGlitchedCollectible(collectible: EntityPickup): boolean;
|
|
9222
9224
|
|
|
@@ -14648,6 +14650,18 @@ export declare function parseEntityID(entityID: string): [entityType: EntityType
|
|
|
14648
14650
|
*/
|
|
14649
14651
|
export declare function parseEntityTypeVariantString(entityTypeVariantString: string): [entityType: EntityType, variant: int] | undefined;
|
|
14650
14652
|
|
|
14653
|
+
/**
|
|
14654
|
+
* Helper function to parse a Semantic Versioning string into its individual constituents. Returns
|
|
14655
|
+
* undefined if the submitted string was not a proper Semantic Version string.
|
|
14656
|
+
*
|
|
14657
|
+
* https://semver.org/
|
|
14658
|
+
*/
|
|
14659
|
+
export declare function parseSemanticVersion(versionString: string): {
|
|
14660
|
+
majorVersion: int;
|
|
14661
|
+
minorVersion: int;
|
|
14662
|
+
patchVersion: int;
|
|
14663
|
+
} | undefined;
|
|
14664
|
+
|
|
14651
14665
|
declare class Pause extends Feature {
|
|
14652
14666
|
private readonly disableInputs;
|
|
14653
14667
|
private readonly postUpdate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 69.
|
|
3
|
+
isaacscript-common 69.3.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -5470,6 +5470,8 @@ ____exports.PrideVariant.PRIDE = 0
|
|
|
5470
5470
|
____exports.PrideVariant[____exports.PrideVariant.PRIDE] = "PRIDE"
|
|
5471
5471
|
____exports.PrideVariant.SUPER_PRIDE = 1
|
|
5472
5472
|
____exports.PrideVariant[____exports.PrideVariant.SUPER_PRIDE] = "SUPER_PRIDE"
|
|
5473
|
+
____exports.PrideVariant.ULTRA_PRIDE = 2
|
|
5474
|
+
____exports.PrideVariant[____exports.PrideVariant.ULTRA_PRIDE] = "ULTRA_PRIDE"
|
|
5473
5475
|
--- For `EntityType.DOPLE` (53).
|
|
5474
5476
|
____exports.DopleVariant = {}
|
|
5475
5477
|
____exports.DopleVariant.DOPLE = 0
|
|
@@ -16500,6 +16502,19 @@ function ____exports.getObjectPartialMatch(self, searchText, object)
|
|
|
16500
16502
|
assertDefined(nil, value, "Failed to get the object value corresponding to the partial match of: " .. matchingKey)
|
|
16501
16503
|
return {matchingKey, value}
|
|
16502
16504
|
end
|
|
16505
|
+
function ____exports.parseSemanticVersion(self, versionString)
|
|
16506
|
+
local majorVersionString, minorVersionString, patchVersionString = string.match(versionString, "(%d+).(%d+).(%d+)")
|
|
16507
|
+
if majorVersionString == nil or minorVersionString == nil or patchVersionString == nil then
|
|
16508
|
+
return nil
|
|
16509
|
+
end
|
|
16510
|
+
local majorVersion = tonumber(majorVersionString)
|
|
16511
|
+
local minorVersion = tonumber(minorVersionString)
|
|
16512
|
+
local patchVersion = tonumber(patchVersionString)
|
|
16513
|
+
if majorVersion == nil or minorVersion == nil or patchVersion == nil then
|
|
16514
|
+
return nil
|
|
16515
|
+
end
|
|
16516
|
+
return {majorVersion = majorVersion, minorVersion = minorVersion, patchVersion = patchVersion}
|
|
16517
|
+
end
|
|
16503
16518
|
function ____exports.removeAllCharacters(self, ____string, character)
|
|
16504
16519
|
return __TS__StringReplaceAll(____string, character, "")
|
|
16505
16520
|
end
|
|
@@ -107,6 +107,8 @@ export declare function isFamiliarCollectible(collectibleType: CollectibleType):
|
|
|
107
107
|
* Returns whether the given collectible is a "glitched" item. All items are replaced by glitched
|
|
108
108
|
* items once a player has TMTRAINER. However, glitched items can also "naturally" appear in secret
|
|
109
109
|
* rooms and I AM ERROR rooms if the "Corrupted Data" achievement is unlocked.
|
|
110
|
+
*
|
|
111
|
+
* Under the hood, this checks if the sub-type of the collectible is greater than 4,000,000,000.
|
|
110
112
|
*/
|
|
111
113
|
export declare function isGlitchedCollectible(collectible: EntityPickup): boolean;
|
|
112
114
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,uBAAuB,EACvB,aAAa,EACd,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,eAAe,EAEf,oBAAoB,EAEpB,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC;AAgEtC,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAStE;AAED,iGAAiG;AACjG,wBAAgB,uBAAuB,CACrC,4BAA4B,EAAE,YAAY,GAAG,eAAe,EAC5D,SAAS,EAAE,SAAS,GACnB,OAAO,CAYT;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAsBT;AAED;;;GAGG;A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,EAAE,OAAO,GACf,WAAW,CAAC,eAAe,CAAC,CAS9B;AAED,sFAAsF;AACtF,wBAAgB,mBAAmB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAG7E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,YAAY,GAAG,OAAO,CAsBrE;AAED,wFAAwF;AACxF,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED
|
|
1
|
+
{"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,uBAAuB,EACvB,aAAa,EACd,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,eAAe,EAEf,oBAAoB,EAEpB,QAAQ,EACR,WAAW,EAGZ,MAAM,8BAA8B,CAAC;AAgEtC,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAStE;AAED,iGAAiG;AACjG,wBAAgB,uBAAuB,CACrC,4BAA4B,EAAE,YAAY,GAAG,eAAe,EAC5D,SAAS,EAAE,SAAS,GACnB,OAAO,CAYT;AAED,6FAA6F;AAC7F,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,OAAO,CAsBT;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,4BAA4B,EAAE,YAAY,GAAG,eAAe,GAC3D,oBAAoB,CAYtB;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,4BAA4B,EAAE,YAAY,GAAG,eAAe,GAC3D,MAAM,CAqBR;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,4BAA4B,EAAE,YAAY,GAAG,eAAe,GAC3D,GAAG,CAgBL;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,4BAA4B,EAAE,YAAY,GAAG,eAAe,EAC5D,MAAM,EAAE,YAAY,GACnB,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,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,YAAY,EACzB,kBAAkB,EAAE,eAAe,GAClC,IAAI,CA2BN;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAK5D"}
|
|
@@ -385,6 +385,8 @@ end
|
|
|
385
385
|
--- Returns whether the given collectible is a "glitched" item. All items are replaced by glitched
|
|
386
386
|
-- items once a player has TMTRAINER. However, glitched items can also "naturally" appear in secret
|
|
387
387
|
-- rooms and I AM ERROR rooms if the "Corrupted Data" achievement is unlocked.
|
|
388
|
+
--
|
|
389
|
+
-- Under the hood, this checks if the sub-type of the collectible is greater than 4,000,000,000.
|
|
388
390
|
function ____exports.isGlitchedCollectible(self, collectible)
|
|
389
391
|
return collectible.Variant == PickupVariant.COLLECTIBLE and collectible.SubType > GLITCHED_ITEM_THRESHOLD
|
|
390
392
|
end
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
1
2
|
export declare function capitalizeFirstLetter(string: string): string;
|
|
2
3
|
/**
|
|
3
4
|
* Helper function to get the closest key from a map based on partial search text. (It only searches
|
|
@@ -67,6 +68,17 @@ export declare function getObjectPartialMatch<T>(searchText: string, object: Rec
|
|
|
67
68
|
* ```
|
|
68
69
|
*/
|
|
69
70
|
export declare function getPartialMatch(searchText: string, array: string[]): string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Helper function to parse a Semantic Versioning string into its individual constituents. Returns
|
|
73
|
+
* undefined if the submitted string was not a proper Semantic Version string.
|
|
74
|
+
*
|
|
75
|
+
* https://semver.org/
|
|
76
|
+
*/
|
|
77
|
+
export declare function parseSemanticVersion(versionString: string): {
|
|
78
|
+
majorVersion: int;
|
|
79
|
+
minorVersion: int;
|
|
80
|
+
patchVersion: int;
|
|
81
|
+
} | undefined;
|
|
70
82
|
export declare function removeAllCharacters(string: string, character: string): string;
|
|
71
83
|
/**
|
|
72
84
|
* Helper function to remove all of the characters in a string before a given substring. Returns the
|
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,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,GAAG,UAAU,EAAE,MAAM,EAAE,GACtB,MAAM,CAMR;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMjE;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOjE"}
|
|
@@ -112,6 +112,23 @@ function ____exports.getObjectPartialMatch(self, searchText, object)
|
|
|
112
112
|
assertDefined(nil, value, "Failed to get the object value corresponding to the partial match of: " .. matchingKey)
|
|
113
113
|
return {matchingKey, value}
|
|
114
114
|
end
|
|
115
|
+
--- Helper function to parse a Semantic Versioning string into its individual constituents. Returns
|
|
116
|
+
-- undefined if the submitted string was not a proper Semantic Version string.
|
|
117
|
+
--
|
|
118
|
+
-- https://semver.org/
|
|
119
|
+
function ____exports.parseSemanticVersion(self, versionString)
|
|
120
|
+
local majorVersionString, minorVersionString, patchVersionString = string.match(versionString, "(%d+).(%d+).(%d+)")
|
|
121
|
+
if majorVersionString == nil or minorVersionString == nil or patchVersionString == nil then
|
|
122
|
+
return nil
|
|
123
|
+
end
|
|
124
|
+
local majorVersion = tonumber(majorVersionString)
|
|
125
|
+
local minorVersion = tonumber(minorVersionString)
|
|
126
|
+
local patchVersion = tonumber(patchVersionString)
|
|
127
|
+
if majorVersion == nil or minorVersion == nil or patchVersion == nil then
|
|
128
|
+
return nil
|
|
129
|
+
end
|
|
130
|
+
return {majorVersion = majorVersion, minorVersion = minorVersion, patchVersion = patchVersion}
|
|
131
|
+
end
|
|
115
132
|
function ____exports.removeAllCharacters(self, ____string, character)
|
|
116
133
|
return __TS__StringReplaceAll(____string, character, "")
|
|
117
134
|
end
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "69.
|
|
3
|
+
"version": "69.3.0",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"main": "dist/src/index",
|
|
26
26
|
"types": "dist/index.rollup.d.ts",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^33.
|
|
28
|
+
"isaac-typescript-definitions": "^33.2.0"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -499,6 +499,8 @@ export function isFamiliarCollectible(
|
|
|
499
499
|
* Returns whether the given collectible is a "glitched" item. All items are replaced by glitched
|
|
500
500
|
* items once a player has TMTRAINER. However, glitched items can also "naturally" appear in secret
|
|
501
501
|
* rooms and I AM ERROR rooms if the "Corrupted Data" achievement is unlocked.
|
|
502
|
+
*
|
|
503
|
+
* Under the hood, this checks if the sub-type of the collectible is greater than 4,000,000,000.
|
|
502
504
|
*/
|
|
503
505
|
export function isGlitchedCollectible(collectible: EntityPickup): boolean {
|
|
504
506
|
return (
|
package/src/functions/string.ts
CHANGED
|
@@ -134,6 +134,45 @@ export function getPartialMatch(
|
|
|
134
134
|
return matchingElements[0];
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Helper function to parse a Semantic Versioning string into its individual constituents. Returns
|
|
139
|
+
* undefined if the submitted string was not a proper Semantic Version string.
|
|
140
|
+
*
|
|
141
|
+
* https://semver.org/
|
|
142
|
+
*/
|
|
143
|
+
export function parseSemanticVersion(versionString: string):
|
|
144
|
+
| {
|
|
145
|
+
majorVersion: int;
|
|
146
|
+
minorVersion: int;
|
|
147
|
+
patchVersion: int;
|
|
148
|
+
}
|
|
149
|
+
| undefined {
|
|
150
|
+
const [majorVersionString, minorVersionString, patchVersionString] =
|
|
151
|
+
string.match(versionString, "(%d+).(%d+).(%d+)");
|
|
152
|
+
|
|
153
|
+
if (
|
|
154
|
+
majorVersionString === undefined ||
|
|
155
|
+
minorVersionString === undefined ||
|
|
156
|
+
patchVersionString === undefined
|
|
157
|
+
) {
|
|
158
|
+
return undefined;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const majorVersion = tonumber(majorVersionString);
|
|
162
|
+
const minorVersion = tonumber(minorVersionString);
|
|
163
|
+
const patchVersion = tonumber(patchVersionString);
|
|
164
|
+
|
|
165
|
+
if (
|
|
166
|
+
majorVersion === undefined ||
|
|
167
|
+
minorVersion === undefined ||
|
|
168
|
+
patchVersion === undefined
|
|
169
|
+
) {
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return { majorVersion, minorVersion, patchVersion };
|
|
174
|
+
}
|
|
175
|
+
|
|
137
176
|
export function removeAllCharacters(string: string, character: string): string {
|
|
138
177
|
return string.replaceAll(character, "");
|
|
139
178
|
}
|