isaacscript-common 69.2.0 → 69.3.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.
@@ -14650,6 +14650,18 @@ export declare function parseEntityID(entityID: string): [entityType: EntityType
14650
14650
  */
14651
14651
  export declare function parseEntityTypeVariantString(entityTypeVariantString: string): [entityType: EntityType, variant: int] | undefined;
14652
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
+
14653
14665
  declare class Pause extends Feature {
14654
14666
  private readonly disableInputs;
14655
14667
  private readonly postUpdate;
@@ -16907,7 +16919,12 @@ export declare function setBackdrop(backdropType: BackdropType): void;
16907
16919
  /**
16908
16920
  * Helper function to blindfold the player by using a hack with the challenge variable.
16909
16921
  *
16910
- * The method used in this function was discovered by im_tem.
16922
+ * Note that if the player dies and respawns (from e.g. Dead Cat), the blindfold will have to be
16923
+ * reapplied.
16924
+ *
16925
+ * Under the hood, this function sets the challenge to one with a blindfold, changes the player to
16926
+ * the same character that they currently are, and then changes the challenge back. This method was
16927
+ * discovered by im_tem.
16911
16928
  *
16912
16929
  * @param player The player to apply or remove the blindfold state from.
16913
16930
  * @param enabled Whether to apply or remove the blindfold.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 69.2.0
3
+ isaacscript-common 69.3.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -16502,6 +16502,19 @@ function ____exports.getObjectPartialMatch(self, searchText, object)
16502
16502
  assertDefined(nil, value, "Failed to get the object value corresponding to the partial match of: " .. matchingKey)
16503
16503
  return {matchingKey, value}
16504
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
16505
16518
  function ____exports.removeAllCharacters(self, ____string, character)
16506
16519
  return __TS__StringReplaceAll(____string, character, "")
16507
16520
  end
@@ -216,7 +216,12 @@ export declare function removeDeadEyeMultiplier(player: EntityPlayer): void;
216
216
  /**
217
217
  * Helper function to blindfold the player by using a hack with the challenge variable.
218
218
  *
219
- * The method used in this function was discovered by im_tem.
219
+ * Note that if the player dies and respawns (from e.g. Dead Cat), the blindfold will have to be
220
+ * reapplied.
221
+ *
222
+ * Under the hood, this function sets the challenge to one with a blindfold, changes the player to
223
+ * the same character that they currently are, and then changes the challenge back. This method was
224
+ * discovered by im_tem.
220
225
  *
221
226
  * @param player The player to apply or remove the blindfold state from.
222
227
  * @param enabled Whether to apply or remove the blindfold.
@@ -1 +1 @@
1
- {"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAEL,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAatC,wFAAwF;AACxF,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,GAC/B,OAAO,CAOT;AAED,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAOtE;AAED,oFAAoF;AACpF,wBAAgB,yBA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G,OAAO,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE/D;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMvD;AAED,8FAA8F;AAC9F,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAM9D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAG7D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN"}
@@ -437,7 +437,12 @@ function ____exports.removeDeadEyeMultiplier(self, player)
437
437
  end
438
438
  --- Helper function to blindfold the player by using a hack with the challenge variable.
439
439
  --
440
- -- The method used in this function was discovered by im_tem.
440
+ -- Note that if the player dies and respawns (from e.g. Dead Cat), the blindfold will have to be
441
+ -- reapplied.
442
+ --
443
+ -- Under the hood, this function sets the challenge to one with a blindfold, changes the player to
444
+ -- the same character that they currently are, and then changes the challenge back. This method was
445
+ -- discovered by im_tem.
441
446
  --
442
447
  -- @param player The player to apply or remove the blindfold state from.
443
448
  -- @param enabled Whether to apply or remove the blindfold.
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../../src/functions/string.ts"],"names":[],"mappings":"AAEA,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAU5D;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAC1B,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAezB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GACxB,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAezB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAAE,GACd,MAAM,GAAG,SAAS,CAYpB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR;AAED,8FAA8F;AAC9F,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGnE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM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AAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR;AAED,8FAA8F;AAC9F,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGnE;AAED;;;;;GAKG;AACH,wBAAgB,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.2.0",
3
+ "version": "69.3.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -548,7 +548,12 @@ export function removeDeadEyeMultiplier(player: EntityPlayer): void {
548
548
  /**
549
549
  * Helper function to blindfold the player by using a hack with the challenge variable.
550
550
  *
551
- * The method used in this function was discovered by im_tem.
551
+ * Note that if the player dies and respawns (from e.g. Dead Cat), the blindfold will have to be
552
+ * reapplied.
553
+ *
554
+ * Under the hood, this function sets the challenge to one with a blindfold, changes the player to
555
+ * the same character that they currently are, and then changes the challenge back. This method was
556
+ * discovered by im_tem.
552
557
  *
553
558
  * @param player The player to apply or remove the blindfold state from.
554
559
  * @param enabled Whether to apply or remove the blindfold.
@@ -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
  }