@creejs/commons-lang 2.1.23 → 2.1.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creejs/commons-lang",
3
- "version": "2.1.23",
3
+ "version": "2.1.24",
4
4
  "description": "Commons Utils About Language, used inside creejs",
5
5
  "keywords": [
6
6
  "commons",
package/types/_error.d.ts CHANGED
@@ -1,4 +1,20 @@
1
+ /**
2
+ * @class _Error
3
+ */
1
4
  export default class _Error extends Error {
5
+ static get Code(): {
6
+ NOT_FOUND: number;
7
+ NOT_SUPPORTED: number;
8
+ NOT_IMPL: number;
9
+ };
10
+ /**
11
+ * Checks if the given value is an _ErrorLike object
12
+ * @param {{[key:string]:any}} err - The value to checke
13
+ * @returns {boolean} True if the value is error-like
14
+ */
15
+ static isErrorLike(err: {
16
+ [key: string]: any;
17
+ }): boolean;
2
18
  /**
3
19
  * Creates and returns a 404 Not Found error instance with the given message.
4
20
  * @param {string} message - The error message to include.
@@ -26,5 +42,11 @@ export default class _Error extends Error {
26
42
  * @param {number|string} code - Error code
27
43
  */
28
44
  constructor(message: string, code: number | string);
45
+ _type: string;
29
46
  code: string | number;
30
47
  }
48
+ export type _ErrorLike = {
49
+ type: string;
50
+ message: string;
51
+ _code: number;
52
+ };