@apigames/sdk-core 22.1.22 → 22.1.25

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.
@@ -1,3 +1,3 @@
1
1
  import { GeospatialPoint } from '../interfaces';
2
2
  export declare function LoadDateTime(value: string): Date;
3
- export declare function LoadGeospatialPoint(value: any): GeospatialPoint;
3
+ export declare function LoadGeospatialPoint(geospatialPoint: GeospatialPoint, value: any): GeospatialPoint;
@@ -9,10 +9,19 @@ function LoadDateTime(value) {
9
9
  return undefined;
10
10
  }
11
11
  exports.LoadDateTime = LoadDateTime;
12
- function LoadGeospatialPoint(value) {
13
- if ((0, json_1.isDefined)(value) && (0, json_1.hasProperty)(value, 'longitude') && (0, json_1.isNumber)(value.longitude)
14
- && (0, json_1.hasProperty)(value, 'latitude') && (0, json_1.isNumber)(value.latitude)) {
15
- const geospatialPoint = new interfaces_1.GeospatialPoint();
12
+ function LoadGeospatialPoint(geospatialPoint, value) {
13
+ if ((0, json_1.isUndefinedOrNull)(geospatialPoint)) {
14
+ if ((0, json_1.isDefined)(value) && (0, json_1.isObject)(value) && (Object.keys(value).length === 2)
15
+ && (0, json_1.hasProperty)(value, 'longitude') && (0, json_1.isNumber)(value.longitude)
16
+ && (0, json_1.hasProperty)(value, 'latitude') && (0, json_1.isNumber)(value.latitude)) {
17
+ const result = new interfaces_1.GeospatialPoint();
18
+ result.LoadData(value);
19
+ return result;
20
+ }
21
+ }
22
+ else if ((0, json_1.isDefined)(value) && (0, json_1.isObject)(value) && (Object.keys(value).length <= 2)
23
+ && (((0, json_1.hasProperty)(value, 'longitude') && (0, json_1.isNumber)(value.longitude))
24
+ || ((0, json_1.hasProperty)(value, 'latitude') && (0, json_1.isNumber)(value.latitude)))) {
16
25
  geospatialPoint.LoadData(value);
17
26
  return geospatialPoint;
18
27
  }
@@ -43,7 +43,7 @@ export interface IResourceObjectRelationships {
43
43
  export declare type ResourceObjectUri = string;
44
44
  export declare class ResourceObjectAttributeBase {
45
45
  protected static LoadDateTime(value: string): Date;
46
- protected static LoadGeospatialPoint(value: any): GeospatialPoint;
46
+ protected static LoadGeospatialPoint(geospatialPoint: GeospatialPoint, value: any): GeospatialPoint;
47
47
  }
48
48
  export declare class GeospatialPoint extends ResourceObjectAttributeBase implements IResourceObjectAttributes {
49
49
  longitude: number;
@@ -32,15 +32,17 @@ class ResourceObjectAttributeBase {
32
32
  static LoadDateTime(value) {
33
33
  return (0, helpers_1.LoadDateTime)(value);
34
34
  }
35
- static LoadGeospatialPoint(value) {
36
- return (0, helpers_1.LoadGeospatialPoint)(value);
35
+ static LoadGeospatialPoint(geospatialPoint, value) {
36
+ return (0, helpers_1.LoadGeospatialPoint)(geospatialPoint, value);
37
37
  }
38
38
  }
39
39
  exports.ResourceObjectAttributeBase = ResourceObjectAttributeBase;
40
40
  class GeospatialPoint extends ResourceObjectAttributeBase {
41
41
  LoadData(data) {
42
- this.longitude = data.longitude;
43
- this.latitude = data.latitude;
42
+ if ((0, json_1.hasProperty)(data, 'longitude'))
43
+ this.longitude = data.longitude;
44
+ if ((0, json_1.hasProperty)(data, 'latitude'))
45
+ this.latitude = data.latitude;
44
46
  }
45
47
  }
46
48
  exports.GeospatialPoint = GeospatialPoint;
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "description": "API Games SDK Core",
15
15
  "license": "MIT",
16
- "version": "22.1.22",
16
+ "version": "22.1.25",
17
17
  "main": "lib/index.js",
18
18
  "types": "lib/index.d.ts",
19
19
  "scripts": {
@@ -33,26 +33,26 @@
33
33
  "test:watch": "jest --watch"
34
34
  },
35
35
  "dependencies": {
36
- "@apigames/json": "22.1.3",
37
- "@apigames/rest-client": "22.1.4",
36
+ "@apigames/json": "22.1.5",
37
+ "@apigames/rest-client": "22.1.6",
38
38
  "object-hash": "2.2.0"
39
39
  },
40
40
  "devDependencies": {
41
- "date-and-time": "^2.3.0",
41
+ "date-and-time": "^2.3.1",
42
42
  "@types/date-and-time": "^0.13.0",
43
- "@types/jest": "27.4.1",
44
- "@types/node": "14.18.12",
45
- "@typescript-eslint/eslint-plugin": "5.18.0",
46
- "@typescript-eslint/parser": "5.18.0",
47
- "eslint": "8.12.0",
43
+ "@types/jest": "27.5.1",
44
+ "@types/node": "14.18.18",
45
+ "@typescript-eslint/eslint-plugin": "5.26.0",
46
+ "@typescript-eslint/parser": "5.26.0",
47
+ "eslint": "8.16.0",
48
48
  "eslint-config-airbnb": "19.0.4",
49
49
  "eslint-plugin-import": "2.26.0",
50
50
  "eslint-plugin-jsx-a11y": "6.5.1",
51
- "eslint-plugin-react": "7.29.4",
52
- "eslint-plugin-react-hooks": "4.4.0",
51
+ "eslint-plugin-react": "7.30.0",
52
+ "eslint-plugin-react-hooks": "4.5.0",
53
53
  "jest": "27.5.1",
54
- "ts-jest": "27.1.4",
55
- "typescript": "4.6.3"
54
+ "ts-jest": "27.1.5",
55
+ "typescript": "4.7.2"
56
56
  },
57
57
  "eslintConfig": {},
58
58
  "repository": {