@alextheman/utility 4.2.0 → 4.2.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.
package/dist/index.cjs CHANGED
@@ -181,7 +181,7 @@ var VersionNumber = class VersionNumber {
181
181
  minor = 0;
182
182
  /** The patch number. Increments when the next release is fixing a bug or doing a small refactor that should not be noticeable in practice. */
183
183
  patch = 0;
184
- nonNegativeTupleError = "Input array must be a tuple of three non-negative integers.";
184
+ static NON_NEGATIVE_TUPLE_ERROR = "Input array must be a tuple of three non-negative integers.";
185
185
  /**
186
186
  * @param input - The input to create a new instance of `VersionNumber` from.
187
187
  */
@@ -199,10 +199,10 @@ var VersionNumber = class VersionNumber {
199
199
  this.minor = minor;
200
200
  this.patch = patch;
201
201
  } else if (Array.isArray(input)) {
202
- if (input.length !== 3) throw new DataError_default(input, "INVALID_LENGTH", this.nonNegativeTupleError);
202
+ if (input.length !== 3) throw new DataError_default(input, "INVALID_LENGTH", VersionNumber.NON_NEGATIVE_TUPLE_ERROR);
203
203
  const [major, minor, patch] = input.map((number) => {
204
204
  const parsedInteger = parseIntStrict_default(number?.toString());
205
- if (parsedInteger < 0) throw new DataError_default(input, "NON_POSITIVE_INPUTS", this.nonNegativeTupleError);
205
+ if (parsedInteger < 0) throw new DataError_default(input, "NON_POSITIVE_INPUTS", VersionNumber.NON_NEGATIVE_TUPLE_ERROR);
206
206
  return parsedInteger;
207
207
  });
208
208
  this.major = major;
package/dist/index.d.cts CHANGED
@@ -254,7 +254,7 @@ declare class VersionNumber {
254
254
  readonly minor: number;
255
255
  /** The patch number. Increments when the next release is fixing a bug or doing a small refactor that should not be noticeable in practice. */
256
256
  readonly patch: number;
257
- private readonly nonNegativeTupleError;
257
+ private static readonly NON_NEGATIVE_TUPLE_ERROR;
258
258
  /**
259
259
  * @param input - The input to create a new instance of `VersionNumber` from.
260
260
  */
package/dist/index.d.ts CHANGED
@@ -254,7 +254,7 @@ declare class VersionNumber {
254
254
  readonly minor: number;
255
255
  /** The patch number. Increments when the next release is fixing a bug or doing a small refactor that should not be noticeable in practice. */
256
256
  readonly patch: number;
257
- private readonly nonNegativeTupleError;
257
+ private static readonly NON_NEGATIVE_TUPLE_ERROR;
258
258
  /**
259
259
  * @param input - The input to create a new instance of `VersionNumber` from.
260
260
  */
package/dist/index.js CHANGED
@@ -152,7 +152,7 @@ var VersionNumber = class VersionNumber {
152
152
  minor = 0;
153
153
  /** The patch number. Increments when the next release is fixing a bug or doing a small refactor that should not be noticeable in practice. */
154
154
  patch = 0;
155
- nonNegativeTupleError = "Input array must be a tuple of three non-negative integers.";
155
+ static NON_NEGATIVE_TUPLE_ERROR = "Input array must be a tuple of three non-negative integers.";
156
156
  /**
157
157
  * @param input - The input to create a new instance of `VersionNumber` from.
158
158
  */
@@ -170,10 +170,10 @@ var VersionNumber = class VersionNumber {
170
170
  this.minor = minor;
171
171
  this.patch = patch;
172
172
  } else if (Array.isArray(input)) {
173
- if (input.length !== 3) throw new DataError_default(input, "INVALID_LENGTH", this.nonNegativeTupleError);
173
+ if (input.length !== 3) throw new DataError_default(input, "INVALID_LENGTH", VersionNumber.NON_NEGATIVE_TUPLE_ERROR);
174
174
  const [major, minor, patch] = input.map((number) => {
175
175
  const parsedInteger = parseIntStrict_default(number?.toString());
176
- if (parsedInteger < 0) throw new DataError_default(input, "NON_POSITIVE_INPUTS", this.nonNegativeTupleError);
176
+ if (parsedInteger < 0) throw new DataError_default(input, "NON_POSITIVE_INPUTS", VersionNumber.NON_NEGATIVE_TUPLE_ERROR);
177
177
  return parsedInteger;
178
178
  });
179
179
  this.major = major;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/utility",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "Helpful utility functions",
5
5
  "repository": {
6
6
  "type": "git",