@xrystal/core 3.24.5 → 3.24.6

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,7 +1,7 @@
1
1
  {
2
2
  "author": "Yusuf Yasir KAYGUSUZ",
3
3
  "name": "@xrystal/core",
4
- "version": "3.24.5",
4
+ "version": "3.24.6",
5
5
  "description": "Project core for xrystal",
6
6
  "publishConfig": {
7
7
  "access": "public",
@@ -13,5 +13,5 @@ export declare class ResponseSchema {
13
13
  code: number;
14
14
  validData(): any;
15
15
  statusCodeGenerator(): number;
16
- get getResponse(): ResponseSchema;
16
+ get getResponse(): any;
17
17
  }
@@ -10,25 +10,25 @@ export class ResponseSchema {
10
10
  payload;
11
11
  code;
12
12
  validData() {
13
- return this.payload; // => ileride burada değiştirmeler olabilir.
13
+ return this.payload;
14
14
  }
15
15
  statusCodeGenerator() {
16
- if (this.status === false && this.code === 401 || this.code === 403) {
16
+ if (this.status === false && (this.code === 401 || this.code === 403)) {
17
17
  return Number(this.code);
18
18
  }
19
19
  else if (this.status === true) {
20
- return this.code = 0;
20
+ return 0;
21
21
  }
22
22
  else {
23
- return this.code = 1;
23
+ return 1;
24
24
  }
25
25
  }
26
26
  get getResponse() {
27
27
  let response = {
28
28
  status: this.status,
29
- message: this.message,
29
+ message: this.message
30
30
  };
31
- if (this.payload !== null) {
31
+ if (this.payload !== null && this.payload !== undefined) {
32
32
  response.payload = this.validData();
33
33
  }
34
34
  response.code = this.statusCodeGenerator();