@alextheman/utility 1.22.0 → 1.23.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.cjs CHANGED
@@ -317,6 +317,10 @@ var APIError = class extends Error {
317
317
  Object.defineProperty(this, "message", { enumerable: true });
318
318
  Object.setPrototypeOf(this, new.target.prototype);
319
319
  }
320
+ static check(input) {
321
+ const data = input;
322
+ return typeof data === "object" && data !== null && typeof (data == null ? void 0 : data.status) === "number" && typeof (data == null ? void 0 : data.message) === "string";
323
+ }
320
324
  };
321
325
  var APIError_default = APIError;
322
326
 
package/dist/index.d.cts CHANGED
@@ -36,6 +36,7 @@ declare const httpErrorCodeLookup: Record<HTTPErrorCodes, string>;
36
36
  declare class APIError extends Error {
37
37
  status: number;
38
38
  constructor(status?: HTTPErrorCodes | number, message?: string, options?: ErrorOptions);
39
+ static check(input: unknown): input is APIError;
39
40
  }
40
41
 
41
42
  declare const emailSchema: z.core.$ZodBranded<z.ZodEmail, "Email">;
package/dist/index.d.ts CHANGED
@@ -36,6 +36,7 @@ declare const httpErrorCodeLookup: Record<HTTPErrorCodes, string>;
36
36
  declare class APIError extends Error {
37
37
  status: number;
38
38
  constructor(status?: HTTPErrorCodes | number, message?: string, options?: ErrorOptions);
39
+ static check(input: unknown): input is APIError;
39
40
  }
40
41
 
41
42
  declare const emailSchema: z.core.$ZodBranded<z.ZodEmail, "Email">;
package/dist/index.js CHANGED
@@ -263,6 +263,10 @@ var APIError = class extends Error {
263
263
  Object.defineProperty(this, "message", { enumerable: true });
264
264
  Object.setPrototypeOf(this, new.target.prototype);
265
265
  }
266
+ static check(input) {
267
+ const data = input;
268
+ return typeof data === "object" && data !== null && typeof (data == null ? void 0 : data.status) === "number" && typeof (data == null ? void 0 : data.message) === "string";
269
+ }
266
270
  };
267
271
  var APIError_default = APIError;
268
272
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/utility",
3
- "version": "1.22.0",
3
+ "version": "1.23.0",
4
4
  "description": "Helpful utility functions",
5
5
  "license": "ISC",
6
6
  "author": "alextheman",
@@ -33,12 +33,12 @@
33
33
  "update-dependencies": "bash -c 'npx npm-check-updates -u \"$@\" && npm install' --"
34
34
  },
35
35
  "dependencies": {
36
- "zod": "^4.1.11"
36
+ "zod": "^4.1.12"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@alextheman/eslint-plugin": "^1.14.2",
40
40
  "@eslint/js": "^9.37.0",
41
- "@types/node": "^24.6.2",
41
+ "@types/node": "^24.7.1",
42
42
  "eslint": "^9.37.0",
43
43
  "eslint-import-resolver-typescript": "^4.4.4",
44
44
  "eslint-plugin-import": "^2.32.0",
@@ -48,7 +48,7 @@
48
48
  "prettier": "^3.6.2",
49
49
  "tsup": "^8.5.0",
50
50
  "typescript": "^5.9.3",
51
- "typescript-eslint": "^8.45.0",
51
+ "typescript-eslint": "^8.46.0",
52
52
  "vite-tsconfig-paths": "^5.1.4",
53
53
  "vitest": "^3.2.4"
54
54
  }