@futdevpro/fsm-dynamo 1.5.49 → 1.5.50
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 +1 -1
- package/src/_models/control-models/dynamo-error.ts +1 -1
- package/lib/_collections/_constants/country-codes-ISO-3166.json +0 -3239
- package/lib/_collections/_constants/country-divisions-ISO-3166-all-list.json +0 -19036
- package/lib/_collections/_constants/country-iso.d.ts +0 -67
- package/lib/_collections/_constants/country-iso.d.ts.map +0 -1
- package/lib/_collections/_constants/country-iso.js +0 -47
- package/lib/_collections/_constants/country-iso.js.map +0 -1
- package/lib/_collections/_constants/country-phone-code.d.ts +0 -6
- package/lib/_collections/_constants/country-phone-code.d.ts.map +0 -1
- package/lib/_collections/_constants/country-phone-code.js +0 -3
- package/lib/_collections/_constants/country-phone-code.js.map +0 -1
- package/lib/_collections/_constants/country-phone-codes.json +0 -1202
- package/lib/_collections/_constants/country-sub-divisions-ISO-3166.json +0 -4994
- package/lib/_collections/_tools/dynamo-location.d.ts +0 -6
- package/lib/_collections/_tools/dynamo-location.d.ts.map +0 -1
- package/lib/_collections/_tools/dynamo-location.js +0 -40
- package/lib/_collections/_tools/dynamo-location.js.map +0 -1
- package/lib/_collections/_tools/dynamo-log.d.ts +0 -31
- package/lib/_collections/_tools/dynamo-log.d.ts.map +0 -1
- package/lib/_collections/_tools/dynamo-log.js +0 -95
- package/lib/_collections/_tools/dynamo-log.js.map +0 -1
- package/lib/_collections/_tools/dynamo-random.d.ts +0 -8
- package/lib/_collections/_tools/dynamo-random.d.ts.map +0 -1
- package/lib/_collections/_tools/dynamo-random.js +0 -60
- package/lib/_collections/_tools/dynamo-random.js.map +0 -1
- package/lib/_collections/_tools/dynamo-regions.d.ts +0 -16
- package/lib/_collections/_tools/dynamo-regions.d.ts.map +0 -1
- package/lib/_collections/_tools/dynamo-regions.js +0 -68
- package/lib/_collections/_tools/dynamo-regions.js.map +0 -1
- package/lib/_collections/_tools/dynamo-round-list.d.ts +0 -8
- package/lib/_collections/_tools/dynamo-round-list.d.ts.map +0 -1
- package/lib/_collections/_tools/dynamo-round-list.js +0 -39
- package/lib/_collections/_tools/dynamo-round-list.js.map +0 -1
- package/lib/_collections/_tools/dynamo-shared.service.d.ts +0 -73
- package/lib/_collections/_tools/dynamo-shared.service.d.ts.map +0 -1
- package/lib/_collections/_tools/dynamo-shared.service.js +0 -151
- package/lib/_collections/_tools/dynamo-shared.service.js.map +0 -1
- package/lib/_collections/_tools/dynamo-time.d.ts +0 -12
- package/lib/_collections/_tools/dynamo-time.d.ts.map +0 -1
- package/lib/_collections/_tools/dynamo-time.js +0 -41
- package/lib/_collections/_tools/dynamo-time.js.map +0 -1
- package/lib/_collections/_tools/dynamo-trigonometry.d.ts +0 -43
- package/lib/_collections/_tools/dynamo-trigonometry.d.ts.map +0 -1
- package/lib/_collections/_tools/dynamo-trigonometry.js +0 -62
- package/lib/_collections/_tools/dynamo-trigonometry.js.map +0 -1
- package/lib/_collections/_tools/location.d.ts +0 -6
- package/lib/_collections/_tools/location.d.ts.map +0 -1
- package/lib/_collections/_tools/location.js +0 -40
- package/lib/_collections/_tools/location.js.map +0 -1
- package/lib/_collections/_tools/log.d.ts +0 -10
- package/lib/_collections/_tools/log.d.ts.map +0 -1
- package/lib/_collections/_tools/log.js +0 -53
- package/lib/_collections/_tools/log.js.map +0 -1
- package/lib/_collections/_tools/random.d.ts +0 -8
- package/lib/_collections/_tools/random.d.ts.map +0 -1
- package/lib/_collections/_tools/random.js +0 -60
- package/lib/_collections/_tools/random.js.map +0 -1
- package/lib/_collections/_tools/region-translator.d.ts +0 -12
- package/lib/_collections/_tools/region-translator.d.ts.map +0 -1
- package/lib/_collections/_tools/region-translator.js +0 -48
- package/lib/_collections/_tools/region-translator.js.map +0 -1
- package/lib/_collections/_tools/round-list.d.ts +0 -8
- package/lib/_collections/_tools/round-list.d.ts.map +0 -1
- package/lib/_collections/_tools/round-list.js +0 -39
- package/lib/_collections/_tools/round-list.js.map +0 -1
- package/lib/_collections/_tools/time.d.ts +0 -12
- package/lib/_collections/_tools/time.d.ts.map +0 -1
- package/lib/_collections/_tools/time.js +0 -41
- package/lib/_collections/_tools/time.js.map +0 -1
- package/lib/_collections/_tools/trigonometry.d.ts +0 -43
- package/lib/_collections/_tools/trigonometry.d.ts.map +0 -1
- package/lib/_collections/_tools/trigonometry.js +0 -62
- package/lib/_collections/_tools/trigonometry.js.map +0 -1
- package/lib/_collections/_tools/utilities.d.ts +0 -32
- package/lib/_collections/_tools/utilities.d.ts.map +0 -1
- package/lib/_collections/_tools/utilities.js +0 -71
- package/lib/_collections/_tools/utilities.js.map +0 -1
- package/lib/_collections/_tools/vector.d.ts +0 -38
- package/lib/_collections/_tools/vector.d.ts.map +0 -1
- package/lib/_collections/_tools/vector.js +0 -107
- package/lib/_collections/_tools/vector.js.map +0 -1
- package/lib/_collections/dynamo-shared.service.d.ts +0 -87
- package/lib/_collections/dynamo-shared.service.d.ts.map +0 -1
- package/lib/_collections/dynamo-shared.service.js +0 -261
- package/lib/_collections/dynamo-shared.service.js.map +0 -1
- package/lib/_collections/index.d.ts +0 -11
- package/lib/_collections/index.d.ts.map +0 -1
- package/lib/_collections/index.js +0 -15
- package/lib/_collections/index.js.map +0 -1
- package/lib/_constants/index.d.ts +0 -5
- package/lib/_constants/index.d.ts.map +0 -1
- package/lib/_constants/index.js +0 -10
- package/lib/_constants/index.js.map +0 -1
- package/lib/_constants/module-settings/custom-data-module-settings.d.ts +0 -3
- package/lib/_constants/module-settings/custom-data-module-settings.d.ts.map +0 -1
- package/lib/_constants/module-settings/custom-data-module-settings.js +0 -11
- package/lib/_constants/module-settings/custom-data-module-settings.js.map +0 -1
- package/lib/_constants/module-settings/test-module-settings.d.ts +0 -3
- package/lib/_constants/module-settings/test-module-settings.d.ts.map +0 -1
- package/lib/_constants/module-settings/test-module-settings.js +0 -15
- package/lib/_constants/module-settings/test-module-settings.js.map +0 -1
- package/lib/_constants/module-settings/usage-module-settings.d.ts +0 -3
- package/lib/_constants/module-settings/usage-module-settings.d.ts.map +0 -1
- package/lib/_constants/module-settings/usage-module-settings.js +0 -13
- package/lib/_constants/module-settings/usage-module-settings.js.map +0 -1
- package/lib/_constants/times.d.ts +0 -8
- package/lib/_constants/times.d.ts.map +0 -1
- package/lib/_constants/times.js +0 -11
- package/lib/_constants/times.js.map +0 -1
- package/lib/_enums/basic-property-type.enum.d.ts +0 -8
- package/lib/_enums/basic-property-type.enum.d.ts.map +0 -1
- package/lib/_enums/basic-property-type.enum.js +0 -12
- package/lib/_enums/basic-property-type.enum.js.map +0 -1
- package/lib/_enums/data-model-type.enum.d.ts +0 -6
- package/lib/_enums/data-model-type.enum.d.ts.map +0 -1
- package/lib/_enums/data-model-type.enum.js +0 -10
- package/lib/_enums/data-model-type.enum.js.map +0 -1
- package/lib/_enums/index.d.ts +0 -3
- package/lib/_enums/index.d.ts.map +0 -1
- package/lib/_enums/index.js +0 -7
- package/lib/_enums/index.js.map +0 -1
- package/lib/_enums/log-style.enum.d.ts +0 -26
- package/lib/_enums/log-style.enum.d.ts.map +0 -1
- package/lib/_enums/log-style.enum.js +0 -30
- package/lib/_enums/log-style.enum.js.map +0 -1
- package/lib/_enums/region.enum.d.ts +0 -8
- package/lib/_enums/region.enum.d.ts.map +0 -1
- package/lib/_enums/region.enum.js +0 -12
- package/lib/_enums/region.enum.js.map +0 -1
- package/lib/_enums/sub-region.enum.d.ts +0 -20
- package/lib/_enums/sub-region.enum.d.ts.map +0 -1
- package/lib/_enums/sub-region.enum.js +0 -24
- package/lib/_enums/sub-region.enum.js.map +0 -1
- package/lib/_models/control-models/country-division.d.ts +0 -6
- package/lib/_models/control-models/country-division.d.ts.map +0 -1
- package/lib/_models/control-models/country-division.js +0 -3
- package/lib/_models/control-models/country-division.js.map +0 -1
- package/lib/_models/control-models/country-iso.d.ts +0 -19
- package/lib/_models/control-models/country-iso.d.ts.map +0 -1
- package/lib/_models/control-models/country-iso.js +0 -3
- package/lib/_models/control-models/country-iso.js.map +0 -1
- package/lib/_models/control-models/country-phone-code.d.ts +0 -6
- package/lib/_models/control-models/country-phone-code.d.ts.map +0 -1
- package/lib/_models/control-models/country-phone-code.js +0 -3
- package/lib/_models/control-models/country-phone-code.js.map +0 -1
- package/lib/_models/control-models/daily-usage-data.d.ts +0 -18
- package/lib/_models/control-models/daily-usage-data.d.ts.map +0 -1
- package/lib/_models/control-models/daily-usage-data.js +0 -22
- package/lib/_models/control-models/daily-usage-data.js.map +0 -1
- package/lib/_models/control-models/division-collection.d.ts +0 -9
- package/lib/_models/control-models/division-collection.d.ts.map +0 -1
- package/lib/_models/control-models/division-collection.js +0 -3
- package/lib/_models/control-models/division-collection.js.map +0 -1
- package/lib/_models/control-models/division-region-data.d.ts +0 -45
- package/lib/_models/control-models/division-region-data.d.ts.map +0 -1
- package/lib/_models/control-models/division-region-data.js +0 -46
- package/lib/_models/control-models/division-region-data.js.map +0 -1
- package/lib/_models/control-models/dynamo-daily-usage-data.d.ts +0 -18
- package/lib/_models/control-models/dynamo-daily-usage-data.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-daily-usage-data.js +0 -24
- package/lib/_models/control-models/dynamo-daily-usage-data.js.map +0 -1
- package/lib/_models/control-models/dynamo-data-params.d.ts +0 -17
- package/lib/_models/control-models/dynamo-data-params.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-data-params.js +0 -24
- package/lib/_models/control-models/dynamo-data-params.js.map +0 -1
- package/lib/_models/control-models/dynamo-data-property-params.d.ts +0 -46
- package/lib/_models/control-models/dynamo-data-property-params.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-data-property-params.js +0 -62
- package/lib/_models/control-models/dynamo-data-property-params.js.map +0 -1
- package/lib/_models/control-models/dynamo-error.d.ts +0 -263
- package/lib/_models/control-models/dynamo-error.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-error.js +0 -114
- package/lib/_models/control-models/dynamo-error.js.map +0 -1
- package/lib/_models/control-models/dynamo-module-settings.d.ts +0 -7
- package/lib/_models/control-models/dynamo-module-settings.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-module-settings.js +0 -3
- package/lib/_models/control-models/dynamo-module-settings.js.map +0 -1
- package/lib/_models/control-models/dynamo-nts-data-params.d.ts +0 -14
- package/lib/_models/control-models/dynamo-nts-data-params.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-nts-data-params.js +0 -19
- package/lib/_models/control-models/dynamo-nts-data-params.js.map +0 -1
- package/lib/_models/control-models/dynamo-nts-data-property-params.d.ts +0 -45
- package/lib/_models/control-models/dynamo-nts-data-property-params.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-nts-data-property-params.js +0 -61
- package/lib/_models/control-models/dynamo-nts-data-property-params.js.map +0 -1
- package/lib/_models/control-models/dynamo-nts-error.d.ts +0 -19
- package/lib/_models/control-models/dynamo-nts-error.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-nts-error.js +0 -190
- package/lib/_models/control-models/dynamo-nts-error.js.map +0 -1
- package/lib/_models/control-models/dynamo-nts-module-settings.d.ts +0 -7
- package/lib/_models/control-models/dynamo-nts-module-settings.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-nts-module-settings.js +0 -3
- package/lib/_models/control-models/dynamo-nts-module-settings.js.map +0 -1
- package/lib/_models/control-models/dynamo-poll.d.ts +0 -31
- package/lib/_models/control-models/dynamo-poll.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-poll.js +0 -90
- package/lib/_models/control-models/dynamo-poll.js.map +0 -1
- package/lib/_models/control-models/dynamo-range-value.d.ts +0 -6
- package/lib/_models/control-models/dynamo-range-value.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-range-value.js +0 -11
- package/lib/_models/control-models/dynamo-range-value.js.map +0 -1
- package/lib/_models/control-models/dynamo-route-settings.d.ts +0 -7
- package/lib/_models/control-models/dynamo-route-settings.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-route-settings.js +0 -3
- package/lib/_models/control-models/dynamo-route-settings.js.map +0 -1
- package/lib/_models/control-models/dynamo-usage-action.d.ts +0 -9
- package/lib/_models/control-models/dynamo-usage-action.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-usage-action.js +0 -14
- package/lib/_models/control-models/dynamo-usage-action.js.map +0 -1
- package/lib/_models/control-models/dynamo-usage-data.d.ts +0 -14
- package/lib/_models/control-models/dynamo-usage-data.d.ts.map +0 -1
- package/lib/_models/control-models/dynamo-usage-data.js +0 -17
- package/lib/_models/control-models/dynamo-usage-data.js.map +0 -1
- package/lib/_models/control-models/dynamobe-data-params.d.ts +0 -14
- package/lib/_models/control-models/dynamobe-data-params.d.ts.map +0 -1
- package/lib/_models/control-models/dynamobe-data-params.js +0 -19
- package/lib/_models/control-models/dynamobe-data-params.js.map +0 -1
- package/lib/_models/control-models/dynamobe-data-property-params.d.ts +0 -28
- package/lib/_models/control-models/dynamobe-data-property-params.d.ts.map +0 -1
- package/lib/_models/control-models/dynamobe-data-property-params.js +0 -57
- package/lib/_models/control-models/dynamobe-data-property-params.js.map +0 -1
- package/lib/_models/control-models/dynamobe-error.d.ts +0 -19
- package/lib/_models/control-models/dynamobe-error.d.ts.map +0 -1
- package/lib/_models/control-models/dynamobe-error.js +0 -188
- package/lib/_models/control-models/dynamobe-error.js.map +0 -1
- package/lib/_models/control-models/geo-ip-location.d.ts +0 -26
- package/lib/_models/control-models/geo-ip-location.d.ts.map +0 -1
- package/lib/_models/control-models/geo-ip-location.js +0 -3
- package/lib/_models/control-models/geo-ip-location.js.map +0 -1
- package/lib/_models/control-models/location-coordinates.d.ts +0 -5
- package/lib/_models/control-models/location-coordinates.d.ts.map +0 -1
- package/lib/_models/control-models/location-coordinates.js +0 -3
- package/lib/_models/control-models/location-coordinates.js.map +0 -1
- package/lib/_models/control-models/random-weight.d.ts +0 -5
- package/lib/_models/control-models/random-weight.d.ts.map +0 -1
- package/lib/_models/control-models/random-weight.js +0 -3
- package/lib/_models/control-models/random-weight.js.map +0 -1
- package/lib/_models/control-models/subdivision-collection.d.ts +0 -9
- package/lib/_models/control-models/subdivision-collection.d.ts.map +0 -1
- package/lib/_models/control-models/subdivision-collection.js +0 -3
- package/lib/_models/control-models/subdivision-collection.js.map +0 -1
- package/lib/_models/control-models/subdivision-region-data.d.ts +0 -45
- package/lib/_models/control-models/subdivision-region-data.d.ts.map +0 -1
- package/lib/_models/control-models/subdivision-region-data.js +0 -46
- package/lib/_models/control-models/subdivision-region-data.js.map +0 -1
- package/lib/_models/control-models/usage-action.d.ts +0 -9
- package/lib/_models/control-models/usage-action.d.ts.map +0 -1
- package/lib/_models/control-models/usage-action.js +0 -13
- package/lib/_models/control-models/usage-action.js.map +0 -1
- package/lib/_models/control-models/usage-data.d.ts +0 -14
- package/lib/_models/control-models/usage-data.d.ts.map +0 -1
- package/lib/_models/control-models/usage-data.js +0 -16
- package/lib/_models/control-models/usage-data.js.map +0 -1
- package/lib/_models/data-models/custom-data.d.ts +0 -16
- package/lib/_models/data-models/custom-data.d.ts.map +0 -1
- package/lib/_models/data-models/custom-data.js +0 -28
- package/lib/_models/data-models/custom-data.js.map +0 -1
- package/lib/_models/data-models/dynamo-custom-data.d.ts +0 -16
- package/lib/_models/data-models/dynamo-custom-data.d.ts.map +0 -1
- package/lib/_models/data-models/dynamo-custom-data.js +0 -29
- package/lib/_models/data-models/dynamo-custom-data.js.map +0 -1
- package/lib/_models/data-models/dynamo-metadata.d.ts +0 -17
- package/lib/_models/data-models/dynamo-metadata.d.ts.map +0 -1
- package/lib/_models/data-models/dynamo-metadata.js +0 -20
- package/lib/_models/data-models/dynamo-metadata.js.map +0 -1
- package/lib/_models/data-models/dynamo-usage-session.d.ts +0 -34
- package/lib/_models/data-models/dynamo-usage-session.d.ts.map +0 -1
- package/lib/_models/data-models/dynamo-usage-session.js +0 -46
- package/lib/_models/data-models/dynamo-usage-session.js.map +0 -1
- package/lib/_models/data-models/metadata.d.ts +0 -17
- package/lib/_models/data-models/metadata.d.ts.map +0 -1
- package/lib/_models/data-models/metadata.js +0 -17
- package/lib/_models/data-models/metadata.js.map +0 -1
- package/lib/_models/data-models/usage-session.d.ts +0 -34
- package/lib/_models/data-models/usage-session.d.ts.map +0 -1
- package/lib/_models/data-models/usage-session.js +0 -53
- package/lib/_models/data-models/usage-session.js.map +0 -1
- package/lib/_models/index.d.ts +0 -20
- package/lib/_models/index.d.ts.map +0 -1
- package/lib/_models/index.js +0 -26
- package/lib/_models/index.js.map +0 -1
- package/lib/_modules/custom-data-module.index.d.ts +0 -3
- package/lib/_modules/custom-data-module.index.d.ts.map +0 -1
- package/lib/_modules/custom-data-module.index.js +0 -7
- package/lib/_modules/custom-data-module.index.js.map +0 -1
- package/lib/_modules/data-models.index.d.ts +0 -3
- package/lib/_modules/data-models.index.d.ts.map +0 -1
- package/lib/_modules/data-models.index.js +0 -7
- package/lib/_modules/data-models.index.js.map +0 -1
- package/lib/_modules/data-module.index.d.ts +0 -5
- package/lib/_modules/data-module.index.d.ts.map +0 -1
- package/lib/_modules/data-module.index.js +0 -9
- package/lib/_modules/data-module.index.js.map +0 -1
- package/lib/_modules/data-modules.index.d.ts +0 -6
- package/lib/_modules/data-modules.index.d.ts.map +0 -1
- package/lib/_modules/data-modules.index.js +0 -10
- package/lib/_modules/data-modules.index.js.map +0 -1
- package/lib/_modules/error-module.index.d.ts +0 -2
- package/lib/_modules/error-module.index.d.ts.map +0 -1
- package/lib/_modules/error-module.index.js +0 -6
- package/lib/_modules/error-module.index.js.map +0 -1
- package/lib/_modules/shared-service.index.d.ts +0 -8
- package/lib/_modules/shared-service.index.d.ts.map +0 -1
- package/lib/_modules/shared-service.index.js +0 -12
- package/lib/_modules/shared-service.index.js.map +0 -1
- package/lib/_modules/test-module.index.d.ts +0 -2
- package/lib/_modules/test-module.index.d.ts.map +0 -1
- package/lib/_modules/test-module.index.js +0 -6
- package/lib/_modules/test-module.index.js.map +0 -1
- package/lib/_modules/usage-module.index.d.ts +0 -6
- package/lib/_modules/usage-module.index.d.ts.map +0 -1
- package/lib/_modules/usage-module.index.js +0 -10
- package/lib/_modules/usage-module.index.js.map +0 -1
- package/lib/data-models.d.ts +0 -3
- package/lib/data-models.d.ts.map +0 -1
- package/lib/data-models.js +0 -7
- package/lib/data-models.js.map +0 -1
- package/lib/index.d.ts +0 -5
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -12
- package/lib/index.js.map +0 -1
- package/lib/tsconfig.tsbuildinfo +0 -3176
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Dynamo_Shared = void 0;
|
|
4
|
-
const utilities_1 = require("./utilities");
|
|
5
|
-
class Dynamo_Shared {
|
|
6
|
-
/**
|
|
7
|
-
* returns remapped object list by path list
|
|
8
|
-
* @param objList object list to map
|
|
9
|
-
* @param paths string list of path etc.:
|
|
10
|
-
* ```ts
|
|
11
|
-
* [ [ 'first', 'sub', 'label' ], [ 'first', 'dif', 'name' ] ]
|
|
12
|
-
* ```
|
|
13
|
-
* will be...
|
|
14
|
-
* from
|
|
15
|
-
* ```ts
|
|
16
|
-
* {
|
|
17
|
-
* first: {
|
|
18
|
-
* sub: {
|
|
19
|
-
* label: 'vlmi'
|
|
20
|
-
* },
|
|
21
|
-
* dif: {
|
|
22
|
-
* name: 'asd'
|
|
23
|
-
* }
|
|
24
|
-
* }
|
|
25
|
-
* }[]
|
|
26
|
-
* ```
|
|
27
|
-
* to
|
|
28
|
-
* ```
|
|
29
|
-
* { label: 'vlmi', name: 'asd' }[]
|
|
30
|
-
* ```
|
|
31
|
-
* @returns remapped object list (the final obj will use the deepest keys)
|
|
32
|
-
*/
|
|
33
|
-
static mapObjList(objList, paths) {
|
|
34
|
-
let newObjList = [...objList];
|
|
35
|
-
newObjList = newObjList.map(obj => {
|
|
36
|
-
const newObj = {};
|
|
37
|
-
paths.forEach((path) => {
|
|
38
|
-
newObj[path[path.length - 1]] = this.getNestedData(obj, path);
|
|
39
|
-
});
|
|
40
|
-
return newObj;
|
|
41
|
-
});
|
|
42
|
-
return newObjList;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* returns nested value from object
|
|
46
|
-
* @param parentObj data source object
|
|
47
|
-
* @param nestedDataKeys path of value as string list
|
|
48
|
-
* etc.: ['nestLvl1', 'nestLvl2', 'nestLvl3'] as parentObj.nestLvl1.nestLvl2.nestLvl3
|
|
49
|
-
* @returns data from object by path
|
|
50
|
-
*/
|
|
51
|
-
static getNestedData(parentObj, nestedDataKeys) {
|
|
52
|
-
let newData = utilities_1.clone(parentObj); // {...parentObj};
|
|
53
|
-
nestedDataKeys.forEach((dk) => {
|
|
54
|
-
if (newData) {
|
|
55
|
-
newData = newData[dk];
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return newData;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* recursive function that nests data
|
|
62
|
-
* @param newData the object that that is needed to be updated
|
|
63
|
-
* @param nestKeys the path where the data should be updated
|
|
64
|
-
* @param dataToSet the actual value that will be setted
|
|
65
|
-
* @returns modified data
|
|
66
|
-
*/
|
|
67
|
-
static nestData(parentObj, nestKeys, dataToSet) {
|
|
68
|
-
const newData = utilities_1.clone(parentObj); // {...parentObj};
|
|
69
|
-
if (nestKeys.length > 1) {
|
|
70
|
-
const keys = [...nestKeys];
|
|
71
|
-
const nextNestKey = keys.shift();
|
|
72
|
-
newData[nextNestKey] = this.nestData(newData[nextNestKey], keys, dataToSet);
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
newData[nestKeys[0]] = dataToSet;
|
|
76
|
-
}
|
|
77
|
-
return newData;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* recursive function that adds to nested data
|
|
81
|
-
* @param newData the object that that is needed to be updated
|
|
82
|
-
* @param nestKeys the path where the data should be updated
|
|
83
|
-
* @param dataToAdd the actual value that will be setted
|
|
84
|
-
* @returns modified data
|
|
85
|
-
*/
|
|
86
|
-
static addToNestedData(parentObj, nestKeys, dataToAdd) {
|
|
87
|
-
const newData = utilities_1.clone(parentObj); // {...parentObj};
|
|
88
|
-
if (nestKeys.length > 1) {
|
|
89
|
-
const keys = [...nestKeys];
|
|
90
|
-
const nextNestKey = keys.shift();
|
|
91
|
-
newData[nextNestKey] = this.addToNestedData(newData[nextNestKey], keys, dataToAdd);
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
newData[nestKeys[0]] += dataToAdd;
|
|
95
|
-
}
|
|
96
|
-
return newData;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* recursive function that pushes to nested data
|
|
100
|
-
* @param newData the object that that is needed to be updated
|
|
101
|
-
* @param nestKeys the path where the data should be updated
|
|
102
|
-
* @param dataToPush the actual value that will be setted
|
|
103
|
-
* @returns modified data
|
|
104
|
-
*/
|
|
105
|
-
static pushToNestedData(parentObj, nestKeys, dataToPush) {
|
|
106
|
-
const newData = utilities_1.clone(parentObj); // {...parentObj};
|
|
107
|
-
if (nestKeys.length > 1) {
|
|
108
|
-
const keys = [...nestKeys];
|
|
109
|
-
const nextNestKey = keys.shift();
|
|
110
|
-
newData[nextNestKey] = this.pushToNestedData(newData[nextNestKey], keys, dataToPush);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
if (Array.isArray(newData[nestKeys[0]])) {
|
|
114
|
-
newData[nestKeys[0]].push(dataToPush);
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
newData[nestKeys[0]] = [dataToPush];
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return newData;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* recursive function that nests data on recursive data structure etc.: xData: { ..., 'nestedListKey': xData[] }
|
|
124
|
-
* @param newData the object that that is needed to be updated
|
|
125
|
-
* @param nestedListKey the location of nested dataList
|
|
126
|
-
* @param nestIndexes path to the subject ect.: xData.listKey[1].listKey[4].listKey[0] will be [1, 4, 0]
|
|
127
|
-
* @param dataToSet the actual value that will be setted on location
|
|
128
|
-
* @returns modified data
|
|
129
|
-
*/
|
|
130
|
-
static nestRecursiveListedData(parentObj, nestedListKey, nestIndexes, dataToSet) {
|
|
131
|
-
const newData = utilities_1.clone(parentObj); // parentObj; // {...parentObj};
|
|
132
|
-
if (nestIndexes.length > 1) {
|
|
133
|
-
const indexes = [...nestIndexes];
|
|
134
|
-
const nextLevelKey = indexes.shift();
|
|
135
|
-
newData[nestedListKey][nextLevelKey] = this.nestRecursiveListedData(newData[nestedListKey][nextLevelKey], nestedListKey, indexes, dataToSet);
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
newData[nestedListKey][nestIndexes[0]] = dataToSet;
|
|
139
|
-
}
|
|
140
|
-
return newData;
|
|
141
|
-
}
|
|
142
|
-
static addMetadataToSchema(schema) {
|
|
143
|
-
schema.__created = { type: Date };
|
|
144
|
-
schema.__createdBy = { type: String };
|
|
145
|
-
schema.__lastModified = { type: Date };
|
|
146
|
-
schema.__lastModifiedBy = { type: String };
|
|
147
|
-
return schema;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
exports.Dynamo_Shared = Dynamo_Shared;
|
|
151
|
-
//# sourceMappingURL=dynamo-shared.service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamo-shared.service.js","sourceRoot":"","sources":["../../../src/_collections/_tools/dynamo-shared.service.ts"],"names":[],"mappings":";;;AACA,2CAAoC;AAEpC,MAAa,aAAa;IAExB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,MAAM,CAAC,UAAU,CAAC,OAAiB,EAAE,KAAiB;QACpD,IAAI,UAAU,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC;QAC9B,UAAU,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAChC,MAAM,MAAM,GAAG,EAAE,CAAC;YAClB,KAAK,CAAC,OAAO,CAAC,CAAC,IAAc,EAAE,EAAE;gBAC/B,MA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AI,SAAY,EAAE,aAAqB,EAAE,WAAqB,EAAE,SAAc;QAC1G,MAAM,OAAO,GAAG,iBAAK,CAAC,SAAS,CAAC,CAAC,CAAC,gCAAgC;QAClE,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;YAC1B,MAAM,OAAO,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC;YACjC,MAAM,YAAY,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;YACrC,OAAO,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,GAAG,IAAI,CAAC,uBAAuB,CAC/D,OAAO,CAAC,aAAa,CAAC,CAAC,YAAY,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;SAC9E;aAAM;YACL,OAAO,CAAC,aAAa,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;SACpD;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,mBAAmB,CAAC,MAAW;QACpC,MAAM,CAAC,SAAS,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAClC,MAAM,CAAC,WAAW,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACtC,MAAM,CAAC,cAAc,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QACvC,MAAM,CAAC,gBAAgB,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAC3C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAnJD,sCAmJC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class Dynamo_Time {
|
|
2
|
-
static getAge(birthDate: Date | number | string): number;
|
|
3
|
-
static getYear(date: Date | number | string): number;
|
|
4
|
-
static getHour(date: Date | number | string): number;
|
|
5
|
-
static getDateByAge(age: number): Date;
|
|
6
|
-
static oneHourAgo(): Date;
|
|
7
|
-
static oneDayAgo(): Date;
|
|
8
|
-
static oneWeekAgo(): Date;
|
|
9
|
-
static oneMonthAgo(): Date;
|
|
10
|
-
static oneYearAgo(): Date;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=dynamo-time.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamo-time.d.ts","sourceRoot":"","sources":["../../../src/_collections/_tools/dynamo-time.ts"],"names":[],"mappings":"AAGA,qBAAa,WAAW;IAEtB,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM;IAI/C,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM;IAO3C,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM;IAO3C,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM;IAI/B,MAAM,CAAC,UAAU,IAAI,IAAI;IAIzB,MAAM,CAAC,SAAS,IAAI,IAAI;IAIxB,MAAM,CAAC,UAAU,IAAI,IAAI;IAIzB,MAAM,CAAC,WAAW,IAAI,IAAI;IAI1B,MAAM,CAAC,UAAU,IAAI,IAAI;CAG1B"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Dynamo_Time = void 0;
|
|
4
|
-
const times_1 = require("../../_constants/times");
|
|
5
|
-
class Dynamo_Time {
|
|
6
|
-
static getAge(birthDate) {
|
|
7
|
-
return this.getYear(+new Date() - +new Date(birthDate));
|
|
8
|
-
}
|
|
9
|
-
static getYear(date) {
|
|
10
|
-
if (typeof date === 'string') {
|
|
11
|
-
date = new Date(date);
|
|
12
|
-
}
|
|
13
|
-
return (+date / times_1.year);
|
|
14
|
-
}
|
|
15
|
-
static getHour(date) {
|
|
16
|
-
if (typeof date === 'string') {
|
|
17
|
-
date = new Date(date);
|
|
18
|
-
}
|
|
19
|
-
return (+date / times_1.hour);
|
|
20
|
-
}
|
|
21
|
-
static getDateByAge(age) {
|
|
22
|
-
return new Date(+new Date() - (times_1.year * age));
|
|
23
|
-
}
|
|
24
|
-
static oneHourAgo() {
|
|
25
|
-
return new Date(+new Date() - times_1.hour);
|
|
26
|
-
}
|
|
27
|
-
static oneDayAgo() {
|
|
28
|
-
return new Date(+new Date() - times_1.day);
|
|
29
|
-
}
|
|
30
|
-
static oneWeekAgo() {
|
|
31
|
-
return new Date(+new Date() - times_1.week);
|
|
32
|
-
}
|
|
33
|
-
static oneMonthAgo() {
|
|
34
|
-
return new Date(+new Date() - times_1.month);
|
|
35
|
-
}
|
|
36
|
-
static oneYearAgo() {
|
|
37
|
-
return new Date(+new Date() - times_1.year);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.Dynamo_Time = Dynamo_Time;
|
|
41
|
-
//# sourceMappingURL=dynamo-time.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamo-time.js","sourceRoot":"","sources":["../../../src/_collections/_tools/dynamo-time.ts"],"names":[],"mappings":";;;AACA,kDAAsE;AAEtE,MAAa,WAAW;IAEtB,MAAM,CAAC,MAAM,CAAC,SAAiC;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,IAAI,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAC1D,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,IAA4B;QACzC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;SACvB;QACD,OAAO,CAAC,CAAC,IAAI,GAAI,YAAI,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,OAAO,CAAC,IAA4B;QACzC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;SACvB;QACD,OAAO,CAAC,CAAC,IAAI,GAAI,YAAI,CAAC,CAAC;IACzB,CAAC;IAED,MAAM,CAAC,YAAY,CAAC,GAAW;QAC7B,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,GAAG,CAAC,YAAI,GAAG,GAAG,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAC,UAAU;QACf,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,GAAG,YAAI,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,SAAS;QACd,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,GAAG,WAAG,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,UAAU;QACf,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,GAAG,YAAI,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,CAAC,WAAW;QAChB,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,GAAG,aAAK,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,UAAU;QACf,OAAO,IAAI,IAAI,CAAC,CAAC,IAAI,IAAI,EAAE,GAAG,YAAI,CAAC,CAAC;IACtC,CAAC;CACF;AA3CD,kCA2CC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export declare class Dynamo_Trigonometry {
|
|
2
|
-
/**
|
|
3
|
-
* Befogó
|
|
4
|
-
* a Befogó mérete az átfogó, és a befogóval szemközti szög alapján
|
|
5
|
-
* a szemközti szög értéke opcionális
|
|
6
|
-
* (amennyiben nem adjuk meg, 45 fokos szöggel számolunk)
|
|
7
|
-
* @param c átfogó
|
|
8
|
-
* @param angle a befogó oldallal szemközti szög (fokban)
|
|
9
|
-
* @returns befogó
|
|
10
|
-
*/
|
|
11
|
-
static getClamp(c: number, angle?: number): number;
|
|
12
|
-
/**
|
|
13
|
-
* Befogó
|
|
14
|
-
* a Befogó mérete az átfogó és a másik befogó alapján
|
|
15
|
-
* @param a befogó
|
|
16
|
-
* @param c átfogó
|
|
17
|
-
* @returns befogó
|
|
18
|
-
*/
|
|
19
|
-
static getClampByClampAndHypotenuse(a: number, c: number): number;
|
|
20
|
-
/**
|
|
21
|
-
* Átfogó
|
|
22
|
-
* az Átfogó mérete a befogók alapján
|
|
23
|
-
* a második befogó értéke opcionális
|
|
24
|
-
* (amennyiben nem adjuk meg, egyenlő szárú háromszöggel számolunk)
|
|
25
|
-
* @param a egyik befogó
|
|
26
|
-
* @param b másik befogó
|
|
27
|
-
* @returns átfogó
|
|
28
|
-
*/
|
|
29
|
-
static getHypotenuse(a: number, b?: number): number;
|
|
30
|
-
/**
|
|
31
|
-
* Szög fokmértéket átalakítja radiánsra
|
|
32
|
-
* @param angle szög fok
|
|
33
|
-
* @returns szög radiáns
|
|
34
|
-
*/
|
|
35
|
-
static angleToRadians(angle: number): number;
|
|
36
|
-
/**
|
|
37
|
-
* Szög radiáns mértéket átalakítja fokra
|
|
38
|
-
* @param radians szög radiáns
|
|
39
|
-
* @returns szög fok
|
|
40
|
-
*/
|
|
41
|
-
static radiansToAngle(radians: number): number;
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=dynamo-trigonometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamo-trigonometry.d.ts","sourceRoot":"","sources":["../../../src/_collections/_tools/dynamo-trigonometry.ts"],"names":[],"mappings":"AACA,qBAAa,mBAAmB;IAE9B;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;IAKlD;;;;;;OAMG;IACH,MAAM,CAAC,4BAA4B,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;IAOjE;;;;;;;;OAQG;IACH,MAAM,CAAC,aAAa,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAKnD;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI5C;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;CAG/C"}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Dynamo_Trigonometry = void 0;
|
|
4
|
-
class Dynamo_Trigonometry {
|
|
5
|
-
/**
|
|
6
|
-
* Befogó
|
|
7
|
-
* a Befogó mérete az átfogó, és a befogóval szemközti szög alapján
|
|
8
|
-
* a szemközti szög értéke opcionális
|
|
9
|
-
* (amennyiben nem adjuk meg, 45 fokos szöggel számolunk)
|
|
10
|
-
* @param c átfogó
|
|
11
|
-
* @param angle a befogó oldallal szemközti szög (fokban)
|
|
12
|
-
* @returns befogó
|
|
13
|
-
*/
|
|
14
|
-
static getClamp(c, angle) {
|
|
15
|
-
angle = angle !== undefined ? angle : 45;
|
|
16
|
-
return Math.sin(this.angleToRadians(angle)) * c;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Befogó
|
|
20
|
-
* a Befogó mérete az átfogó és a másik befogó alapján
|
|
21
|
-
* @param a befogó
|
|
22
|
-
* @param c átfogó
|
|
23
|
-
* @returns befogó
|
|
24
|
-
*/
|
|
25
|
-
static getClampByClampAndHypotenuse(a, c) {
|
|
26
|
-
if (a > c) {
|
|
27
|
-
throw { errorMessage: `getClampByClampAndHypotenuse error hypotenuse is smaller than clamp (a:${a} > c:${c})` };
|
|
28
|
-
}
|
|
29
|
-
return Math.sqrt((c * c) - (a * a));
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Átfogó
|
|
33
|
-
* az Átfogó mérete a befogók alapján
|
|
34
|
-
* a második befogó értéke opcionális
|
|
35
|
-
* (amennyiben nem adjuk meg, egyenlő szárú háromszöggel számolunk)
|
|
36
|
-
* @param a egyik befogó
|
|
37
|
-
* @param b másik befogó
|
|
38
|
-
* @returns átfogó
|
|
39
|
-
*/
|
|
40
|
-
static getHypotenuse(a, b) {
|
|
41
|
-
b = b !== undefined ? b : a;
|
|
42
|
-
return Math.sqrt((a * a) + (b * b));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Szög fokmértéket átalakítja radiánsra
|
|
46
|
-
* @param angle szög fok
|
|
47
|
-
* @returns szög radiáns
|
|
48
|
-
*/
|
|
49
|
-
static angleToRadians(angle) {
|
|
50
|
-
return angle * Math.PI / 180;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Szög radiáns mértéket átalakítja fokra
|
|
54
|
-
* @param radians szög radiáns
|
|
55
|
-
* @returns szög fok
|
|
56
|
-
*/
|
|
57
|
-
static radiansToAngle(radians) {
|
|
58
|
-
return radians / Math.PI * 180;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.Dynamo_Trigonometry = Dynamo_Trigonometry;
|
|
62
|
-
//# sourceMappingURL=dynamo-trigonometry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dynamo-trigonometry.js","sourceRoot":"","sources":["../../../src/_collections/_tools/dynamo-trigonometry.ts"],"names":[],"mappings":";;;AACA,MAAa,mBAAmB;IAE9B;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAS,EAAE,KAAc;QACvC,KAAK,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,4BAA4B,CAAC,CAAS,EAAE,CAAS;QACtD,IAAI,CAAC,GAAG,CAAC,EAAE;YACT,MAAM,EAAE,YAAY,EAAE,0EAA0E,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;SACjH;QACD,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,aAAa,CAAC,CAAS,EAAE,CAAU;QACxC,CAAC,GAAG,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,KAAa;QACjC,OAAO,KAAK,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,cAAc,CAAC,OAAe;QACnC,OAAO,OAAO,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC;IACjC,CAAC;CACF;AA7DD,kDA6DC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { LocationCoordinates } from '../../_models/control-models/location-coordinates';
|
|
2
|
-
export declare class Location {
|
|
3
|
-
static getDistanceInKilometres(from: LocationCoordinates, to: LocationCoordinates): number;
|
|
4
|
-
static getLocationDegByKilometers(latiOrLong: 'latitude' | 'longitude', distanceInKm: number, latitude?: number): number;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=location.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../src/_collections/_tools/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AAGxF,qBAAa,QAAQ;IAEnB,MAAM,CAAC,uBAAuB,CAC5B,IAAI,EAAE,mBAAmB,EACzB,EAAE,EAAE,mBAAmB,GACtB,MAAM;IAgBT,MAAM,CAAC,0BAA0B,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM;CAiBzH"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Location = void 0;
|
|
4
|
-
const dynamo_error_1 = require("../../_models/control-models/dynamo-error");
|
|
5
|
-
const trigonometry_1 = require("./trigonometry");
|
|
6
|
-
class Location {
|
|
7
|
-
static getDistanceInKilometres(from, to) {
|
|
8
|
-
const R = 6371; // kilometres
|
|
9
|
-
const φ1 = trigonometry_1.Trigonometry.angleToRadians(from.latitude);
|
|
10
|
-
const φ2 = trigonometry_1.Trigonometry.angleToRadians(to.latitude);
|
|
11
|
-
const Δφ = trigonometry_1.Trigonometry.angleToRadians(to.latitude - from.latitude);
|
|
12
|
-
const Δλ = trigonometry_1.Trigonometry.angleToRadians(to.longitude - from.longitude);
|
|
13
|
-
const a = Math.sin(Δφ / 2) * Math.sin(Δφ / 2) +
|
|
14
|
-
Math.cos(φ1) * Math.cos(φ2) *
|
|
15
|
-
Math.sin(Δλ / 2) * Math.sin(Δλ / 2);
|
|
16
|
-
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
17
|
-
return R * c;
|
|
18
|
-
}
|
|
19
|
-
static getLocationDegByKilometers(latiOrLong, distanceInKm, latitude) {
|
|
20
|
-
if (latiOrLong === 'latitude') {
|
|
21
|
-
return distanceInKm / 110.574;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
if (latitude) {
|
|
25
|
-
return distanceInKm / (Math.cos(trigonometry_1.Trigonometry.angleToRadians(latitude)) * 111.320);
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
throw new dynamo_error_1.Dynamo_Error({
|
|
29
|
-
status: 417,
|
|
30
|
-
errorCode: 'FSM-DSS-505',
|
|
31
|
-
addECToUserMsg: true,
|
|
32
|
-
message: `When using getLocationDegByKilometers for longitude, you need to give latitude! (latiOrLong: ${latiOrLong}, distanceInKm: ${distanceInKm}, latitude: ${latitude})`,
|
|
33
|
-
userMessage: `We encountered an uncought BackEnd Error, please contact the responsible development team.`
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.Location = Location;
|
|
40
|
-
//# sourceMappingURL=location.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../src/_collections/_tools/location.ts"],"names":[],"mappings":";;;AACA,4EAAyE;AAEzE,iDAA8C;AAE9C,MAAa,QAAQ;IAEnB,MAAM,CAAC,uBAAuB,CAC5B,IAAyB,EACzB,EAAuB;QAGvB,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,aAAa;QAC7B,MAAM,EAAE,GAAG,2BAAY,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACtD,MAAM,EAAE,GAAG,2BAAY,CAAC,cAAc,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,EAAE,GAAG,2BAAY,CAAC,cAAc,CAAC,EAAE,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QACpE,MAAM,EAAE,GAAG,2BAAY,CAAC,cAAc,CAAC,EAAE,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;QAEtE,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;YACnC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC3B,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAEzD,OAAO,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAED,MAAM,CAAC,0BAA0B,CAAC,UAAoC,EAAE,YAAoB,EAAE,QAAiB;QAC7G,IAAI,UAAU,KAAK,UAAU,EAAE;YAC7B,OAAO,YAAY,GAAG,OAAO,CAAC;SAC/B;aAAM;YACL,IAAI,QAAQ,EAAE;gBACZ,OAAO,YAAY,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,2BAAY,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC;aACnF;iBAAM;gBACL,MAAM,IAAI,2BAAY,CAAC;oBACrB,MAAM,EAAE,GAAG;oBACX,SAAS,EAAE,aAAa;oBACxB,cAAc,EAAE,IAAI;oBACpB,OAAO,EAAE,gGAAgG,UAAU,mBAAmB,YAAY,eAAe,QAAQ,GAAG;oBAC5K,WAAW,EAAE,4FAA4F;iBAC1G,CAAC,CAAC;aACJ;SACF;IACH,CAAC;CACF;AAtCD,4BAsCC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { LogStyle } from '../../_enums/log-style.enum';
|
|
2
|
-
export declare class Log {
|
|
3
|
-
static setLogStyle(styles: LogStyle[]): void;
|
|
4
|
-
static resetLogStyle(): void;
|
|
5
|
-
static logStyle(input: string, styles: LogStyle[], dontReset?: boolean): string;
|
|
6
|
-
static logSuccess(message: string, ...optionalParams: any[]): void;
|
|
7
|
-
static logError(message: string, ...optionalParams: any[]): void;
|
|
8
|
-
static logWarning(message: string, ...optionalParams: any[]): void;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=log.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../src/_collections/_tools/log.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,qBAAa,GAAG;IAEd,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,GAAG,IAAI;IAO5C,MAAM,CAAC,aAAa,IAAI,IAAI;IAI5B,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM;IAY/E,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,GAAG,IAAI;IAQlE,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,GAAG,IAAI;IAQhE,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,GAAG,EAAE,GAAG,IAAI;CAOnE"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Log = void 0;
|
|
4
|
-
const log_style_enum_1 = require("../../_enums/log-style.enum");
|
|
5
|
-
class Log {
|
|
6
|
-
static setLogStyle(styles) {
|
|
7
|
-
let styleSets = '';
|
|
8
|
-
styles.forEach((style) => {
|
|
9
|
-
styleSets += style;
|
|
10
|
-
});
|
|
11
|
-
console.log(styleSets);
|
|
12
|
-
}
|
|
13
|
-
static resetLogStyle() {
|
|
14
|
-
console.log(log_style_enum_1.LogStyle.reset);
|
|
15
|
-
}
|
|
16
|
-
static logStyle(input, styles, dontReset) {
|
|
17
|
-
let result = '';
|
|
18
|
-
styles.forEach((style) => {
|
|
19
|
-
result += style;
|
|
20
|
-
});
|
|
21
|
-
result += input;
|
|
22
|
-
if (!dontReset) {
|
|
23
|
-
result += log_style_enum_1.LogStyle.reset;
|
|
24
|
-
}
|
|
25
|
-
return result;
|
|
26
|
-
}
|
|
27
|
-
static logSuccess(message, ...optionalParams) {
|
|
28
|
-
if (0 < optionalParams.length) {
|
|
29
|
-
console.error(`${log_style_enum_1.LogStyle.green}${log_style_enum_1.LogStyle.bright}${message}`, ...optionalParams, log_style_enum_1.LogStyle.reset);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
console.error(`${log_style_enum_1.LogStyle.green}${log_style_enum_1.LogStyle.bright}${message}${log_style_enum_1.LogStyle.reset}`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
static logError(message, ...optionalParams) {
|
|
36
|
-
if (0 < optionalParams.length) {
|
|
37
|
-
console.error(`${log_style_enum_1.LogStyle.red}${log_style_enum_1.LogStyle.bright}${message}`, ...optionalParams, log_style_enum_1.LogStyle.reset);
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
console.error(`${log_style_enum_1.LogStyle.red}${log_style_enum_1.LogStyle.bright}${message}${log_style_enum_1.LogStyle.reset}`);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
static logWarning(message, ...optionalParams) {
|
|
44
|
-
if (0 < optionalParams.length) {
|
|
45
|
-
console.warn(`${log_style_enum_1.LogStyle.yellow}${log_style_enum_1.LogStyle.bright}${message}`, ...optionalParams, log_style_enum_1.LogStyle.reset);
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
console.warn(`${log_style_enum_1.LogStyle.yellow}${log_style_enum_1.LogStyle.bright}${message}${log_style_enum_1.LogStyle.reset}`);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.Log = Log;
|
|
53
|
-
//# sourceMappingURL=log.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","s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AE,GAAG,cAAqB;QACvD,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE;YAC7B,OAAO,CAAC,KAAK,CAAC,GAAG,yBAAQ,CAAC,GAAG,GAAG,yBAAQ,CAAC,MAAM,GAAG,OAAO,EAAE,EAAE,GAAG,cAAc,EAAE,yBAAQ,CAAC,KAAK,CAAC,CAAC;SACjG;aAAM;YACL,OAAO,CAAC,KAAK,CAAC,GAAG,yBAAQ,CAAC,GAAG,GAAG,yBAAQ,CAAC,MAAM,GAAG,OAAO,GAAG,yBAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;SAC/E;IACH,CAAC;IAED,MAAM,CAAC,UAAU,CAAC,OAAe,EAAE,GAAG,cAAqB;QACzD,IAAI,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE;YAC7B,OAAO,CAAC,IAAI,CAAC,GAAG,yBAAQ,CAAC,MAAM,GAAG,yBAAQ,CAAC,MAAM,GAAG,OAAO,EAAE,EAAE,GAAG,cAAc,EAAE,yBAAQ,CAAC,KAAK,CAAC,CAAC;SACnG;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,yBAAQ,CAAC,MAAM,GAAG,yBAAQ,CAAC,MAAM,GAAG,OAAO,GAAG,yBAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;SACjF;IACH,CAAC;CACF;AAhDD,kBAgDC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { RandomWeight } from '../../_models/control-models/random-weight';
|
|
2
|
-
export declare class Random {
|
|
3
|
-
static getRandomWeightedInt(min: number, max: number, weights: RandomWeight<number>[]): number;
|
|
4
|
-
static getRandomInt(min: number, max: number): number;
|
|
5
|
-
static getRandomListElement<T>(list: T[]): T;
|
|
6
|
-
static getRandomWeighted<T>(weights: RandomWeight<T>[]): T;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=random.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../../src/_collections/_tools/random.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAE1E,qBAAa,MAAM;IACjB,MAAM,CAAC,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,MAAM,CAAC,EAAE,GAAG,MAAM;IAyB9F,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM;IAIrD,MAAM,CAAC,oBAAoB,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC;IAQ5C,MAAM,CAAC,iBAAiB,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;CAsB3D"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Random = void 0;
|
|
4
|
-
class Random {
|
|
5
|
-
static getRandomWeightedInt(min, max, weights) {
|
|
6
|
-
weights = weights.sort((a, b) => b.chance - a.chance);
|
|
7
|
-
let weightChanceSum = 0;
|
|
8
|
-
weights.forEach(weight => weightChanceSum += weight.chance);
|
|
9
|
-
if (1 < weightChanceSum) {
|
|
10
|
-
weights.forEach(weights => weights.chance = weights.chance / weightChanceSum);
|
|
11
|
-
}
|
|
12
|
-
const randomChance = Math.random();
|
|
13
|
-
let result;
|
|
14
|
-
let chancer = 0;
|
|
15
|
-
for (let i = 0; i < weights.length && result === undefined; i++) {
|
|
16
|
-
chancer += weights[i].chance;
|
|
17
|
-
if (randomChance < chancer) {
|
|
18
|
-
result = weights[i].result;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
if (result !== undefined) {
|
|
22
|
-
return result;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return this.getRandomInt(min, max);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
static getRandomInt(min, max) {
|
|
29
|
-
return min + Math.round((max - min) * Math.random());
|
|
30
|
-
}
|
|
31
|
-
static getRandomListElement(list) {
|
|
32
|
-
if (0 < list.length) {
|
|
33
|
-
return list[this.getRandomInt(0, list.length - 1)];
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
static getRandomWeighted(weights) {
|
|
40
|
-
if (!(weights === null || weights === void 0 ? void 0 : weights.length)) {
|
|
41
|
-
return null;
|
|
42
|
-
}
|
|
43
|
-
weights = weights.sort((a, b) => b.chance - a.chance);
|
|
44
|
-
let weightChanceSum = 0;
|
|
45
|
-
weights.forEach(weight => weightChanceSum += weight.chance);
|
|
46
|
-
weights.forEach(weights => weights.chance = weights.chance / weightChanceSum);
|
|
47
|
-
const randomChance = Math.random();
|
|
48
|
-
let result;
|
|
49
|
-
let chancer = 0;
|
|
50
|
-
for (let i = 0; i < weights.length && result === undefined; i++) {
|
|
51
|
-
chancer += weights[i].chance;
|
|
52
|
-
if (randomChance < chancer) {
|
|
53
|
-
result = weights[i].result;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return result;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
exports.Random = Random;
|
|
60
|
-
//# sourceMappingURL=random.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"random.js","sourceRoot":"","sources":["../../../src/_collections/_tools/random.ts"],"names":[],"mappings":";;;AAGA,MAAa,MAAM;IACjB,MAAM,CAAC,oBAAoB,CAAC,GAAW,EAAE,GAAW,EAAE,OAA+B;QACnF,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,eAAe,GAAG,CAAC,CAAC;QACxB,OAAO,CA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AED,MAAM,CAAC,iBAAiB,CAAI,OAA0B;QACpD,IAAI,EAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAA,EAAE;YACpB,OAAO,IAAI,CAAC;SACb;QAED,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;QACtD,IAAI,eAAe,GAAG,CAAC,CAAC;QACxB,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,eAAe,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;QAC5D,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,eAAe,CAAC,CAAC;QAE9E,MAAM,YAAY,GAAW,IAAI,CAAC,MAAM,EAAE,CAAC;QAC3C,IAAI,MAAS,CAAC;QACd,IAAI,OAAO,GAAG,CAAC,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC,EAAE,EAAE;YAC/D,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;YAC7B,IAAI,YAAY,GAAG,OAAO,EAAE;gBAC1B,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;aAC5B;SACF;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AA5DD,wBA4DC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Region } from '../../_enums/region.enum';
|
|
2
|
-
import { CountryISO, SubdivisionCollection } from '../_constants/country-iso';
|
|
3
|
-
import { CountryPhoneCode } from '../_constants/country-phone-code';
|
|
4
|
-
export declare class Dynamo_Regions {
|
|
5
|
-
static getAllCountryISO(): CountryISO[];
|
|
6
|
-
static getAllPhoneCodes(): CountryPhoneCode[];
|
|
7
|
-
static getSubdivisionCollection(): SubdivisionCollection;
|
|
8
|
-
static iso1ToCountryIso(iso1: string): CountryISO;
|
|
9
|
-
static iso1ToRegion(iso1: string): Region;
|
|
10
|
-
static iso1ToPhoneCode(iso1: string): CountryPhoneCode;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=region-translator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"region-translator.d.ts","sourceRoot":"","sources":["../../../src/_collections/_tools/region-translator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAEpE,qBAAa,cAAc;IAEzB,MAAM,CAAC,gBAAgB,IAAI,UAAU,EAAE;IAIvC,MAAM,CAAC,gBAAgB,IAAI,gBAAgB,EAAE;IAI7C,MAAM,CAAC,wBAAwB,IAAI,qBAAqB;IAIxD,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU;IASjD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IASzC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;CAQvD"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Dynamo_Regions = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const ISOs = tslib_1.__importStar(require("../_constants/country-codes-ISO-3166.json"));
|
|
6
|
-
const PhoneCodes = tslib_1.__importStar(require("../_constants/country-phone-codes.json"));
|
|
7
|
-
const Subdivisions = tslib_1.__importStar(require("../_constants/country-sub-divisions-ISO-3166.json"));
|
|
8
|
-
const _models_1 = require("../../_models");
|
|
9
|
-
class Dynamo_Regions {
|
|
10
|
-
static getAllCountryISO() {
|
|
11
|
-
return ISOs;
|
|
12
|
-
}
|
|
13
|
-
static getAllPhoneCodes() {
|
|
14
|
-
return PhoneCodes;
|
|
15
|
-
}
|
|
16
|
-
static getSubdivisionCollection() {
|
|
17
|
-
return Subdivisions;
|
|
18
|
-
}
|
|
19
|
-
static iso1ToCountryIso(iso1) {
|
|
20
|
-
const country = ISOs.find(iso => iso.iso1 == iso1);
|
|
21
|
-
if (!country) {
|
|
22
|
-
throw new _models_1.Dynamo_Error({ message: `Cannot find ISO-3166 code for this: ${iso1}` });
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
return country;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
static iso1ToRegion(iso1) {
|
|
29
|
-
const region = ISOs.find(iso => iso.iso1 == iso1).region;
|
|
30
|
-
if (!region) {
|
|
31
|
-
throw new _models_1.Dynamo_Error({ message: `Cannot find ISO-3166 code for this: ${iso1}` });
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
return region;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
static iso1ToPhoneCode(iso1) {
|
|
38
|
-
const phoneCode = PhoneCodes.find(code => code.iso == iso1);
|
|
39
|
-
if (!phoneCode) {
|
|
40
|
-
throw new _models_1.Dynamo_Error({ message: `Cannot find ISO-3166 code for this: ${iso1}` });
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
return phoneCode;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.Dynamo_Regions = Dynamo_Regions;
|
|
48
|
-
//# sourceMappingURL=region-translator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"region-translator.js","sourceRoot":"","sources":["../../../src/_collections/_tools/region-translator.ts"],"names":[],"mappings":";;;;AACA,wFAAkE;AAClE,2FAAqE;AACrE,wGAAkF;AAElF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,8 +0,0 @@
|
|
|
1
|
-
export declare class RoundList {
|
|
2
|
-
static getOutboundedIndex(listLength: number, outboundIndex: number): number;
|
|
3
|
-
static getIndexOpposite(length: number, oppositeOf: number): number;
|
|
4
|
-
static getListIndex<T>(list: T[], outboundIndex: number): T;
|
|
5
|
-
static getListOpposite<T>(list: T[], oppositeOf: T): T;
|
|
6
|
-
static getLast<T>(list: T[]): T;
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=round-list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"round-list.d.ts","sourceRoot":"","sources":["../../../src/_collections/_tools/round-list.ts"],"names":[],"mappings":"AAEA,qBAAa,SAAS;IACpB,MAAM,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM;IAgB5E,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM;IAOnE,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC;IAI3D,MAAM,CAAC,eAAe,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC;IAItD,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC;CAOhC"}
|