@colijnit/ioneconnector 3.1.25 → 3.1.26
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/build/connector.d.ts +30 -30
- package/build/connector.js +67 -67
- package/build/connector.unit.test.d.ts +1 -1
- package/build/connector.unit.test.js +108 -108
- package/build/enum/activate-user-account-status.enum.d.ts +6 -6
- package/build/enum/activate-user-account-status.enum.js +10 -10
- package/build/enum/address-format.enum.d.ts +4 -4
- package/build/enum/address-format.enum.js +8 -8
- package/build/enum/backend-language-code.enum.d.ts +6 -6
- package/build/enum/backend-language-code.enum.js +10 -10
- package/build/enum/backend-service-name.enum.d.ts +7 -7
- package/build/enum/backend-service-name.enum.js +11 -11
- package/build/enum/communication-type.enum.d.ts +8 -8
- package/build/enum/communication-type.enum.js +12 -12
- package/build/enum/datasession-service-method.enum.d.ts +13 -13
- package/build/enum/datasession-service-method.enum.js +17 -17
- package/build/enum/db-boolean-value-type.enum.d.ts +12 -12
- package/build/enum/db-boolean-value-type.enum.js +32 -32
- package/build/enum/end-point.enum.d.ts +4 -4
- package/build/enum/end-point.enum.js +8 -8
- package/build/enum/file-type-internal.enum.d.ts +11 -11
- package/build/enum/file-type-internal.enum.js +15 -15
- package/build/enum/file-type.enum.d.ts +5 -5
- package/build/enum/file-type.enum.js +9 -9
- package/build/enum/filter-type.enum.d.ts +4 -4
- package/build/enum/filter-type.enum.js +8 -8
- package/build/enum/health-service-method.enum.d.ts +3 -3
- package/build/enum/health-service-method.enum.js +7 -7
- package/build/enum/language-code.enum.d.ts +7 -7
- package/build/enum/language-code.enum.js +11 -11
- package/build/enum/login-service-method.enum.d.ts +24 -24
- package/build/enum/login-service-method.enum.js +28 -28
- package/build/enum/login-status.enum.d.ts +20 -20
- package/build/enum/login-status.enum.js +24 -24
- package/build/enum/message-type.enum.d.ts +6 -6
- package/build/enum/message-type.enum.js +10 -10
- package/build/enum/object-config-kind.d.ts +9 -9
- package/build/enum/object-config-kind.js +13 -13
- package/build/enum/object-configuration-data-type.enum.d.ts +7 -7
- package/build/enum/object-configuration-data-type.enum.js +11 -11
- package/build/enum/object-configuration-value-type.enum.d.ts +10 -10
- package/build/enum/object-configuration-value-type.enum.js +14 -14
- package/build/enum/object-right-type.enum.d.ts +5 -5
- package/build/enum/object-right-type.enum.js +9 -9
- package/build/enum/one-zero-bool-db-type.enum.d.ts +5 -5
- package/build/enum/one-zero-bool-db-type.enum.js +20 -20
- package/build/enum/public-service-method.enum.d.ts +5 -5
- package/build/enum/public-service-method.enum.js +9 -9
- package/build/enum/reset-password-status.enum.d.ts +5 -5
- package/build/enum/reset-password-status.enum.js +9 -9
- package/build/enum/screen-config-subcategory.enum.d.ts +2 -2
- package/build/enum/screen-config-subcategory.enum.js +2 -2
- package/build/enum/search-data-type.enum.d.ts +4 -4
- package/build/enum/search-data-type.enum.js +8 -8
- package/build/enum/search-property-state.enum.d.ts +5 -5
- package/build/enum/search-property-state.enum.js +9 -9
- package/build/enum/sort-direction.d.ts +5 -5
- package/build/enum/sort-direction.js +12 -12
- package/build/enum/sort-type.enum.d.ts +6 -6
- package/build/enum/sort-type.enum.js +10 -10
- package/build/enum/true-false-db-type.enum.d.ts +5 -5
- package/build/enum/true-false-db-type.enum.js +20 -20
- package/build/enum/user-info-service-method.enum.d.ts +3 -3
- package/build/enum/user-info-service-method.enum.js +7 -7
- package/build/enum/user-right-type.enum.d.ts +7 -7
- package/build/enum/user-right-type.enum.js +11 -11
- package/build/enum/user-role-type.enum.d.ts +17 -17
- package/build/enum/user-role-type.enum.js +21 -21
- package/build/enum/value-comparison-type.enum.d.ts +15 -15
- package/build/enum/value-comparison-type.enum.js +31 -31
- package/build/enum/yes-no-db-type.enum.d.ts +5 -5
- package/build/enum/yes-no-db-type.enum.js +20 -20
- package/build/factory/business-object-serializer.d.ts +11 -11
- package/build/factory/business-object-serializer.js +145 -145
- package/build/factory/decorators/bo-factory-step.decorator.d.ts +4 -4
- package/build/factory/decorators/bo-factory-step.decorator.js +16 -16
- package/build/factory/decorators/bo-serializer-step.decorator.d.ts +4 -4
- package/build/factory/decorators/bo-serializer-step.decorator.js +16 -16
- package/build/factory/decorators/boolean.decorator.d.ts +12 -12
- package/build/factory/decorators/boolean.decorator.js +73 -73
- package/build/factory/decorators/business-object-data.decorator.d.ts +23 -23
- package/build/factory/decorators/business-object-data.decorator.js +87 -87
- package/build/factory/decorators/co-inject.decorator.d.ts +7 -7
- package/build/factory/decorators/co-inject.decorator.js +54 -54
- package/build/factory/decorators/complex-array.decorator.d.ts +6 -6
- package/build/factory/decorators/complex-array.decorator.js +37 -37
- package/build/factory/decorators/complex-field.decorator.d.ts +6 -6
- package/build/factory/decorators/complex-field.decorator.js +37 -37
- package/build/factory/decorators/date-field.decorator.d.ts +6 -6
- package/build/factory/decorators/date-field.decorator.js +27 -27
- package/build/factory/decorators/db-field-alias.decorator.d.ts +6 -6
- package/build/factory/decorators/db-field-alias.decorator.js +40 -40
- package/build/factory/decorators/db-method-value.decorator.d.ts +5 -5
- package/build/factory/decorators/db-method-value.decorator.js +19 -19
- package/build/factory/decorators/db-number.decorator.d.ts +6 -6
- package/build/factory/decorators/db-number.decorator.js +35 -35
- package/build/factory/decorators/default-send-value.decorator.d.ts +7 -7
- package/build/factory/decorators/default-send-value.decorator.js +53 -53
- package/build/factory/decorators/exclude-when-empty-string.decorator.d.ts +5 -5
- package/build/factory/decorators/exclude-when-empty-string.decorator.js +19 -19
- package/build/factory/decorators/json.decorator.d.ts +6 -6
- package/build/factory/decorators/json.decorator.js +26 -26
- package/build/factory/decorators/map-property.decorator.d.ts +6 -6
- package/build/factory/decorators/map-property.decorator.js +29 -29
- package/build/factory/decorators/no-db-field.decorator.d.ts +5 -5
- package/build/factory/decorators/no-db-field.decorator.js +34 -34
- package/build/factory/decorators/number-string.decorator.d.ts +6 -6
- package/build/factory/decorators/number-string.decorator.js +23 -23
- package/build/factory/decorators/simple-method-tag.decorator.d.ts +6 -6
- package/build/factory/decorators/simple-method-tag.decorator.js +31 -31
- package/build/factory/decorators/simple-property-tag.decorator.d.ts +6 -6
- package/build/factory/decorators/simple-property-tag.decorator.js +38 -38
- package/build/factory/decorators/string-number.decorator.d.ts +7 -7
- package/build/factory/decorators/string-number.decorator.js +30 -30
- package/build/factory/decorators/validate.decorator.d.ts +11 -11
- package/build/factory/decorators/validate.decorator.js +55 -55
- package/build/interface/address-common-shape.interface.d.ts +14 -14
- package/build/interface/address-common-shape.interface.js +2 -2
- package/build/interface/business-object-data-shape.d.ts +19 -19
- package/build/interface/business-object-data-shape.js +2 -2
- package/build/interface/check-precision-and-scale-result.d.ts +4 -4
- package/build/interface/check-precision-and-scale-result.js +2 -2
- package/build/interface/check-within-stepped-bounds-result.d.ts +4 -4
- package/build/interface/check-within-stepped-bounds-result.js +2 -2
- package/build/interface/filter-property.d.ts +9 -9
- package/build/interface/filter-property.js +2 -2
- package/build/interface/login-storage-data.interface.d.ts +10 -10
- package/build/interface/login-storage-data.interface.js +2 -2
- package/build/interface/precision-scale-object.d.ts +4 -4
- package/build/interface/precision-scale-object.js +2 -2
- package/build/interface/search-property.d.ts +11 -11
- package/build/interface/search-property.js +2 -2
- package/build/interface/sort-property.d.ts +11 -11
- package/build/interface/sort-property.js +2 -2
- package/build/interface/text-part.d.ts +4 -4
- package/build/interface/text-part.js +2 -2
- package/build/interface/value-comparison-type-view-wrapper.d.ts +6 -6
- package/build/interface/value-comparison-type-view-wrapper.js +2 -2
- package/build/model/business-object.d.ts +13 -13
- package/build/model/business-object.js +34 -34
- package/build/model/company.bo.d.ts +9 -9
- package/build/model/company.bo.js +13 -13
- package/build/model/constant/java-constants.d.ts +2 -2
- package/build/model/constant/java-constants.js +5 -5
- package/build/model/country.bo.d.ts +11 -11
- package/build/model/country.bo.js +11 -11
- package/build/model/data-service-data.d.ts +15 -15
- package/build/model/data-service-data.js +6 -6
- package/build/model/data-service-response-data.d.ts +19 -19
- package/build/model/data-service-response-data.interface.d.ts +9 -9
- package/build/model/data-service-response-data.interface.js +2 -2
- package/build/model/data-service-response-data.js +57 -57
- package/build/model/data-service-response-exception.d.ts +29 -29
- package/build/model/data-service-response-exception.js +2 -2
- package/build/model/data-service-response-root.d.ts +7 -7
- package/build/model/data-service-response-root.js +2 -2
- package/build/model/default-all-scr-cfg-subcategory.d.ts +2 -2
- package/build/model/default-all-scr-cfg-subcategory.js +4 -4
- package/build/model/default-get-object-configurations-params.d.ts +2 -2
- package/build/model/default-get-object-configurations-params.js +5 -5
- package/build/model/field-validation.d.ts +11 -11
- package/build/model/field-validation.interface.d.ts +6 -6
- package/build/model/field-validation.interface.js +2 -2
- package/build/model/field-validation.js +76 -76
- package/build/model/field-validations-object.d.ts +4 -4
- package/build/model/field-validations-object.interface.d.ts +4 -4
- package/build/model/field-validations-object.interface.js +2 -2
- package/build/model/field-validations-object.js +2 -2
- package/build/model/ione-local-storage-root-object.d.ts +5 -5
- package/build/model/ione-local-storage-root-object.js +9 -9
- package/build/model/keycloak-parameters.bo.d.ts +5 -5
- package/build/model/keycloak-parameters.bo.js +7 -7
- package/build/model/local-storage-root-object.d.ts +4 -4
- package/build/model/local-storage-root-object.js +9 -9
- package/build/model/local-storage-schema-object.d.ts +7 -7
- package/build/model/local-storage-schema-object.js +9 -9
- package/build/model/local-storage-user-object.d.ts +7 -7
- package/build/model/local-storage-user-object.js +6 -6
- package/build/model/login-request.d.ts +15 -15
- package/build/model/login-request.interface.d.ts +12 -12
- package/build/model/login-request.interface.js +2 -2
- package/build/model/login-request.js +6 -6
- package/build/model/login-response.d.ts +36 -36
- package/build/model/login-response.interface.d.ts +22 -22
- package/build/model/login-response.interface.js +2 -2
- package/build/model/login-response.js +57 -57
- package/build/model/login-service-request-data.d.ts +17 -17
- package/build/model/login-service-request-data.js +2 -2
- package/build/model/login.d.ts +16 -16
- package/build/model/login.js +35 -35
- package/build/model/menu-content.bo.d.ts +13 -13
- package/build/model/menu-content.bo.js +13 -13
- package/build/model/object-configuration.d.ts +53 -53
- package/build/model/object-configuration.js +200 -200
- package/build/model/options.d.ts +26 -26
- package/build/model/options.js +16 -16
- package/build/model/paging-parameters.d.ts +15 -15
- package/build/model/paging-parameters.interface.d.ts +6 -6
- package/build/model/paging-parameters.interface.js +6 -6
- package/build/model/paging-parameters.js +37 -37
- package/build/model/public-service-request-data.d.ts +5 -5
- package/build/model/public-service-request-data.js +2 -2
- package/build/model/server-response-data.d.ts +5 -5
- package/build/model/server-response-data.js +2 -2
- package/build/model/server-stack-trace-element.d.ts +7 -7
- package/build/model/server-stack-trace-element.js +2 -2
- package/build/model/session-storage-root-object.d.ts +4 -4
- package/build/model/session-storage-root-object.js +9 -9
- package/build/model/session-storage-schema-object.d.ts +7 -7
- package/build/model/session-storage-schema-object.js +9 -9
- package/build/model/session-storage-user-object.d.ts +6 -6
- package/build/model/session-storage-user-object.js +10 -10
- package/build/model/session.d.ts +6 -6
- package/build/model/session.js +6 -6
- package/build/model/token-response.bo.d.ts +5 -5
- package/build/model/token-response.bo.js +7 -7
- package/build/model/user-parameters-values.bo.d.ts +8 -8
- package/build/model/user-parameters-values.bo.js +7 -7
- package/build/model/validation-message.d.ts +13 -13
- package/build/model/validation-message.interface.d.ts +6 -6
- package/build/model/validation-message.interface.js +2 -2
- package/build/model/validation-message.js +48 -48
- package/build/model/validation-result.d.ts +34 -34
- package/build/model/validation-result.interface.d.ts +14 -14
- package/build/model/validation-result.interface.js +2 -2
- package/build/model/validation-result.js +192 -192
- package/build/provider/ajax.service.d.ts +32 -32
- package/build/provider/ajax.service.js +271 -271
- package/build/provider/base-backend-connection.service.d.ts +45 -45
- package/build/provider/base-backend-connection.service.js +166 -164
- package/build/provider/base-backend-connection.service.js.map +1 -1
- package/build/service/business-object-factory.d.ts +8 -8
- package/build/service/business-object-factory.js +119 -119
- package/build/service/datasession.service.d.ts +9 -9
- package/build/service/datasession.service.js +26 -26
- package/build/service/encrypt.service.d.ts +6 -6
- package/build/service/encrypt.service.js +30 -30
- package/build/service/encrypt.service.unit.test.d.ts +1 -1
- package/build/service/encrypt.service.unit.test.js +14 -14
- package/build/service/external-jwt-token.service.d.ts +10 -10
- package/build/service/external-jwt-token.service.js +21 -21
- package/build/service/health.service.d.ts +10 -10
- package/build/service/health.service.js +34 -34
- package/build/service/internal-jwt-token.service.d.ts +11 -11
- package/build/service/internal-jwt-token.service.js +40 -40
- package/build/service/jwt-token.service.d.ts +12 -12
- package/build/service/jwt-token.service.js +32 -32
- package/build/service/local-storage.service.d.ts +27 -27
- package/build/service/local-storage.service.js +147 -147
- package/build/service/login.service.d.ts +45 -45
- package/build/service/login.service.js +312 -312
- package/build/service/public.service.d.ts +12 -12
- package/build/service/public.service.js +36 -36
- package/build/service/session-storage.service.d.ts +18 -18
- package/build/service/session-storage.service.js +116 -116
- package/build/service/user-info.service.d.ts +9 -9
- package/build/service/user-info.service.js +33 -33
- package/build/tests/int/connector.int.test.d.ts +1 -1
- package/build/tests/int/connector.int.test.js +12 -12
- package/build/type/business-object-id-type.d.ts +4 -4
- package/build/type/business-object-id-type.js +13 -13
- package/build/type/object-configuration-default-value-type.d.ts +1 -1
- package/build/type/object-configuration-default-value-type.js +2 -2
- package/build/utils/array-utils.d.ts +38 -38
- package/build/utils/array-utils.js +375 -375
- package/build/utils/business-object-utils.d.ts +20 -20
- package/build/utils/business-object-utils.js +198 -198
- package/build/utils/date-utils.d.ts +5 -5
- package/build/utils/date-utils.js +24 -24
- package/build/utils/file-utils.d.ts +6 -6
- package/build/utils/file-utils.js +66 -66
- package/build/utils/function/any-nill.function.d.ts +1 -1
- package/build/utils/function/any-nill.function.js +16 -16
- package/build/utils/function/is-nill.function.d.ts +1 -1
- package/build/utils/function/is-nill.function.js +7 -7
- package/build/utils/function/not-nill.function.d.ts +1 -1
- package/build/utils/function/not-nill.function.js +7 -7
- package/build/utils/function-utils.d.ts +4 -4
- package/build/utils/function-utils.js +31 -31
- package/build/utils/image-utils.d.ts +4 -4
- package/build/utils/image-utils.js +28 -28
- package/build/utils/map-utils.d.ts +4 -4
- package/build/utils/map-utils.js +31 -31
- package/build/utils/number-utils.d.ts +39 -39
- package/build/utils/number-utils.js +268 -268
- package/build/utils/object-utils.d.ts +21 -21
- package/build/utils/object-utils.js +247 -247
- package/build/utils/parameter-value-conversion-utils.d.ts +3 -3
- package/build/utils/parameter-value-conversion-utils.js +19 -19
- package/build/utils/promise-utils.d.ts +6 -6
- package/build/utils/promise-utils.js +22 -22
- package/build/utils/ref-code-utils.d.ts +4 -4
- package/build/utils/ref-code-utils.js +19 -19
- package/build/utils/sort-utils.d.ts +12 -12
- package/build/utils/sort-utils.js +120 -120
- package/build/utils/string-utils.d.ts +25 -25
- package/build/utils/string-utils.js +212 -212
- package/build/utils/url-utils.d.ts +4 -4
- package/build/utils/url-utils.js +33 -33
- package/build/validators/communication-type.validator.d.ts +1 -1
- package/build/validators/communication-type.validator.js +16 -16
- package/build/validators/email.validator.d.ts +2 -2
- package/build/validators/email.validator.js +9 -9
- package/build/validators/empty-address.validator.d.ts +3 -3
- package/build/validators/empty-address.validator.js +12 -12
- package/build/validators/empty-array.validator.d.ts +2 -2
- package/build/validators/empty-array.validator.js +14 -14
- package/build/validators/end-date-equal.validator.d.ts +1 -1
- package/build/validators/end-date-equal.validator.js +17 -17
- package/build/validators/end-date.validator.d.ts +1 -1
- package/build/validators/end-date.validator.js +17 -17
- package/build/validators/equal.validator.d.ts +2 -2
- package/build/validators/equal.validator.js +14 -14
- package/build/validators/max-string-length.validator.d.ts +2 -2
- package/build/validators/max-string-length.validator.js +13 -13
- package/build/validators/nl-post-code.validator.d.ts +3 -3
- package/build/validators/nl-post-code.validator.js +14 -14
- package/build/validators/password.validator.d.ts +3 -3
- package/build/validators/password.validator.js +33 -33
- package/build/validators/postal-code-function.validator.d.ts +2 -2
- package/build/validators/postal-code-function.validator.js +19 -19
- package/build/validators/postal-code.validator.d.ts +1 -1
- package/build/validators/postal-code.validator.js +21 -21
- package/build/validators/precision-scale.validator.d.ts +2 -2
- package/build/validators/precision-scale.validator.js +14 -14
- package/build/validators/required.validator.d.ts +2 -2
- package/build/validators/required.validator.js +8 -8
- package/build/validators/social-security-number.validator.d.ts +2 -2
- package/build/validators/social-security-number.validator.js +28 -28
- package/build/validators/space-trim.validator.d.ts +2 -2
- package/build/validators/space-trim.validator.js +12 -12
- package/build/validators/true.validator.d.ts +2 -2
- package/build/validators/true.validator.js +8 -8
- package/package.json +64 -64
|
@@ -1,248 +1,248 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectUtils = void 0;
|
|
4
|
-
const is_nill_function_1 = require("./function/is-nill.function");
|
|
5
|
-
const not_nill_function_1 = require("./function/not-nill.function");
|
|
6
|
-
class ObjectUtils {
|
|
7
|
-
static AllExist(...values) {
|
|
8
|
-
let allExist = true;
|
|
9
|
-
for (let i = 0, len = values.length; i < len; i++) {
|
|
10
|
-
if ((0, is_nill_function_1.isNill)(values[i])) {
|
|
11
|
-
allExist = false;
|
|
12
|
-
break;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return allExist;
|
|
16
|
-
}
|
|
17
|
-
static CopyPropertiesFrom(from, to, allowUndefined = true) {
|
|
18
|
-
if (!to) {
|
|
19
|
-
to = {};
|
|
20
|
-
}
|
|
21
|
-
if (!from) {
|
|
22
|
-
return to;
|
|
23
|
-
}
|
|
24
|
-
ObjectUtils.ForOwnProperty(from, (value, key) => {
|
|
25
|
-
if (allowUndefined || (0, not_nill_function_1.notNill)(value)) {
|
|
26
|
-
to[key] = value;
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return to;
|
|
30
|
-
}
|
|
31
|
-
static DeepEquals(actual, expected) {
|
|
32
|
-
if (actual === expected) {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
else if (actual instanceof Date && expected instanceof Date) {
|
|
36
|
-
return actual.getTime() === expected.getTime();
|
|
37
|
-
}
|
|
38
|
-
else if (!actual || !expected || typeof actual !== "object" && typeof expected !== "object") {
|
|
39
|
-
return actual === expected;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return this._objEquiv(actual, expected);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
static ForOwnProperty(plainObject, callback) {
|
|
46
|
-
if (ObjectUtils.IsPlainObject(plainObject)) {
|
|
47
|
-
for (const key in plainObject) {
|
|
48
|
-
if (plainObject.hasOwnProperty(key) && typeof plainObject[key] !== "function") {
|
|
49
|
-
const response = callback(plainObject[key], key);
|
|
50
|
-
if (response === false) {
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
static GetClassName(objectOrClass) {
|
|
58
|
-
if (!objectOrClass) {
|
|
59
|
-
return undefined;
|
|
60
|
-
}
|
|
61
|
-
else if (objectOrClass.constructor === Function) {
|
|
62
|
-
return objectOrClass.name;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
const constructorString = objectOrClass.constructor.toString();
|
|
66
|
-
return constructorString.match(/\w+/g)[1];
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
static GetShallowClone(originalObject, objectClass) {
|
|
70
|
-
let clonedObject = undefined;
|
|
71
|
-
if (objectClass) {
|
|
72
|
-
clonedObject = new objectClass();
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
clonedObject = {};
|
|
76
|
-
}
|
|
77
|
-
ObjectUtils.ForOwnProperty(originalObject, (value, key) => {
|
|
78
|
-
clonedObject[key] = value;
|
|
79
|
-
});
|
|
80
|
-
return clonedObject;
|
|
81
|
-
}
|
|
82
|
-
static GetDeepClone(originalObject, circular = true) {
|
|
83
|
-
let propertyIndex;
|
|
84
|
-
let descriptor;
|
|
85
|
-
let keys;
|
|
86
|
-
let current;
|
|
87
|
-
let nextSource;
|
|
88
|
-
let indexOf;
|
|
89
|
-
const copies = [{
|
|
90
|
-
source: originalObject,
|
|
91
|
-
target: Object.create(Object.getPrototypeOf(originalObject))
|
|
92
|
-
}];
|
|
93
|
-
const cloneObject = copies[0].target;
|
|
94
|
-
const sourceReferences = [originalObject];
|
|
95
|
-
const targetReferences = [cloneObject];
|
|
96
|
-
while (current = copies.shift()) {
|
|
97
|
-
keys = Object.getOwnPropertyNames(current.source);
|
|
98
|
-
for (propertyIndex = 0; propertyIndex < keys.length; propertyIndex++) {
|
|
99
|
-
descriptor = Object.getOwnPropertyDescriptor(current.source, keys[propertyIndex]);
|
|
100
|
-
if (!descriptor.value || typeof descriptor.value !== "object") {
|
|
101
|
-
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
nextSource = descriptor.value;
|
|
105
|
-
descriptor.value = Array.isArray(nextSource) ?
|
|
106
|
-
[] :
|
|
107
|
-
Object.create(Object.getPrototypeOf(nextSource));
|
|
108
|
-
if (circular) {
|
|
109
|
-
indexOf = sourceReferences.indexOf(nextSource);
|
|
110
|
-
if (indexOf !== -1) {
|
|
111
|
-
descriptor.value = targetReferences[indexOf];
|
|
112
|
-
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
sourceReferences.push(nextSource);
|
|
116
|
-
targetReferences.push(descriptor.value);
|
|
117
|
-
}
|
|
118
|
-
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
119
|
-
copies.push({ source: nextSource, target: descriptor.value });
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
return cloneObject;
|
|
123
|
-
}
|
|
124
|
-
static IsEmpty(obj) {
|
|
125
|
-
return (0, is_nill_function_1.isNill)(obj) || Object.getOwnPropertyNames(obj).length === 0;
|
|
126
|
-
}
|
|
127
|
-
static IsPlainObject(object) {
|
|
128
|
-
return object !== null && !Array.isArray(object) && typeof object !== "function" && typeof object === "object";
|
|
129
|
-
}
|
|
130
|
-
static MakeInstanceOf(clazz, dataObject) {
|
|
131
|
-
if (dataObject instanceof clazz) {
|
|
132
|
-
return dataObject;
|
|
133
|
-
}
|
|
134
|
-
else {
|
|
135
|
-
const asClazz = new clazz();
|
|
136
|
-
ObjectUtils.CopyPropertiesFrom(dataObject, asClazz);
|
|
137
|
-
return asClazz;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
static PickRandomPropertyValue(object) {
|
|
141
|
-
if (!object) {
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
let result;
|
|
145
|
-
let count = 0;
|
|
146
|
-
for (const prop in object) {
|
|
147
|
-
if (object.hasOwnProperty(prop)) {
|
|
148
|
-
count++;
|
|
149
|
-
if (Math.random() < 1 / count) {
|
|
150
|
-
result = object[prop];
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
return result;
|
|
155
|
-
}
|
|
156
|
-
static ValueOrDefault(value, defaultReturnVal = "") {
|
|
157
|
-
return (0, not_nill_function_1.notNill)(value) ? value : defaultReturnVal;
|
|
158
|
-
}
|
|
159
|
-
static _isArguments(x) {
|
|
160
|
-
const supportsArgsClass = this._supportsArgumentsClass();
|
|
161
|
-
return supportsArgsClass ? this._isArgumentsWhenArgsClassSupported(x) : this._isArgumentsWhenArgsClassNotSupported(x);
|
|
162
|
-
}
|
|
163
|
-
static _isArgumentsWhenArgsClassNotSupported(object) {
|
|
164
|
-
return object &&
|
|
165
|
-
typeof object === "object" &&
|
|
166
|
-
typeof object.length === "number" &&
|
|
167
|
-
Object.prototype.hasOwnProperty.call(object, "callee") &&
|
|
168
|
-
!Object.prototype.propertyIsEnumerable.call(object, "callee") ||
|
|
169
|
-
false;
|
|
170
|
-
}
|
|
171
|
-
static _isArgumentsWhenArgsClassSupported(object) {
|
|
172
|
-
return Object.prototype.toString.call(object) === "[object Arguments]";
|
|
173
|
-
}
|
|
174
|
-
static _isBuffer(x) {
|
|
175
|
-
if (!x || typeof x !== "object" || typeof x.length !== "number") {
|
|
176
|
-
return false;
|
|
177
|
-
}
|
|
178
|
-
if (typeof x.copy !== "function" || typeof x.slice !== "function") {
|
|
179
|
-
return false;
|
|
180
|
-
}
|
|
181
|
-
return !(x.length > 0 && typeof x[0] !== "number");
|
|
182
|
-
}
|
|
183
|
-
static _isUndefinedOrNull(value) {
|
|
184
|
-
return value === null || value === undefined;
|
|
185
|
-
}
|
|
186
|
-
static _objEquiv(a, b) {
|
|
187
|
-
let i, key;
|
|
188
|
-
if (this._isUndefinedOrNull(a) || this._isUndefinedOrNull(b)) {
|
|
189
|
-
return false;
|
|
190
|
-
}
|
|
191
|
-
if (a.prototype !== b.prototype) {
|
|
192
|
-
return false;
|
|
193
|
-
}
|
|
194
|
-
if (this._isArguments(a)) {
|
|
195
|
-
if (!this._isArguments(b)) {
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
a = Array.prototype.slice.call(a);
|
|
199
|
-
b = Array.prototype.slice.call(b);
|
|
200
|
-
return this.DeepEquals(a, b);
|
|
201
|
-
}
|
|
202
|
-
if (this._isBuffer(a)) {
|
|
203
|
-
if (!this._isBuffer(b)) {
|
|
204
|
-
return false;
|
|
205
|
-
}
|
|
206
|
-
if (a.length !== b.length) {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
for (i = 0; i < a.length; i++) {
|
|
210
|
-
if (a[i] !== b[i]) {
|
|
211
|
-
return false;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
return true;
|
|
215
|
-
}
|
|
216
|
-
let ka;
|
|
217
|
-
let kb;
|
|
218
|
-
try {
|
|
219
|
-
ka = Object.keys(a);
|
|
220
|
-
kb = Object.keys(b);
|
|
221
|
-
}
|
|
222
|
-
catch (e) {
|
|
223
|
-
return false;
|
|
224
|
-
}
|
|
225
|
-
if (ka.length !== kb.length) {
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
|
-
ka.sort();
|
|
229
|
-
kb.sort();
|
|
230
|
-
for (i = ka.length - 1; i >= 0; i--) {
|
|
231
|
-
if (ka[i] !== kb[i]) {
|
|
232
|
-
return false;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
for (i = ka.length - 1; i >= 0; i--) {
|
|
236
|
-
key = ka[i];
|
|
237
|
-
if (!this.DeepEquals(a[key], b[key])) {
|
|
238
|
-
return false;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
return typeof a === typeof b;
|
|
242
|
-
}
|
|
243
|
-
static _supportsArgumentsClass() {
|
|
244
|
-
return Object.prototype.toString.call(arguments) === "[object Arguments]";
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
exports.ObjectUtils = ObjectUtils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ObjectUtils = void 0;
|
|
4
|
+
const is_nill_function_1 = require("./function/is-nill.function");
|
|
5
|
+
const not_nill_function_1 = require("./function/not-nill.function");
|
|
6
|
+
class ObjectUtils {
|
|
7
|
+
static AllExist(...values) {
|
|
8
|
+
let allExist = true;
|
|
9
|
+
for (let i = 0, len = values.length; i < len; i++) {
|
|
10
|
+
if ((0, is_nill_function_1.isNill)(values[i])) {
|
|
11
|
+
allExist = false;
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return allExist;
|
|
16
|
+
}
|
|
17
|
+
static CopyPropertiesFrom(from, to, allowUndefined = true) {
|
|
18
|
+
if (!to) {
|
|
19
|
+
to = {};
|
|
20
|
+
}
|
|
21
|
+
if (!from) {
|
|
22
|
+
return to;
|
|
23
|
+
}
|
|
24
|
+
ObjectUtils.ForOwnProperty(from, (value, key) => {
|
|
25
|
+
if (allowUndefined || (0, not_nill_function_1.notNill)(value)) {
|
|
26
|
+
to[key] = value;
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
return to;
|
|
30
|
+
}
|
|
31
|
+
static DeepEquals(actual, expected) {
|
|
32
|
+
if (actual === expected) {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
else if (actual instanceof Date && expected instanceof Date) {
|
|
36
|
+
return actual.getTime() === expected.getTime();
|
|
37
|
+
}
|
|
38
|
+
else if (!actual || !expected || typeof actual !== "object" && typeof expected !== "object") {
|
|
39
|
+
return actual === expected;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
return this._objEquiv(actual, expected);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
static ForOwnProperty(plainObject, callback) {
|
|
46
|
+
if (ObjectUtils.IsPlainObject(plainObject)) {
|
|
47
|
+
for (const key in plainObject) {
|
|
48
|
+
if (plainObject.hasOwnProperty(key) && typeof plainObject[key] !== "function") {
|
|
49
|
+
const response = callback(plainObject[key], key);
|
|
50
|
+
if (response === false) {
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
static GetClassName(objectOrClass) {
|
|
58
|
+
if (!objectOrClass) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
else if (objectOrClass.constructor === Function) {
|
|
62
|
+
return objectOrClass.name;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
const constructorString = objectOrClass.constructor.toString();
|
|
66
|
+
return constructorString.match(/\w+/g)[1];
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
static GetShallowClone(originalObject, objectClass) {
|
|
70
|
+
let clonedObject = undefined;
|
|
71
|
+
if (objectClass) {
|
|
72
|
+
clonedObject = new objectClass();
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
clonedObject = {};
|
|
76
|
+
}
|
|
77
|
+
ObjectUtils.ForOwnProperty(originalObject, (value, key) => {
|
|
78
|
+
clonedObject[key] = value;
|
|
79
|
+
});
|
|
80
|
+
return clonedObject;
|
|
81
|
+
}
|
|
82
|
+
static GetDeepClone(originalObject, circular = true) {
|
|
83
|
+
let propertyIndex;
|
|
84
|
+
let descriptor;
|
|
85
|
+
let keys;
|
|
86
|
+
let current;
|
|
87
|
+
let nextSource;
|
|
88
|
+
let indexOf;
|
|
89
|
+
const copies = [{
|
|
90
|
+
source: originalObject,
|
|
91
|
+
target: Object.create(Object.getPrototypeOf(originalObject))
|
|
92
|
+
}];
|
|
93
|
+
const cloneObject = copies[0].target;
|
|
94
|
+
const sourceReferences = [originalObject];
|
|
95
|
+
const targetReferences = [cloneObject];
|
|
96
|
+
while (current = copies.shift()) {
|
|
97
|
+
keys = Object.getOwnPropertyNames(current.source);
|
|
98
|
+
for (propertyIndex = 0; propertyIndex < keys.length; propertyIndex++) {
|
|
99
|
+
descriptor = Object.getOwnPropertyDescriptor(current.source, keys[propertyIndex]);
|
|
100
|
+
if (!descriptor.value || typeof descriptor.value !== "object") {
|
|
101
|
+
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
nextSource = descriptor.value;
|
|
105
|
+
descriptor.value = Array.isArray(nextSource) ?
|
|
106
|
+
[] :
|
|
107
|
+
Object.create(Object.getPrototypeOf(nextSource));
|
|
108
|
+
if (circular) {
|
|
109
|
+
indexOf = sourceReferences.indexOf(nextSource);
|
|
110
|
+
if (indexOf !== -1) {
|
|
111
|
+
descriptor.value = targetReferences[indexOf];
|
|
112
|
+
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
sourceReferences.push(nextSource);
|
|
116
|
+
targetReferences.push(descriptor.value);
|
|
117
|
+
}
|
|
118
|
+
Object.defineProperty(current.target, keys[propertyIndex], descriptor);
|
|
119
|
+
copies.push({ source: nextSource, target: descriptor.value });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return cloneObject;
|
|
123
|
+
}
|
|
124
|
+
static IsEmpty(obj) {
|
|
125
|
+
return (0, is_nill_function_1.isNill)(obj) || Object.getOwnPropertyNames(obj).length === 0;
|
|
126
|
+
}
|
|
127
|
+
static IsPlainObject(object) {
|
|
128
|
+
return object !== null && !Array.isArray(object) && typeof object !== "function" && typeof object === "object";
|
|
129
|
+
}
|
|
130
|
+
static MakeInstanceOf(clazz, dataObject) {
|
|
131
|
+
if (dataObject instanceof clazz) {
|
|
132
|
+
return dataObject;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
const asClazz = new clazz();
|
|
136
|
+
ObjectUtils.CopyPropertiesFrom(dataObject, asClazz);
|
|
137
|
+
return asClazz;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
static PickRandomPropertyValue(object) {
|
|
141
|
+
if (!object) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
let result;
|
|
145
|
+
let count = 0;
|
|
146
|
+
for (const prop in object) {
|
|
147
|
+
if (object.hasOwnProperty(prop)) {
|
|
148
|
+
count++;
|
|
149
|
+
if (Math.random() < 1 / count) {
|
|
150
|
+
result = object[prop];
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
static ValueOrDefault(value, defaultReturnVal = "") {
|
|
157
|
+
return (0, not_nill_function_1.notNill)(value) ? value : defaultReturnVal;
|
|
158
|
+
}
|
|
159
|
+
static _isArguments(x) {
|
|
160
|
+
const supportsArgsClass = this._supportsArgumentsClass();
|
|
161
|
+
return supportsArgsClass ? this._isArgumentsWhenArgsClassSupported(x) : this._isArgumentsWhenArgsClassNotSupported(x);
|
|
162
|
+
}
|
|
163
|
+
static _isArgumentsWhenArgsClassNotSupported(object) {
|
|
164
|
+
return object &&
|
|
165
|
+
typeof object === "object" &&
|
|
166
|
+
typeof object.length === "number" &&
|
|
167
|
+
Object.prototype.hasOwnProperty.call(object, "callee") &&
|
|
168
|
+
!Object.prototype.propertyIsEnumerable.call(object, "callee") ||
|
|
169
|
+
false;
|
|
170
|
+
}
|
|
171
|
+
static _isArgumentsWhenArgsClassSupported(object) {
|
|
172
|
+
return Object.prototype.toString.call(object) === "[object Arguments]";
|
|
173
|
+
}
|
|
174
|
+
static _isBuffer(x) {
|
|
175
|
+
if (!x || typeof x !== "object" || typeof x.length !== "number") {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
if (typeof x.copy !== "function" || typeof x.slice !== "function") {
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
return !(x.length > 0 && typeof x[0] !== "number");
|
|
182
|
+
}
|
|
183
|
+
static _isUndefinedOrNull(value) {
|
|
184
|
+
return value === null || value === undefined;
|
|
185
|
+
}
|
|
186
|
+
static _objEquiv(a, b) {
|
|
187
|
+
let i, key;
|
|
188
|
+
if (this._isUndefinedOrNull(a) || this._isUndefinedOrNull(b)) {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
if (a.prototype !== b.prototype) {
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
if (this._isArguments(a)) {
|
|
195
|
+
if (!this._isArguments(b)) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
a = Array.prototype.slice.call(a);
|
|
199
|
+
b = Array.prototype.slice.call(b);
|
|
200
|
+
return this.DeepEquals(a, b);
|
|
201
|
+
}
|
|
202
|
+
if (this._isBuffer(a)) {
|
|
203
|
+
if (!this._isBuffer(b)) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
if (a.length !== b.length) {
|
|
207
|
+
return false;
|
|
208
|
+
}
|
|
209
|
+
for (i = 0; i < a.length; i++) {
|
|
210
|
+
if (a[i] !== b[i]) {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
return true;
|
|
215
|
+
}
|
|
216
|
+
let ka;
|
|
217
|
+
let kb;
|
|
218
|
+
try {
|
|
219
|
+
ka = Object.keys(a);
|
|
220
|
+
kb = Object.keys(b);
|
|
221
|
+
}
|
|
222
|
+
catch (e) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
if (ka.length !== kb.length) {
|
|
226
|
+
return false;
|
|
227
|
+
}
|
|
228
|
+
ka.sort();
|
|
229
|
+
kb.sort();
|
|
230
|
+
for (i = ka.length - 1; i >= 0; i--) {
|
|
231
|
+
if (ka[i] !== kb[i]) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
for (i = ka.length - 1; i >= 0; i--) {
|
|
236
|
+
key = ka[i];
|
|
237
|
+
if (!this.DeepEquals(a[key], b[key])) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return typeof a === typeof b;
|
|
242
|
+
}
|
|
243
|
+
static _supportsArgumentsClass() {
|
|
244
|
+
return Object.prototype.toString.call(arguments) === "[object Arguments]";
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
exports.ObjectUtils = ObjectUtils;
|
|
248
248
|
//# sourceMappingURL=object-utils.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare class ParameterValueConversionUtils {
|
|
2
|
-
static BoundsToRangeString(lowerBound: number, upperBound: number): string;
|
|
3
|
-
}
|
|
1
|
+
export declare class ParameterValueConversionUtils {
|
|
2
|
+
static BoundsToRangeString(lowerBound: number, upperBound: number): string;
|
|
3
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ParameterValueConversionUtils = void 0;
|
|
4
|
-
const java_constants_1 = require("../model/constant/java-constants");
|
|
5
|
-
class ParameterValueConversionUtils {
|
|
6
|
-
static BoundsToRangeString(lowerBound, upperBound) {
|
|
7
|
-
if (!lowerBound && !upperBound) {
|
|
8
|
-
return undefined;
|
|
9
|
-
}
|
|
10
|
-
if (!lowerBound) {
|
|
11
|
-
lowerBound = 0;
|
|
12
|
-
}
|
|
13
|
-
if (!upperBound) {
|
|
14
|
-
upperBound = java_constants_1.JAVA_MAX_INT;
|
|
15
|
-
}
|
|
16
|
-
return "" + lowerBound + " - " + upperBound;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.ParameterValueConversionUtils = ParameterValueConversionUtils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParameterValueConversionUtils = void 0;
|
|
4
|
+
const java_constants_1 = require("../model/constant/java-constants");
|
|
5
|
+
class ParameterValueConversionUtils {
|
|
6
|
+
static BoundsToRangeString(lowerBound, upperBound) {
|
|
7
|
+
if (!lowerBound && !upperBound) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
if (!lowerBound) {
|
|
11
|
+
lowerBound = 0;
|
|
12
|
+
}
|
|
13
|
+
if (!upperBound) {
|
|
14
|
+
upperBound = java_constants_1.JAVA_MAX_INT;
|
|
15
|
+
}
|
|
16
|
+
return "" + lowerBound + " - " + upperBound;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.ParameterValueConversionUtils = ParameterValueConversionUtils;
|
|
20
20
|
//# sourceMappingURL=parameter-value-conversion-utils.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare class PromiseUtils {
|
|
2
|
-
static TryUntilSucceed(what: {
|
|
3
|
-
(anything: any): Promise<any>;
|
|
4
|
-
}, delay: number, params?: any, tries?: number): Promise<any>;
|
|
5
|
-
static Wait(delay?: number): Promise<void>;
|
|
6
|
-
}
|
|
1
|
+
export declare class PromiseUtils {
|
|
2
|
+
static TryUntilSucceed(what: {
|
|
3
|
+
(anything: any): Promise<any>;
|
|
4
|
+
}, delay: number, params?: any, tries?: number): Promise<any>;
|
|
5
|
+
static Wait(delay?: number): Promise<void>;
|
|
6
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PromiseUtils = void 0;
|
|
4
|
-
class PromiseUtils {
|
|
5
|
-
static TryUntilSucceed(what, delay, params, tries) {
|
|
6
|
-
delay = Math.max(1, delay);
|
|
7
|
-
if (typeof tries !== 'undefined') {
|
|
8
|
-
tries--;
|
|
9
|
-
if (tries <= 0) {
|
|
10
|
-
return Promise.reject('NO MORE TRIES');
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
return what(params).catch(async () => {
|
|
14
|
-
await PromiseUtils.Wait(delay);
|
|
15
|
-
return PromiseUtils.TryUntilSucceed(what, delay, params, tries);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
static Wait(delay = 0) {
|
|
19
|
-
return new Promise(resolve => setTimeout(resolve, delay));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.PromiseUtils = PromiseUtils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PromiseUtils = void 0;
|
|
4
|
+
class PromiseUtils {
|
|
5
|
+
static TryUntilSucceed(what, delay, params, tries) {
|
|
6
|
+
delay = Math.max(1, delay);
|
|
7
|
+
if (typeof tries !== 'undefined') {
|
|
8
|
+
tries--;
|
|
9
|
+
if (tries <= 0) {
|
|
10
|
+
return Promise.reject('NO MORE TRIES');
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return what(params).catch(async () => {
|
|
14
|
+
await PromiseUtils.Wait(delay);
|
|
15
|
+
return PromiseUtils.TryUntilSucceed(what, delay, params, tries);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
static Wait(delay = 0) {
|
|
19
|
+
return new Promise(resolve => setTimeout(resolve, delay));
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.PromiseUtils = PromiseUtils;
|
|
23
23
|
//# sourceMappingURL=promise-utils.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare class RefCodeUtils {
|
|
2
|
-
static Check(valueToCheck: number, powTwoNumToCheckAgainst: number): boolean;
|
|
3
|
-
static CheckAny(valueToCheck: number, ...powTwoNumsToCheckAgainst: number[]): boolean;
|
|
4
|
-
}
|
|
1
|
+
export declare class RefCodeUtils {
|
|
2
|
+
static Check(valueToCheck: number, powTwoNumToCheckAgainst: number): boolean;
|
|
3
|
+
static CheckAny(valueToCheck: number, ...powTwoNumsToCheckAgainst: number[]): boolean;
|
|
4
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RefCodeUtils = void 0;
|
|
4
|
-
const number_utils_1 = require("./number-utils");
|
|
5
|
-
class RefCodeUtils {
|
|
6
|
-
static Check(valueToCheck, powTwoNumToCheckAgainst) {
|
|
7
|
-
return number_utils_1.NumberUtils.NumIsComposedOfOtherPowTwoNum(valueToCheck, powTwoNumToCheckAgainst);
|
|
8
|
-
}
|
|
9
|
-
static CheckAny(valueToCheck, ...powTwoNumsToCheckAgainst) {
|
|
10
|
-
const len = powTwoNumsToCheckAgainst.length;
|
|
11
|
-
for (let i = 0; i < len; i++) {
|
|
12
|
-
if (RefCodeUtils.Check(valueToCheck, powTwoNumsToCheckAgainst[i])) {
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.RefCodeUtils = RefCodeUtils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RefCodeUtils = void 0;
|
|
4
|
+
const number_utils_1 = require("./number-utils");
|
|
5
|
+
class RefCodeUtils {
|
|
6
|
+
static Check(valueToCheck, powTwoNumToCheckAgainst) {
|
|
7
|
+
return number_utils_1.NumberUtils.NumIsComposedOfOtherPowTwoNum(valueToCheck, powTwoNumToCheckAgainst);
|
|
8
|
+
}
|
|
9
|
+
static CheckAny(valueToCheck, ...powTwoNumsToCheckAgainst) {
|
|
10
|
+
const len = powTwoNumsToCheckAgainst.length;
|
|
11
|
+
for (let i = 0; i < len; i++) {
|
|
12
|
+
if (RefCodeUtils.Check(valueToCheck, powTwoNumsToCheckAgainst[i])) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.RefCodeUtils = RefCodeUtils;
|
|
20
20
|
//# sourceMappingURL=ref-code-utils.js.map
|