@rainbow-o23/n1 1.0.54 → 1.0.56

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/index.cjs CHANGED
@@ -25,33 +25,33 @@ const ErrorCodes = new Proxy({
25
25
  }
26
26
  });
27
27
  class CatchableError extends Error {
28
- _code;
29
- constructor(_code, message) {
28
+ code;
29
+ constructor(code, message) {
30
30
  super(message);
31
- this._code = _code;
31
+ this.code = code;
32
32
  }
33
33
  getCode() {
34
- return this._code;
34
+ return this.code;
35
35
  }
36
36
  }
37
37
  class UncatchableError extends Error {
38
- _code;
39
- constructor(_code, message) {
38
+ code;
39
+ constructor(code, message) {
40
40
  super(message);
41
- this._code = _code;
41
+ this.code = code;
42
42
  }
43
43
  getCode() {
44
- return this._code;
44
+ return this.code;
45
45
  }
46
46
  }
47
47
  class ExposedUncatchableError extends UncatchableError {
48
- _status;
48
+ status;
49
49
  constructor(status, code, message) {
50
50
  super(code, message);
51
- this._status = status;
51
+ this.status = status;
52
52
  }
53
53
  getStatus() {
54
- return this._status;
54
+ return this.status;
55
55
  }
56
56
  }
57
57
 
package/index.js CHANGED
@@ -23,33 +23,33 @@ const ErrorCodes = new Proxy({
23
23
  }
24
24
  });
25
25
  class CatchableError extends Error {
26
- _code;
27
- constructor(_code, message) {
26
+ code;
27
+ constructor(code, message) {
28
28
  super(message);
29
- this._code = _code;
29
+ this.code = code;
30
30
  }
31
31
  getCode() {
32
- return this._code;
32
+ return this.code;
33
33
  }
34
34
  }
35
35
  class UncatchableError extends Error {
36
- _code;
37
- constructor(_code, message) {
36
+ code;
37
+ constructor(code, message) {
38
38
  super(message);
39
- this._code = _code;
39
+ this.code = code;
40
40
  }
41
41
  getCode() {
42
- return this._code;
42
+ return this.code;
43
43
  }
44
44
  }
45
45
  class ExposedUncatchableError extends UncatchableError {
46
- _status;
46
+ status;
47
47
  constructor(status, code, message) {
48
48
  super(code, message);
49
- this._status = status;
49
+ this.status = status;
50
50
  }
51
51
  getStatus() {
52
- return this._status;
52
+ return this.status;
53
53
  }
54
54
  }
55
55
 
@@ -7,17 +7,17 @@ export declare const ERR_DUPLICATED_ERROR_CODE: O23ReservedErrorCode;
7
7
  export declare const ERR_UNKNOWN: O23ReservedErrorCode;
8
8
  export declare const ErrorCodes: Record<string, O23ErrorCode>;
9
9
  export declare class CatchableError extends Error {
10
- private readonly _code;
11
- constructor(_code: string, message: string);
10
+ private readonly code;
11
+ constructor(code: string, message: string);
12
12
  getCode(): string;
13
13
  }
14
14
  export declare class UncatchableError extends Error {
15
- private readonly _code;
16
- constructor(_code: string, message: string);
15
+ private readonly code;
16
+ constructor(code: string, message: string);
17
17
  getCode(): string;
18
18
  }
19
19
  export declare class ExposedUncatchableError extends UncatchableError {
20
- private readonly _status;
20
+ private readonly status;
21
21
  constructor(status: number, code: string, message: string);
22
22
  getStatus(): number;
23
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rainbow-o23/n1",
3
- "version": "1.0.54",
3
+ "version": "1.0.56",
4
4
  "description": "o23 interfaces",
5
5
  "main": "index.cjs",
6
6
  "module": "index.js",
@@ -25,7 +25,7 @@
25
25
  "dayjs": "^1.11.13",
26
26
  "decimal.js": "^10.4.3",
27
27
  "mathjs": "^13.2.1",
28
- "nanoid": "3.3.7"
28
+ "nanoid": "3.3.8"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@babel/core": "^7.23.9",
@@ -24,34 +24,31 @@ export const ErrorCodes: Record<string, O23ErrorCode> = new Proxy({
24
24
  });
25
25
 
26
26
  export class CatchableError extends Error {
27
- public constructor(private readonly _code: string, message: string) {
27
+ public constructor(private readonly code: string, message: string) {
28
28
  super(message);
29
29
  }
30
30
 
31
31
  public getCode(): string {
32
- return this._code;
32
+ return this.code;
33
33
  }
34
34
  }
35
35
 
36
36
  export class UncatchableError extends Error {
37
- public constructor(private readonly _code: string, message: string) {
37
+ public constructor(private readonly code: string, message: string) {
38
38
  super(message);
39
39
  }
40
40
 
41
41
  public getCode(): string {
42
- return this._code;
42
+ return this.code;
43
43
  }
44
44
  }
45
45
 
46
46
  export class ExposedUncatchableError extends UncatchableError {
47
- private readonly _status: number;
48
-
49
- public constructor(status: number, code: string, message: string) {
47
+ public constructor(private readonly status: number, code: string, message: string) {
50
48
  super(code, message);
51
- this._status = status;
52
49
  }
53
50
 
54
51
  public getStatus(): number {
55
- return this._status;
52
+ return this.status;
56
53
  }
57
54
  }