@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 +2 -0
- package/lib/helpers/index.d.ts +3 -0
- package/lib/helpers/index.js +21 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/interfaces/resource.object.js +3 -3
- package/package.json +1 -1
package/fixEOL.sh
CHANGED
|
@@ -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
package/lib/index.js
CHANGED
|
@@ -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
|
-
|
|
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();
|