@colijnit/ioneconnector 261.1.4 → 261.1.6
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 +33 -33
- package/build/connector.js +79 -79
- package/build/connector.js.map +1 -1
- 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/activate-user-account-status.enum.js.map +1 -1
- package/build/enum/address-format.enum.d.ts +4 -4
- package/build/enum/address-format.enum.js +8 -8
- package/build/enum/address-format.enum.js.map +1 -1
- 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-language-code.enum.js.map +1 -1
- package/build/enum/backend-service-name.enum.d.ts +7 -7
- package/build/enum/backend-service-name.enum.js +11 -11
- package/build/enum/backend-service-name.enum.js.map +1 -1
- package/build/enum/communication-type.enum.d.ts +8 -8
- package/build/enum/communication-type.enum.js +12 -12
- package/build/enum/communication-type.enum.js.map +1 -1
- package/build/enum/datasession-service-method.enum.d.ts +13 -13
- package/build/enum/datasession-service-method.enum.js +17 -17
- package/build/enum/datasession-service-method.enum.js.map +1 -1
- 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/db-boolean-value-type.enum.js.map +1 -1
- package/build/enum/end-point.enum.d.ts +4 -4
- package/build/enum/end-point.enum.js +8 -8
- package/build/enum/end-point.enum.js.map +1 -1
- package/build/enum/external-method.enum.d.ts +22 -22
- package/build/enum/external-method.enum.js +26 -26
- package/build/enum/external-method.enum.js.map +1 -1
- 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-internal.enum.js.map +1 -1
- package/build/enum/file-type.enum.d.ts +5 -5
- package/build/enum/file-type.enum.js +9 -9
- package/build/enum/file-type.enum.js.map +1 -1
- package/build/enum/filter-type.enum.d.ts +4 -4
- package/build/enum/filter-type.enum.js +8 -8
- package/build/enum/filter-type.enum.js.map +1 -1
- package/build/enum/health-service-method.enum.d.ts +3 -3
- package/build/enum/health-service-method.enum.js +7 -7
- package/build/enum/health-service-method.enum.js.map +1 -1
- package/build/enum/language-code.enum.d.ts +7 -7
- package/build/enum/language-code.enum.js +11 -11
- package/build/enum/language-code.enum.js.map +1 -1
- package/build/enum/login-service-method.enum.d.ts +25 -25
- package/build/enum/login-service-method.enum.js +29 -29
- package/build/enum/login-service-method.enum.js.map +1 -1
- package/build/enum/login-status.enum.d.ts +20 -20
- package/build/enum/login-status.enum.js +24 -24
- package/build/enum/login-status.enum.js.map +1 -1
- package/build/enum/message-type.enum.d.ts +6 -6
- package/build/enum/message-type.enum.js +10 -10
- package/build/enum/message-type.enum.js.map +1 -1
- package/build/enum/object-config-kind.d.ts +9 -9
- package/build/enum/object-config-kind.js +13 -13
- package/build/enum/object-config-kind.js.map +1 -1
- 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-data-type.enum.js.map +1 -1
- 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-configuration-value-type.enum.js.map +1 -1
- package/build/enum/object-right-type.enum.d.ts +5 -5
- package/build/enum/object-right-type.enum.js +9 -9
- package/build/enum/object-right-type.enum.js.map +1 -1
- 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/one-zero-bool-db-type.enum.js.map +1 -1
- package/build/enum/public-service-method.enum.d.ts +6 -5
- package/build/enum/public-service-method.enum.js +10 -9
- package/build/enum/public-service-method.enum.js.map +1 -1
- package/build/enum/reset-password-status.enum.d.ts +5 -5
- package/build/enum/reset-password-status.enum.js +9 -9
- package/build/enum/reset-password-status.enum.js.map +1 -1
- 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-data-type.enum.js.map +1 -1
- package/build/enum/search-property-state.enum.d.ts +5 -5
- package/build/enum/search-property-state.enum.js +9 -9
- package/build/enum/search-property-state.enum.js.map +1 -1
- package/build/enum/sort-direction.d.ts +5 -5
- package/build/enum/sort-direction.js +12 -12
- package/build/enum/sort-direction.js.map +1 -1
- package/build/enum/sort-type.enum.d.ts +6 -6
- package/build/enum/sort-type.enum.js +10 -10
- package/build/enum/sort-type.enum.js.map +1 -1
- 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/true-false-db-type.enum.js.map +1 -1
- 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-info-service-method.enum.js.map +1 -1
- 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-right-type.enum.js.map +1 -1
- package/build/enum/user-role-type.enum.d.ts +17 -17
- package/build/enum/user-role-type.enum.js +21 -21
- package/build/enum/user-role-type.enum.js.map +1 -1
- package/build/enum/value-comparison-type.enum.d.ts +15 -15
- package/build/enum/value-comparison-type.enum.js +31 -31
- package/build/enum/value-comparison-type.enum.js.map +1 -1
- 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/enum/yes-no-db-type.enum.js.map +1 -1
- package/build/factory/business-object-serializer.d.ts +11 -11
- package/build/factory/business-object-serializer.js +145 -145
- package/build/factory/business-object-serializer.js.map +1 -1
- 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-factory-step.decorator.js.map +1 -1
- 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/bo-serializer-step.decorator.js.map +1 -1
- package/build/factory/decorators/boolean.decorator.d.ts +12 -12
- package/build/factory/decorators/boolean.decorator.js +73 -73
- package/build/factory/decorators/boolean.decorator.js.map +1 -1
- 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/business-object-data.decorator.js.map +1 -1
- 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/co-inject.decorator.js.map +1 -1
- 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-array.decorator.js.map +1 -1
- 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/complex-field.decorator.js.map +1 -1
- 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/date-field.decorator.js.map +1 -1
- 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-field-alias.decorator.js.map +1 -1
- 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-method-value.decorator.js.map +1 -1
- 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/db-number.decorator.js.map +1 -1
- 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/default-send-value.decorator.js.map +1 -1
- 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/exclude-when-empty-string.decorator.js.map +1 -1
- package/build/factory/decorators/json.decorator.d.ts +6 -6
- package/build/factory/decorators/json.decorator.js +26 -26
- package/build/factory/decorators/json.decorator.js.map +1 -1
- 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/map-property.decorator.js.map +1 -1
- 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/no-db-field.decorator.js.map +1 -1
- 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/number-string.decorator.js.map +1 -1
- 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-method-tag.decorator.js.map +1 -1
- 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/simple-property-tag.decorator.js.map +1 -1
- 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/string-number.decorator.js.map +1 -1
- package/build/factory/decorators/validate.decorator.d.ts +11 -11
- package/build/factory/decorators/validate.decorator.js +55 -55
- package/build/factory/decorators/validate.decorator.js.map +1 -1
- package/build/interface/address-common-shape.interface.d.ts +14 -14
- package/build/interface/address-common-shape.interface.js +2 -2
- package/build/interface/authorized-axios-request-config.interface.d.ts +5 -0
- package/build/interface/authorized-axios-request-config.interface.js +3 -0
- package/build/interface/authorized-axios-request-config.interface.js.map +1 -0
- 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 +12 -12
- 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-data.js.map +1 -1
- 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-validation.js.map +1 -1
- 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 +6 -6
- package/build/model/local-storage-schema-object.js +9 -9
- package/build/model/local-storage-user-object.d.ts +12 -11
- package/build/model/local-storage-user-object.js +9 -9
- package/build/model/local-storage-user-object.js.map +1 -1
- package/build/model/login-request.d.ts +17 -16
- 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-request.js.map +1 -1
- 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-response.js.map +1 -1
- 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/object-configuration.js.map +1 -1
- package/build/model/options.d.ts +29 -29
- 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/paging-parameters.js.map +1 -1
- 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.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-message.js.map +1 -1
- 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/model/validation-result.js.map +1 -1
- package/build/provider/ajax.service.d.ts +44 -38
- package/build/provider/ajax.service.js +435 -381
- package/build/provider/ajax.service.js.map +1 -1
- package/build/provider/base-backend-connection.service.d.ts +47 -47
- package/build/provider/base-backend-connection.service.js +187 -188
- package/build/provider/base-backend-connection.service.js.map +1 -1
- package/build/service/business-object-factory.d.ts +13 -13
- package/build/service/business-object-factory.js +235 -235
- package/build/service/business-object-factory.js.map +1 -1
- package/build/service/datasession.service.d.ts +9 -9
- package/build/service/datasession.service.js +26 -26
- package/build/service/datasession.service.js.map +1 -1
- package/build/service/encrypt.service.d.ts +6 -6
- package/build/service/encrypt.service.js +30 -30
- package/build/service/encrypt.service.js.map +1 -1
- 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 +8 -7
- package/build/service/external-jwt-token.service.js +21 -17
- package/build/service/external-jwt-token.service.js.map +1 -1
- package/build/service/health.service.d.ts +10 -10
- package/build/service/health.service.js +36 -34
- package/build/service/health.service.js.map +1 -1
- package/build/service/internal-jwt-token.service.d.ts +11 -8
- package/build/service/internal-jwt-token.service.js +57 -40
- package/build/service/internal-jwt-token.service.js.map +1 -1
- package/build/service/jwt-token.service.d.ts +15 -12
- package/build/service/jwt-token.service.js +45 -32
- package/build/service/jwt-token.service.js.map +1 -1
- package/build/service/local-storage.service.d.ts +39 -37
- package/build/service/local-storage.service.js +261 -248
- package/build/service/local-storage.service.js.map +1 -1
- package/build/service/login.service.d.ts +50 -50
- package/build/service/login.service.js +312 -321
- package/build/service/login.service.js.map +1 -1
- package/build/service/public.service.d.ts +12 -12
- package/build/service/public.service.js +33 -36
- package/build/service/public.service.js.map +1 -1
- package/build/service/storage.service.d.ts +35 -33
- package/build/service/storage.service.js +100 -94
- package/build/service/storage.service.js.map +1 -1
- package/build/service/user-info.service.d.ts +9 -9
- package/build/service/user-info.service.js +34 -33
- package/build/service/user-info.service.js.map +1 -1
- 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/business-object-id-type.js.map +1 -1
- 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/array-utils.js.map +1 -1
- package/build/utils/business-object-utils.d.ts +20 -20
- package/build/utils/business-object-utils.js +198 -198
- package/build/utils/business-object-utils.js.map +1 -1
- package/build/utils/date-utils.d.ts +5 -5
- package/build/utils/date-utils.js +24 -24
- package/build/utils/date-utils.js.map +1 -1
- package/build/utils/file-utils.d.ts +6 -6
- package/build/utils/file-utils.js +66 -66
- package/build/utils/file-utils.js.map +1 -1
- package/build/utils/function/any-nill.function.d.ts +1 -1
- package/build/utils/function/any-nill.function.js +15 -16
- package/build/utils/function/any-nill.function.js.map +1 -1
- package/build/utils/function/is-nill.function.d.ts +1 -1
- package/build/utils/function/is-nill.function.js +6 -7
- package/build/utils/function/is-nill.function.js.map +1 -1
- package/build/utils/function/not-nill.function.d.ts +1 -1
- package/build/utils/function/not-nill.function.js +6 -7
- package/build/utils/function/not-nill.function.js.map +1 -1
- package/build/utils/function-utils.d.ts +4 -4
- package/build/utils/function-utils.js +31 -31
- package/build/utils/function-utils.js.map +1 -1
- package/build/utils/image-utils.d.ts +4 -4
- package/build/utils/image-utils.js +28 -28
- package/build/utils/image-utils.js.map +1 -1
- package/build/utils/map-utils.d.ts +4 -4
- package/build/utils/map-utils.js +31 -31
- package/build/utils/map-utils.js.map +1 -1
- package/build/utils/number-utils.d.ts +39 -39
- package/build/utils/number-utils.js +268 -268
- package/build/utils/number-utils.js.map +1 -1
- package/build/utils/object-utils.d.ts +21 -21
- package/build/utils/object-utils.js +247 -247
- package/build/utils/object-utils.js.map +1 -1
- package/build/utils/parameter-value-conversion-utils.d.ts +3 -3
- package/build/utils/parameter-value-conversion-utils.js +19 -19
- package/build/utils/parameter-value-conversion-utils.js.map +1 -1
- package/build/utils/promise-utils.d.ts +6 -6
- package/build/utils/promise-utils.js +22 -22
- package/build/utils/promise-utils.js.map +1 -1
- package/build/utils/ref-code-utils.d.ts +4 -4
- package/build/utils/ref-code-utils.js +19 -19
- package/build/utils/ref-code-utils.js.map +1 -1
- package/build/utils/sort-utils.d.ts +12 -12
- package/build/utils/sort-utils.js +120 -120
- package/build/utils/sort-utils.js.map +1 -1
- package/build/utils/string-utils.d.ts +25 -25
- package/build/utils/string-utils.js +212 -212
- package/build/utils/string-utils.js.map +1 -1
- package/build/utils/url-utils.d.ts +4 -4
- package/build/utils/url-utils.js +33 -33
- package/build/utils/url-utils.js.map +1 -1
- package/build/validators/communication-type.validator.d.ts +1 -1
- package/build/validators/communication-type.validator.js +15 -16
- package/build/validators/communication-type.validator.js.map +1 -1
- package/build/validators/email.validator.d.ts +2 -2
- package/build/validators/email.validator.js +8 -9
- package/build/validators/email.validator.js.map +1 -1
- package/build/validators/empty-address.validator.d.ts +3 -3
- package/build/validators/empty-address.validator.js +11 -12
- package/build/validators/empty-address.validator.js.map +1 -1
- package/build/validators/empty-array.validator.d.ts +2 -2
- package/build/validators/empty-array.validator.js +13 -14
- package/build/validators/empty-array.validator.js.map +1 -1
- package/build/validators/end-date-equal.validator.d.ts +1 -1
- package/build/validators/end-date-equal.validator.js +16 -17
- package/build/validators/end-date-equal.validator.js.map +1 -1
- package/build/validators/end-date.validator.d.ts +1 -1
- package/build/validators/end-date.validator.js +16 -17
- package/build/validators/end-date.validator.js.map +1 -1
- package/build/validators/equal.validator.d.ts +2 -2
- package/build/validators/equal.validator.js +13 -14
- package/build/validators/equal.validator.js.map +1 -1
- package/build/validators/max-string-length.validator.d.ts +2 -2
- package/build/validators/max-string-length.validator.js +12 -13
- package/build/validators/max-string-length.validator.js.map +1 -1
- package/build/validators/nl-post-code.validator.d.ts +3 -3
- package/build/validators/nl-post-code.validator.js +13 -14
- package/build/validators/nl-post-code.validator.js.map +1 -1
- package/build/validators/password.validator.d.ts +3 -3
- package/build/validators/password.validator.js +32 -33
- package/build/validators/password.validator.js.map +1 -1
- package/build/validators/postal-code-function.validator.d.ts +2 -2
- package/build/validators/postal-code-function.validator.js +18 -19
- package/build/validators/postal-code-function.validator.js.map +1 -1
- package/build/validators/postal-code.validator.d.ts +1 -1
- package/build/validators/postal-code.validator.js +20 -21
- package/build/validators/postal-code.validator.js.map +1 -1
- package/build/validators/precision-scale.validator.d.ts +2 -2
- package/build/validators/precision-scale.validator.js +13 -14
- package/build/validators/precision-scale.validator.js.map +1 -1
- package/build/validators/required.validator.d.ts +2 -2
- package/build/validators/required.validator.js +7 -8
- package/build/validators/required.validator.js.map +1 -1
- package/build/validators/social-security-number.validator.d.ts +2 -2
- package/build/validators/social-security-number.validator.js +27 -28
- package/build/validators/social-security-number.validator.js.map +1 -1
- package/build/validators/space-trim.validator.d.ts +2 -2
- package/build/validators/space-trim.validator.js +11 -12
- package/build/validators/space-trim.validator.js.map +1 -1
- package/build/validators/true.validator.d.ts +2 -2
- package/build/validators/true.validator.js +7 -8
- package/build/validators/true.validator.js.map +1 -1
- package/package.json +8 -8
|
@@ -1,376 +1,376 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArrayUtils = void 0;
|
|
4
|
-
const not_nill_function_1 = require("./function/not-nill.function");
|
|
5
|
-
const number_utils_1 = require("./number-utils");
|
|
6
|
-
const is_nill_function_1 = require("./function/is-nill.function");
|
|
7
|
-
const object_utils_1 = require("./object-utils");
|
|
8
|
-
const string_utils_1 = require("./string-utils");
|
|
9
|
-
const map_utils_1 = require("./map-utils");
|
|
10
|
-
class ArrayUtils {
|
|
11
|
-
static InsertElement(index, element, array) {
|
|
12
|
-
if (!Array.isArray(array) || Math.abs(index) > array.length || (0, is_nill_function_1.isNill)(index)) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
const lenBefore = array.length;
|
|
16
|
-
array.splice(index, 0, element);
|
|
17
|
-
return (array.length === lenBefore + 1);
|
|
18
|
-
}
|
|
19
|
-
static InsertElementRightOf(rightOfItem, itemToInsert, array) {
|
|
20
|
-
if (array) {
|
|
21
|
-
ArrayUtils.InsertElement(array.indexOf(rightOfItem) + 1, itemToInsert, array);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
static RemoveElement(element, array) {
|
|
25
|
-
if (!Array.isArray(array)) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
const index = array.indexOf(element);
|
|
29
|
-
return ArrayUtils.RemoveElementAtIndex(index, array);
|
|
30
|
-
}
|
|
31
|
-
static MoveElement(element, toIndex, array) {
|
|
32
|
-
if (!Array.isArray(array) || (0, is_nill_function_1.isNill)(toIndex)) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
const fromIndex = array.indexOf(element);
|
|
36
|
-
const toIndexCorrected = number_utils_1.NumberUtils.GetNearestNumberWithinBounds(toIndex, 0, array.length - 1);
|
|
37
|
-
if (fromIndex === -1 || array[toIndexCorrected] === element) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
array.splice(toIndexCorrected, 0, array.splice(fromIndex, 1)[0]);
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
static SwapElements(elementOne, elementTwo, array) {
|
|
44
|
-
if (!Array.isArray(array)) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
const elOneIdx = array.indexOf(elementTwo);
|
|
48
|
-
const elTwoIdx = array.indexOf(elementOne);
|
|
49
|
-
if (elOneIdx === -1 || elTwoIdx === -1) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
array[elOneIdx] = array.splice(elTwoIdx, 1, array[elOneIdx])[0];
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
static RemoveElementAtIndex(index, array) {
|
|
56
|
-
if (number_utils_1.NumberUtils.IsNaN(index) || index < 0 || !Array.isArray(array) || array.length === 0) {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
if (index in array) {
|
|
60
|
-
array.splice(index, 1);
|
|
61
|
-
return true;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
static RemoveElementsByFilter(array, filterFunction) {
|
|
68
|
-
if (!ArrayUtils.IsArrayWithElements(array) || !filterFunction) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
let atLeastOneRemoved = false;
|
|
72
|
-
const len = array.length;
|
|
73
|
-
for (let i = len - 1; i >= 0; i--) {
|
|
74
|
-
const item = array[i];
|
|
75
|
-
if (filterFunction.call(this, item) === true) {
|
|
76
|
-
array.splice(i, 1);
|
|
77
|
-
atLeastOneRemoved = true;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return atLeastOneRemoved;
|
|
81
|
-
}
|
|
82
|
-
static RemoveLastElementOf(array) {
|
|
83
|
-
if (!array) {
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
return ArrayUtils.RemoveElementAtIndex(array.length - 1, array);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
static ReplaceElement(elementIn, elementOut, array) {
|
|
91
|
-
if (!array || !Array.isArray(array)) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const indexOut = array.indexOf(elementOut);
|
|
95
|
-
if (indexOut > -1) {
|
|
96
|
-
ArrayUtils.InsertElement(indexOut, elementIn, array);
|
|
97
|
-
ArrayUtils.RemoveElement(elementOut, array);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
static ToggleElement(toggle, elements) {
|
|
101
|
-
elements.indexOf(toggle) > -1 ? ArrayUtils.RemoveElement(toggle, elements) : elements.push(toggle);
|
|
102
|
-
}
|
|
103
|
-
static ContainsAnElementFoundBy(array, finder) {
|
|
104
|
-
if (!array || !finder) {
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
|
-
return (0, not_nill_function_1.notNill)(this.Find(array, finder));
|
|
108
|
-
}
|
|
109
|
-
static Find(array, foundBy) {
|
|
110
|
-
if (!array || !foundBy) {
|
|
111
|
-
return undefined;
|
|
112
|
-
}
|
|
113
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
114
|
-
const itemCur = array[i];
|
|
115
|
-
if (foundBy(itemCur)) {
|
|
116
|
-
return itemCur;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return undefined;
|
|
120
|
-
}
|
|
121
|
-
static FindAll(array, foundBy) {
|
|
122
|
-
const answer = [];
|
|
123
|
-
if (!array || !foundBy) {
|
|
124
|
-
return answer;
|
|
125
|
-
}
|
|
126
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
127
|
-
const itemCur = array[i];
|
|
128
|
-
if (foundBy(itemCur)) {
|
|
129
|
-
answer.push(itemCur);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return answer;
|
|
133
|
-
}
|
|
134
|
-
static GetMaxCalculatedValue(array, itemValueFunction) {
|
|
135
|
-
if (!array || !itemValueFunction) {
|
|
136
|
-
return NaN;
|
|
137
|
-
}
|
|
138
|
-
let max = undefined;
|
|
139
|
-
const len = array.length;
|
|
140
|
-
for (let i = 0; i < len; i++) {
|
|
141
|
-
const valueCur = itemValueFunction.call(this, array[i]);
|
|
142
|
-
if (!max || valueCur > max) {
|
|
143
|
-
max = valueCur;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return max;
|
|
147
|
-
}
|
|
148
|
-
static FillUntilLength(array, requiredLength, fillerElement = undefined) {
|
|
149
|
-
if (!array || !requiredLength) {
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
if (array.length >= requiredLength) {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
const spotsRemaining = requiredLength - array.length;
|
|
156
|
-
for (let i = 0; i < spotsRemaining; i++) {
|
|
157
|
-
array.push(fillerElement);
|
|
158
|
-
}
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
static GetNthElementInPossiblySparseArray(array, elementNumber) {
|
|
162
|
-
if (!array || !elementNumber || elementNumber < 1) {
|
|
163
|
-
return undefined;
|
|
164
|
-
}
|
|
165
|
-
return this._AsDenseArray(array)[elementNumber - 1];
|
|
166
|
-
}
|
|
167
|
-
static GetFirstElementInPossiblySparseArray(array) {
|
|
168
|
-
return this.GetNthElementInPossiblySparseArray(array, 1);
|
|
169
|
-
}
|
|
170
|
-
static GetSecondElementInPossiblySparseArray(array) {
|
|
171
|
-
return this.GetNthElementInPossiblySparseArray(array, 2);
|
|
172
|
-
}
|
|
173
|
-
static GetNumberOfElementsInPossiblySparseArray(array) {
|
|
174
|
-
if (!array) {
|
|
175
|
-
return undefined;
|
|
176
|
-
}
|
|
177
|
-
return this._AsDenseArray(array).length;
|
|
178
|
-
}
|
|
179
|
-
static CountWhere(array, whereFunction) {
|
|
180
|
-
if (!ArrayUtils.IsArrayWithElements(array) || !whereFunction) {
|
|
181
|
-
return 0;
|
|
182
|
-
}
|
|
183
|
-
let count = 0;
|
|
184
|
-
const len = array.length;
|
|
185
|
-
for (let i = 0; i < len; i++) {
|
|
186
|
-
if (whereFunction.call(this, array[i])) {
|
|
187
|
-
count++;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return count;
|
|
191
|
-
}
|
|
192
|
-
static SortAlphabetically(theArray, propertyName = undefined, reverseOrder = false) {
|
|
193
|
-
if (!theArray || !Array.isArray(theArray)) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
const switcher = reverseOrder ? -1 : 1;
|
|
197
|
-
const stringSort = string_utils_1.StringUtils.IsStringWithLength(propertyName);
|
|
198
|
-
theArray.sort((itemOne, itemTwo) => {
|
|
199
|
-
const valOne = stringSort ? itemOne[propertyName] : itemOne;
|
|
200
|
-
const valTwo = stringSort ? itemTwo[propertyName] : itemTwo;
|
|
201
|
-
return (valOne > valTwo ? 1 : (valOne < valTwo ? -1 : 0)) * switcher;
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
static Shuffle(theArray) {
|
|
205
|
-
if (!theArray || !Array.isArray(theArray)) {
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
let counter = theArray.length;
|
|
209
|
-
while (counter > 0) {
|
|
210
|
-
const index = Math.floor(Math.random() * counter);
|
|
211
|
-
counter--;
|
|
212
|
-
const temp = theArray[counter];
|
|
213
|
-
theArray[counter] = theArray[index];
|
|
214
|
-
theArray[index] = temp;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
static GetGroupBy(theArray, groupByProp) {
|
|
218
|
-
const map = new Map();
|
|
219
|
-
if (!theArray || theArray.length === 0 || !groupByProp) {
|
|
220
|
-
return map;
|
|
221
|
-
}
|
|
222
|
-
theArray.forEach((item) => {
|
|
223
|
-
const propValue = item[groupByProp];
|
|
224
|
-
if (Array.isArray(propValue)) {
|
|
225
|
-
const len = propValue.length;
|
|
226
|
-
for (let i = 0; i < len; i++) {
|
|
227
|
-
const propValCur = propValue[i];
|
|
228
|
-
map_utils_1.MapUtils.InsertArrayItemIntoMap(map, propValCur, item);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
map_utils_1.MapUtils.InsertArrayItemIntoMap(map, propValue, item);
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
return map;
|
|
236
|
-
}
|
|
237
|
-
static ContainAllEqualElements(arrayOne, arrayTwo) {
|
|
238
|
-
if (!arrayOne || !arrayTwo || arrayOne.length !== arrayTwo.length) {
|
|
239
|
-
return false;
|
|
240
|
-
}
|
|
241
|
-
for (let i = 0, len = arrayOne.length; i < len; i++) {
|
|
242
|
-
if (arrayOne[i] !== arrayTwo[i]) {
|
|
243
|
-
return false;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
return true;
|
|
247
|
-
}
|
|
248
|
-
static ContainAnyEqualElements(arrayOne, arrayTwo) {
|
|
249
|
-
if (!arrayOne || !arrayTwo) {
|
|
250
|
-
return false;
|
|
251
|
-
}
|
|
252
|
-
const lenOne = arrayOne.length;
|
|
253
|
-
for (let indexOne = 0; indexOne < lenOne; indexOne++) {
|
|
254
|
-
const itemOne = arrayOne[indexOne];
|
|
255
|
-
const lenTwo = arrayTwo.length;
|
|
256
|
-
for (let i = 0; i < lenTwo; i++) {
|
|
257
|
-
if (itemOne === arrayTwo[i]) {
|
|
258
|
-
return true;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
return false;
|
|
263
|
-
}
|
|
264
|
-
static IsArrayWithElements(arrayToCheck, classItemsMustBeInstanceOf) {
|
|
265
|
-
if ((0, is_nill_function_1.isNill)(arrayToCheck)) {
|
|
266
|
-
return false;
|
|
267
|
-
}
|
|
268
|
-
if (Array.isArray(arrayToCheck) && arrayToCheck.length > 0) {
|
|
269
|
-
if (classItemsMustBeInstanceOf) {
|
|
270
|
-
return arrayToCheck[0] instanceof classItemsMustBeInstanceOf;
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
return true;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
else {
|
|
277
|
-
return false;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
static IsEmptyArray(arrayToCheck) {
|
|
281
|
-
return !!arrayToCheck && Array.isArray(arrayToCheck) && arrayToCheck.length === 0;
|
|
282
|
-
}
|
|
283
|
-
static SearchFor(array, id, property) {
|
|
284
|
-
if (array && array.hasOwnProperty("length") && (string_utils_1.StringUtils.IsStringWithLength(id) || number_utils_1.NumberUtils.IsNumber(id))) {
|
|
285
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
286
|
-
const subject = array[i];
|
|
287
|
-
if (property) {
|
|
288
|
-
if (subject[property] === id) {
|
|
289
|
-
return subject;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
else if (typeof subject["getId"] === "function") {
|
|
293
|
-
if (subject["getId"]() === id) {
|
|
294
|
-
return subject;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
if (subject["id"] === id) {
|
|
299
|
-
return subject;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
static ArrayToString(array) {
|
|
306
|
-
if (!array) {
|
|
307
|
-
return "";
|
|
308
|
-
}
|
|
309
|
-
let returnStr = "";
|
|
310
|
-
const len = array.length;
|
|
311
|
-
for (let i = 0; i < len; i++) {
|
|
312
|
-
returnStr += array[i].toString() + ", ";
|
|
313
|
-
}
|
|
314
|
-
returnStr = string_utils_1.StringUtils.RemoveLastChars(returnStr, 2);
|
|
315
|
-
return returnStr;
|
|
316
|
-
}
|
|
317
|
-
static PushIfNotExist(item, array) {
|
|
318
|
-
if (!array) {
|
|
319
|
-
return false;
|
|
320
|
-
}
|
|
321
|
-
if (array.indexOf(item) === -1) {
|
|
322
|
-
array.push(item);
|
|
323
|
-
return true;
|
|
324
|
-
}
|
|
325
|
-
return false;
|
|
326
|
-
}
|
|
327
|
-
static CloneArray(array) {
|
|
328
|
-
let answer = [];
|
|
329
|
-
if (array) {
|
|
330
|
-
answer = array.slice(0);
|
|
331
|
-
}
|
|
332
|
-
return answer;
|
|
333
|
-
}
|
|
334
|
-
static CloneArrayAndItsItems(array, arrayItemsClass, deepClone = false) {
|
|
335
|
-
const cloneArray = [];
|
|
336
|
-
if (array) {
|
|
337
|
-
for (let i = 0, len = array.length; i < len; i++) {
|
|
338
|
-
if (deepClone) {
|
|
339
|
-
cloneArray.push(object_utils_1.ObjectUtils.GetDeepClone(array[i]));
|
|
340
|
-
}
|
|
341
|
-
else {
|
|
342
|
-
cloneArray.push(object_utils_1.ObjectUtils.GetShallowClone(array[i], arrayItemsClass));
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
return [];
|
|
348
|
-
}
|
|
349
|
-
return cloneArray;
|
|
350
|
-
}
|
|
351
|
-
static LengthOf(array) {
|
|
352
|
-
return !!array ? array.length : 0;
|
|
353
|
-
}
|
|
354
|
-
static PlaceElementAfterOther(array, elementToPlace, afterThisElement) {
|
|
355
|
-
if (array) {
|
|
356
|
-
const afterThisElIdx = array.indexOf(afterThisElement);
|
|
357
|
-
const elToPlaceIdx = array.indexOf(elementToPlace);
|
|
358
|
-
if (afterThisElIdx >= elToPlaceIdx) {
|
|
359
|
-
ArrayUtils.MoveElement(elementToPlace, afterThisElIdx + 1, array);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
static ConvertIntoFlatArray(array) {
|
|
364
|
-
return array.reduce((acc, val) => acc.concat(val), []);
|
|
365
|
-
}
|
|
366
|
-
static _AsDenseArray(sparseArray) {
|
|
367
|
-
if (!sparseArray) {
|
|
368
|
-
return [];
|
|
369
|
-
}
|
|
370
|
-
return sparseArray.filter((item) => {
|
|
371
|
-
return item !== undefined && item !== null;
|
|
372
|
-
});
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
exports.ArrayUtils = ArrayUtils;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArrayUtils = void 0;
|
|
4
|
+
const not_nill_function_1 = require("./function/not-nill.function");
|
|
5
|
+
const number_utils_1 = require("./number-utils");
|
|
6
|
+
const is_nill_function_1 = require("./function/is-nill.function");
|
|
7
|
+
const object_utils_1 = require("./object-utils");
|
|
8
|
+
const string_utils_1 = require("./string-utils");
|
|
9
|
+
const map_utils_1 = require("./map-utils");
|
|
10
|
+
class ArrayUtils {
|
|
11
|
+
static InsertElement(index, element, array) {
|
|
12
|
+
if (!Array.isArray(array) || Math.abs(index) > array.length || (0, is_nill_function_1.isNill)(index)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
const lenBefore = array.length;
|
|
16
|
+
array.splice(index, 0, element);
|
|
17
|
+
return (array.length === lenBefore + 1);
|
|
18
|
+
}
|
|
19
|
+
static InsertElementRightOf(rightOfItem, itemToInsert, array) {
|
|
20
|
+
if (array) {
|
|
21
|
+
ArrayUtils.InsertElement(array.indexOf(rightOfItem) + 1, itemToInsert, array);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
static RemoveElement(element, array) {
|
|
25
|
+
if (!Array.isArray(array)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
const index = array.indexOf(element);
|
|
29
|
+
return ArrayUtils.RemoveElementAtIndex(index, array);
|
|
30
|
+
}
|
|
31
|
+
static MoveElement(element, toIndex, array) {
|
|
32
|
+
if (!Array.isArray(array) || (0, is_nill_function_1.isNill)(toIndex)) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
const fromIndex = array.indexOf(element);
|
|
36
|
+
const toIndexCorrected = number_utils_1.NumberUtils.GetNearestNumberWithinBounds(toIndex, 0, array.length - 1);
|
|
37
|
+
if (fromIndex === -1 || array[toIndexCorrected] === element) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
array.splice(toIndexCorrected, 0, array.splice(fromIndex, 1)[0]);
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
static SwapElements(elementOne, elementTwo, array) {
|
|
44
|
+
if (!Array.isArray(array)) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
const elOneIdx = array.indexOf(elementTwo);
|
|
48
|
+
const elTwoIdx = array.indexOf(elementOne);
|
|
49
|
+
if (elOneIdx === -1 || elTwoIdx === -1) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
array[elOneIdx] = array.splice(elTwoIdx, 1, array[elOneIdx])[0];
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
static RemoveElementAtIndex(index, array) {
|
|
56
|
+
if (number_utils_1.NumberUtils.IsNaN(index) || index < 0 || !Array.isArray(array) || array.length === 0) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
if (index in array) {
|
|
60
|
+
array.splice(index, 1);
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
static RemoveElementsByFilter(array, filterFunction) {
|
|
68
|
+
if (!ArrayUtils.IsArrayWithElements(array) || !filterFunction) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
let atLeastOneRemoved = false;
|
|
72
|
+
const len = array.length;
|
|
73
|
+
for (let i = len - 1; i >= 0; i--) {
|
|
74
|
+
const item = array[i];
|
|
75
|
+
if (filterFunction.call(this, item) === true) {
|
|
76
|
+
array.splice(i, 1);
|
|
77
|
+
atLeastOneRemoved = true;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return atLeastOneRemoved;
|
|
81
|
+
}
|
|
82
|
+
static RemoveLastElementOf(array) {
|
|
83
|
+
if (!array) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
return ArrayUtils.RemoveElementAtIndex(array.length - 1, array);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
static ReplaceElement(elementIn, elementOut, array) {
|
|
91
|
+
if (!array || !Array.isArray(array)) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const indexOut = array.indexOf(elementOut);
|
|
95
|
+
if (indexOut > -1) {
|
|
96
|
+
ArrayUtils.InsertElement(indexOut, elementIn, array);
|
|
97
|
+
ArrayUtils.RemoveElement(elementOut, array);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
static ToggleElement(toggle, elements) {
|
|
101
|
+
elements.indexOf(toggle) > -1 ? ArrayUtils.RemoveElement(toggle, elements) : elements.push(toggle);
|
|
102
|
+
}
|
|
103
|
+
static ContainsAnElementFoundBy(array, finder) {
|
|
104
|
+
if (!array || !finder) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
return (0, not_nill_function_1.notNill)(this.Find(array, finder));
|
|
108
|
+
}
|
|
109
|
+
static Find(array, foundBy) {
|
|
110
|
+
if (!array || !foundBy) {
|
|
111
|
+
return undefined;
|
|
112
|
+
}
|
|
113
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
114
|
+
const itemCur = array[i];
|
|
115
|
+
if (foundBy(itemCur)) {
|
|
116
|
+
return itemCur;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return undefined;
|
|
120
|
+
}
|
|
121
|
+
static FindAll(array, foundBy) {
|
|
122
|
+
const answer = [];
|
|
123
|
+
if (!array || !foundBy) {
|
|
124
|
+
return answer;
|
|
125
|
+
}
|
|
126
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
127
|
+
const itemCur = array[i];
|
|
128
|
+
if (foundBy(itemCur)) {
|
|
129
|
+
answer.push(itemCur);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return answer;
|
|
133
|
+
}
|
|
134
|
+
static GetMaxCalculatedValue(array, itemValueFunction) {
|
|
135
|
+
if (!array || !itemValueFunction) {
|
|
136
|
+
return NaN;
|
|
137
|
+
}
|
|
138
|
+
let max = undefined;
|
|
139
|
+
const len = array.length;
|
|
140
|
+
for (let i = 0; i < len; i++) {
|
|
141
|
+
const valueCur = itemValueFunction.call(this, array[i]);
|
|
142
|
+
if (!max || valueCur > max) {
|
|
143
|
+
max = valueCur;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return max;
|
|
147
|
+
}
|
|
148
|
+
static FillUntilLength(array, requiredLength, fillerElement = undefined) {
|
|
149
|
+
if (!array || !requiredLength) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
if (array.length >= requiredLength) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
const spotsRemaining = requiredLength - array.length;
|
|
156
|
+
for (let i = 0; i < spotsRemaining; i++) {
|
|
157
|
+
array.push(fillerElement);
|
|
158
|
+
}
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
static GetNthElementInPossiblySparseArray(array, elementNumber) {
|
|
162
|
+
if (!array || !elementNumber || elementNumber < 1) {
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
return this._AsDenseArray(array)[elementNumber - 1];
|
|
166
|
+
}
|
|
167
|
+
static GetFirstElementInPossiblySparseArray(array) {
|
|
168
|
+
return this.GetNthElementInPossiblySparseArray(array, 1);
|
|
169
|
+
}
|
|
170
|
+
static GetSecondElementInPossiblySparseArray(array) {
|
|
171
|
+
return this.GetNthElementInPossiblySparseArray(array, 2);
|
|
172
|
+
}
|
|
173
|
+
static GetNumberOfElementsInPossiblySparseArray(array) {
|
|
174
|
+
if (!array) {
|
|
175
|
+
return undefined;
|
|
176
|
+
}
|
|
177
|
+
return this._AsDenseArray(array).length;
|
|
178
|
+
}
|
|
179
|
+
static CountWhere(array, whereFunction) {
|
|
180
|
+
if (!ArrayUtils.IsArrayWithElements(array) || !whereFunction) {
|
|
181
|
+
return 0;
|
|
182
|
+
}
|
|
183
|
+
let count = 0;
|
|
184
|
+
const len = array.length;
|
|
185
|
+
for (let i = 0; i < len; i++) {
|
|
186
|
+
if (whereFunction.call(this, array[i])) {
|
|
187
|
+
count++;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return count;
|
|
191
|
+
}
|
|
192
|
+
static SortAlphabetically(theArray, propertyName = undefined, reverseOrder = false) {
|
|
193
|
+
if (!theArray || !Array.isArray(theArray)) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
const switcher = reverseOrder ? -1 : 1;
|
|
197
|
+
const stringSort = string_utils_1.StringUtils.IsStringWithLength(propertyName);
|
|
198
|
+
theArray.sort((itemOne, itemTwo) => {
|
|
199
|
+
const valOne = stringSort ? itemOne[propertyName] : itemOne;
|
|
200
|
+
const valTwo = stringSort ? itemTwo[propertyName] : itemTwo;
|
|
201
|
+
return (valOne > valTwo ? 1 : (valOne < valTwo ? -1 : 0)) * switcher;
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
static Shuffle(theArray) {
|
|
205
|
+
if (!theArray || !Array.isArray(theArray)) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
let counter = theArray.length;
|
|
209
|
+
while (counter > 0) {
|
|
210
|
+
const index = Math.floor(Math.random() * counter);
|
|
211
|
+
counter--;
|
|
212
|
+
const temp = theArray[counter];
|
|
213
|
+
theArray[counter] = theArray[index];
|
|
214
|
+
theArray[index] = temp;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
static GetGroupBy(theArray, groupByProp) {
|
|
218
|
+
const map = new Map();
|
|
219
|
+
if (!theArray || theArray.length === 0 || !groupByProp) {
|
|
220
|
+
return map;
|
|
221
|
+
}
|
|
222
|
+
theArray.forEach((item) => {
|
|
223
|
+
const propValue = item[groupByProp];
|
|
224
|
+
if (Array.isArray(propValue)) {
|
|
225
|
+
const len = propValue.length;
|
|
226
|
+
for (let i = 0; i < len; i++) {
|
|
227
|
+
const propValCur = propValue[i];
|
|
228
|
+
map_utils_1.MapUtils.InsertArrayItemIntoMap(map, propValCur, item);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
map_utils_1.MapUtils.InsertArrayItemIntoMap(map, propValue, item);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
return map;
|
|
236
|
+
}
|
|
237
|
+
static ContainAllEqualElements(arrayOne, arrayTwo) {
|
|
238
|
+
if (!arrayOne || !arrayTwo || arrayOne.length !== arrayTwo.length) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
for (let i = 0, len = arrayOne.length; i < len; i++) {
|
|
242
|
+
if (arrayOne[i] !== arrayTwo[i]) {
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return true;
|
|
247
|
+
}
|
|
248
|
+
static ContainAnyEqualElements(arrayOne, arrayTwo) {
|
|
249
|
+
if (!arrayOne || !arrayTwo) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
const lenOne = arrayOne.length;
|
|
253
|
+
for (let indexOne = 0; indexOne < lenOne; indexOne++) {
|
|
254
|
+
const itemOne = arrayOne[indexOne];
|
|
255
|
+
const lenTwo = arrayTwo.length;
|
|
256
|
+
for (let i = 0; i < lenTwo; i++) {
|
|
257
|
+
if (itemOne === arrayTwo[i]) {
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
static IsArrayWithElements(arrayToCheck, classItemsMustBeInstanceOf) {
|
|
265
|
+
if ((0, is_nill_function_1.isNill)(arrayToCheck)) {
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
if (Array.isArray(arrayToCheck) && arrayToCheck.length > 0) {
|
|
269
|
+
if (classItemsMustBeInstanceOf) {
|
|
270
|
+
return arrayToCheck[0] instanceof classItemsMustBeInstanceOf;
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
return true;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
static IsEmptyArray(arrayToCheck) {
|
|
281
|
+
return !!arrayToCheck && Array.isArray(arrayToCheck) && arrayToCheck.length === 0;
|
|
282
|
+
}
|
|
283
|
+
static SearchFor(array, id, property) {
|
|
284
|
+
if (array && array.hasOwnProperty("length") && (string_utils_1.StringUtils.IsStringWithLength(id) || number_utils_1.NumberUtils.IsNumber(id))) {
|
|
285
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
286
|
+
const subject = array[i];
|
|
287
|
+
if (property) {
|
|
288
|
+
if (subject[property] === id) {
|
|
289
|
+
return subject;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
else if (typeof subject["getId"] === "function") {
|
|
293
|
+
if (subject["getId"]() === id) {
|
|
294
|
+
return subject;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
if (subject["id"] === id) {
|
|
299
|
+
return subject;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
static ArrayToString(array) {
|
|
306
|
+
if (!array) {
|
|
307
|
+
return "";
|
|
308
|
+
}
|
|
309
|
+
let returnStr = "";
|
|
310
|
+
const len = array.length;
|
|
311
|
+
for (let i = 0; i < len; i++) {
|
|
312
|
+
returnStr += array[i].toString() + ", ";
|
|
313
|
+
}
|
|
314
|
+
returnStr = string_utils_1.StringUtils.RemoveLastChars(returnStr, 2);
|
|
315
|
+
return returnStr;
|
|
316
|
+
}
|
|
317
|
+
static PushIfNotExist(item, array) {
|
|
318
|
+
if (!array) {
|
|
319
|
+
return false;
|
|
320
|
+
}
|
|
321
|
+
if (array.indexOf(item) === -1) {
|
|
322
|
+
array.push(item);
|
|
323
|
+
return true;
|
|
324
|
+
}
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
static CloneArray(array) {
|
|
328
|
+
let answer = [];
|
|
329
|
+
if (array) {
|
|
330
|
+
answer = array.slice(0);
|
|
331
|
+
}
|
|
332
|
+
return answer;
|
|
333
|
+
}
|
|
334
|
+
static CloneArrayAndItsItems(array, arrayItemsClass, deepClone = false) {
|
|
335
|
+
const cloneArray = [];
|
|
336
|
+
if (array) {
|
|
337
|
+
for (let i = 0, len = array.length; i < len; i++) {
|
|
338
|
+
if (deepClone) {
|
|
339
|
+
cloneArray.push(object_utils_1.ObjectUtils.GetDeepClone(array[i]));
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
cloneArray.push(object_utils_1.ObjectUtils.GetShallowClone(array[i], arrayItemsClass));
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
return [];
|
|
348
|
+
}
|
|
349
|
+
return cloneArray;
|
|
350
|
+
}
|
|
351
|
+
static LengthOf(array) {
|
|
352
|
+
return !!array ? array.length : 0;
|
|
353
|
+
}
|
|
354
|
+
static PlaceElementAfterOther(array, elementToPlace, afterThisElement) {
|
|
355
|
+
if (array) {
|
|
356
|
+
const afterThisElIdx = array.indexOf(afterThisElement);
|
|
357
|
+
const elToPlaceIdx = array.indexOf(elementToPlace);
|
|
358
|
+
if (afterThisElIdx >= elToPlaceIdx) {
|
|
359
|
+
ArrayUtils.MoveElement(elementToPlace, afterThisElIdx + 1, array);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
static ConvertIntoFlatArray(array) {
|
|
364
|
+
return array.reduce((acc, val) => acc.concat(val), []);
|
|
365
|
+
}
|
|
366
|
+
static _AsDenseArray(sparseArray) {
|
|
367
|
+
if (!sparseArray) {
|
|
368
|
+
return [];
|
|
369
|
+
}
|
|
370
|
+
return sparseArray.filter((item) => {
|
|
371
|
+
return item !== undefined && item !== null;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
exports.ArrayUtils = ArrayUtils;
|
|
376
376
|
//# sourceMappingURL=array-utils.js.map
|