@apigames/sdk-core 22.1.2 → 22.1.3

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/fixEOL.sh CHANGED
@@ -1,3 +1,5 @@
1
+ #!/bin/bash
2
+
1
3
  find src -name "*.js" -type f -exec dos2unix {} \;
2
4
  find src -name "*.jsx" -type f -exec dos2unix {} \;
3
5
  find src -name "*.ts" -type f -exec dos2unix {} \;
@@ -0,0 +1,3 @@
1
+ import { GeospatialPoint } from '../interfaces';
2
+ export declare function LoadDateTime(value: string): Date;
3
+ export declare function LoadGeospatialPoint(value: any): GeospatialPoint;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoadGeospatialPoint = exports.LoadDateTime = void 0;
4
+ const json_1 = require("@apigames/json");
5
+ const interfaces_1 = require("../interfaces");
6
+ function LoadDateTime(value) {
7
+ if ((0, json_1.isDefined)(value))
8
+ return new Date(value);
9
+ return undefined;
10
+ }
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();
16
+ geospatialPoint.LoadData(value);
17
+ return geospatialPoint;
18
+ }
19
+ return undefined;
20
+ }
21
+ exports.LoadGeospatialPoint = LoadGeospatialPoint;
package/lib/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './interfaces';
2
2
  export * from './exceptions';
3
3
  export * from './classes';
4
+ export * from './helpers';
package/lib/index.js CHANGED
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./interfaces"), exports);
18
18
  __exportStar(require("./exceptions"), exports);
19
19
  __exportStar(require("./classes"), exports);
20
+ __exportStar(require("./helpers"), exports);
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ResourceObjectRelationshipBase = exports.GeospatialPoint = exports.ResourceObjectAttributeBase = void 0;
4
4
  const json_1 = require("@apigames/json");
5
+ const helpers_1 = require("../helpers");
5
6
  class ResourceObjectAttributeBase {
6
7
  static LoadDateTime(value) {
7
- if ((0, json_1.isDefined)(value))
8
- return new Date(value);
9
- return undefined;
8
+ return (0, helpers_1.LoadDateTime)(value);
10
9
  }
11
10
  static LoadGeospatialPoint(value) {
11
+ return (0, helpers_1.LoadGeospatialPoint)(value);
12
12
  if ((0, json_1.isDefined)(value) && (0, json_1.hasProperty)(value, 'longitude') && (0, json_1.isNumber)(value.longitude)
13
13
  && (0, json_1.hasProperty)(value, 'latitude') && (0, json_1.isNumber)(value.latitude)) {
14
14
  const geospatialPoint = new 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.2",
16
+ "version": "22.1.3",
17
17
  "main": "lib/index.js",
18
18
  "types": "lib/index.d.ts",
19
19
  "scripts": {