@atlantjs/arch 15.6.5 → 15.6.7
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/biome.json +1 -1
- package/package.json +11 -11
- package/{@tool-box → src/@tool-box}/tests/builder.abstract.util.d.ts +1 -0
- package/src/@tool-box/tests/builder.abstract.util.d.ts.map +1 -0
- package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.d.ts +7 -0
- package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/tests/builders/datetime/datetime.edge.builder.js +3 -3
- package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts +5 -0
- package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/tests/builders/failures/dummies/failure.dummy.js +1 -1
- package/{@tool-box → src/@tool-box}/tests/builders/failures/failure.builder.d.ts +2 -1
- package/src/@tool-box/tests/builders/failures/failure.builder.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/tests/builders/failures/failure.builder.js +2 -2
- package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.d.ts +7 -0
- package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/tests/builders/metadata/metadata-uv.builder.js +3 -3
- package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.d.ts +7 -0
- package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/tests/builders/metadata/metadata.edge.builder.js +3 -3
- package/src/@tool-box/tests/builders/user/email.edge.builder.d.ts +7 -0
- package/src/@tool-box/tests/builders/user/email.edge.builder.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/tests/builders/user/email.edge.builder.js +3 -3
- package/src/@tool-box/tests/builders/user/username.edge.builder.d.ts +7 -0
- package/src/@tool-box/tests/builders/user/username.edge.builder.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/tests/builders/user/username.edge.builder.js +3 -3
- package/{@tool-box → src/@tool-box}/tests/faker/faker.d.ts +1 -0
- package/src/@tool-box/tests/faker/faker.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/convert-units/convert-units.d.ts +6 -5
- package/src/@tool-box/utils/convert-units/convert-units.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/convert-units/convert-units.js +5 -5
- package/src/@tool-box/utils/datatypes/boolean-utils.d.ts +2 -0
- package/src/@tool-box/utils/datatypes/boolean-utils.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/datatypes/boolean-utils.js +1 -10
- package/{@tool-box → src/@tool-box}/utils/datatypes/generic-types.d.ts +1 -0
- package/src/@tool-box/utils/datatypes/generic-types.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/datatypes/plainify.d.ts +1 -0
- package/src/@tool-box/utils/datatypes/plainify.d.ts.map +1 -0
- package/src/@tool-box/utils/datatypes/string-utils.d.ts +2 -0
- package/src/@tool-box/utils/datatypes/string-utils.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/datatypes/string-utils.js +1 -0
- package/src/@tool-box/utils/datetime/mappers/month.mapper.d.ts +7 -0
- package/src/@tool-box/utils/datetime/mappers/month.mapper.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/datetime/mappers/month.mapper.js +2 -2
- package/{@tool-box → src/@tool-box}/utils/datetime/mappers/points/month-abbreviation.enum.d.ts +1 -0
- package/src/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/datetime/mappers/points/month-number.enum.d.ts +1 -0
- package/src/@tool-box/utils/datetime/mappers/points/month-number.enum.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/ducts/common.d.ts +1 -0
- package/src/@tool-box/utils/ducts/common.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/ducts/common.js +1 -1
- package/{@tool-box → src/@tool-box}/utils/ducts/optional-type.d.ts +2 -1
- package/src/@tool-box/utils/ducts/optional-type.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/ducts/optional-type.js +1 -1
- package/{@tool-box → src/@tool-box}/utils/ducts/return-type.d.ts +3 -2
- package/src/@tool-box/utils/ducts/return-type.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/ducts/return-type.js +1 -1
- package/{@tool-box → src/@tool-box}/utils/http-provider/http-provider-failure-response.d.ts +3 -3
- package/src/@tool-box/utils/http-provider/http-provider-failure-response.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/http-provider/http-provider-failure-response.js +1 -1
- package/{@tool-box → src/@tool-box}/utils/http-provider/http-provider-success-response.d.ts +2 -1
- package/src/@tool-box/utils/http-provider/http-provider-success-response.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/http-provider/http-provider.d.ts +5 -4
- package/src/@tool-box/utils/http-provider/http-provider.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/http-provider/http-provider.js +4 -4
- package/{@tool-box → src/@tool-box}/utils/logger/index.d.ts +1 -0
- package/src/@tool-box/utils/logger/index.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/map/map.abstract.d.ts +1 -0
- package/src/@tool-box/utils/map/map.abstract.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/random/random.d.ts +1 -0
- package/src/@tool-box/utils/random/random.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/type-guard/guardian-exception.d.ts +1 -0
- package/src/@tool-box/utils/type-guard/guardian-exception.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/type-guard/guardian.d.ts +3 -2
- package/src/@tool-box/utils/type-guard/guardian.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/type-guard/guardian.js +1 -1
- package/{@tool-box → src/@tool-box}/utils/type-guard/guardian.type.d.ts +1 -0
- package/src/@tool-box/utils/type-guard/guardian.type.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/validators/is-cron-expression.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-cron-expression.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/validators/is-date-string.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-date-string.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/validators/is-password-match.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-password-match.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/validators/is-password-match.js +1 -1
- package/{@tool-box → src/@tool-box}/utils/validators/is-password-policy.validator.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-password-policy.validator.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/validators/is-password-policy.validator.js +1 -1
- package/{@tool-box → src/@tool-box}/utils/validators/is-schedule.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-schedule.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/validators/is-time-string.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-time-string.d.ts.map +1 -0
- package/{@tool-box → src/@tool-box}/utils/validators/is-ulid.d.ts +1 -0
- package/src/@tool-box/utils/validators/is-ulid.d.ts.map +1 -0
- package/src/index.d.ts +77 -0
- package/src/index.d.ts.map +1 -0
- package/{index.js → src/index.js} +68 -68
- package/{objects → src/objects}/@common/edges/email.edge.d.ts +2 -1
- package/src/objects/@common/edges/email.edge.d.ts.map +1 -0
- package/{objects → src/objects}/@common/edges/email.edge.js +1 -2
- package/{objects → src/objects}/@common/edges/ulid.sketch.edge.d.ts +1 -0
- package/src/objects/@common/edges/ulid.sketch.edge.d.ts.map +1 -0
- package/{objects → src/objects}/@common/edges/ulid.sketch.edge.js +1 -1
- package/{objects → src/objects}/@common/edges/url.edge.d.ts +2 -1
- package/src/objects/@common/edges/url.edge.d.ts.map +1 -0
- package/{objects → src/objects}/@common/edges/url.edge.js +1 -1
- package/{objects → src/objects}/@common/edges/username.edge.d.ts +2 -1
- package/src/objects/@common/edges/username.edge.d.ts.map +1 -0
- package/{objects → src/objects}/@common/edges/username.edge.js +1 -1
- package/{objects → src/objects}/@common/edges/uuid.sketch.edge.d.ts +1 -0
- package/src/objects/@common/edges/uuid.sketch.edge.d.ts.map +1 -0
- package/{objects → src/objects}/@common/edges/uuid.sketch.edge.js +1 -1
- package/{objects → src/objects}/@common/points/environment.point.d.ts +1 -0
- package/src/objects/@common/points/environment.point.d.ts.map +1 -0
- package/{objects → src/objects}/@common/points/header-token-name.point.d.ts +1 -0
- package/src/objects/@common/points/header-token-name.point.d.ts.map +1 -0
- package/{objects → src/objects}/@common/points/http-status-codes.point.d.ts +1 -0
- package/src/objects/@common/points/http-status-codes.point.d.ts.map +1 -0
- package/{objects → src/objects}/amount/amount-value.edge.d.ts +2 -1
- package/src/objects/amount/amount-value.edge.d.ts.map +1 -0
- package/{objects → src/objects}/amount/amount-value.edge.js +1 -1
- package/{objects → src/objects}/amount/amount.edge.d.ts +143 -133
- package/src/objects/amount/amount.edge.d.ts.map +1 -0
- package/{objects → src/objects}/amount/amount.edge.js +175 -148
- package/{objects → src/objects}/amount/amount.polygon.d.ts +1 -0
- package/src/objects/amount/amount.polygon.d.ts.map +1 -0
- package/src/objects/amount/amount.uv.d.ts +9 -0
- package/src/objects/amount/amount.uv.d.ts.map +1 -0
- package/{objects → src/objects}/amount/amount.uv.js +2 -2
- package/{objects → src/objects}/amount/points/duration-unit.point.d.ts +1 -0
- package/src/objects/amount/points/duration-unit.point.d.ts.map +1 -0
- package/{objects → src/objects}/amount/points/energy-unit.point.d.ts +1 -0
- package/src/objects/amount/points/energy-unit.point.d.ts.map +1 -0
- package/{objects → src/objects}/amount/points/length-unit.point.d.ts +1 -0
- package/src/objects/amount/points/length-unit.point.d.ts.map +1 -0
- package/{objects → src/objects}/amount/points/mass-unit.point.d.ts +1 -0
- package/src/objects/amount/points/mass-unit.point.d.ts.map +1 -0
- package/{objects → src/objects}/amount/points/month-name.point.d.ts +1 -0
- package/src/objects/amount/points/month-name.point.d.ts.map +1 -0
- package/{objects → src/objects}/amount/points/object-unit.point.d.ts +1 -0
- package/src/objects/amount/points/object-unit.point.d.ts.map +1 -0
- package/src/objects/amount/points/units.point.d.ts +7 -0
- package/src/objects/amount/points/units.point.d.ts.map +1 -0
- package/{objects → src/objects}/amount/points/volume-unit.point.d.ts +1 -0
- package/src/objects/amount/points/volume-unit.point.d.ts.map +1 -0
- package/{objects → src/objects}/amount/points/week-day.point.d.ts +1 -0
- package/src/objects/amount/points/week-day.point.d.ts.map +1 -0
- package/src/objects/datetime/edges/datetime.edge.d.ts +467 -0
- package/src/objects/datetime/edges/datetime.edge.d.ts.map +1 -0
- package/{objects → src/objects}/datetime/edges/datetime.edge.js +209 -220
- package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.d.ts +5 -0
- package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.js +19 -0
- package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.d.ts +5 -0
- package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.js +19 -0
- package/src/objects/datetime/edges/locale/day/today-to-language.mapper.d.ts +6 -0
- package/src/objects/datetime/edges/locale/day/today-to-language.mapper.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/day/today-to-language.mapper.js +15 -0
- package/src/objects/datetime/edges/locale/holidays-country.type.d.ts +3 -0
- package/src/objects/datetime/edges/locale/holidays-country.type.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/month/month-to-english.mapper.d.ts +5 -0
- package/src/objects/datetime/edges/locale/month/month-to-english.mapper.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/month/month-to-english.mapper.js +24 -0
- package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.d.ts +5 -0
- package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.d.ts.map +1 -0
- package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.js +24 -0
- package/{objects → src/objects}/datetime/points/month-name.enum.d.ts +1 -0
- package/src/objects/datetime/points/month-name.enum.d.ts.map +1 -0
- package/{objects → src/objects}/datetime/points/week-day.enum.d.ts +1 -0
- package/src/objects/datetime/points/week-day.enum.d.ts.map +1 -0
- package/{objects → src/objects}/failure/edges/failure.abstract.d.ts +2 -1
- package/src/objects/failure/edges/failure.abstract.d.ts.map +1 -0
- package/{objects → src/objects}/failure/edges/failure.abstract.js +2 -2
- package/{objects → src/objects}/failure/edges/failure.abstract.polygon.d.ts +1 -0
- package/src/objects/failure/edges/failure.abstract.polygon.d.ts.map +1 -0
- package/{objects → src/objects}/language/points/language.point.d.ts +1 -0
- package/src/objects/language/points/language.point.d.ts.map +1 -0
- package/{objects → src/objects}/metadata/metadata.edge.d.ts +4 -3
- package/src/objects/metadata/metadata.edge.d.ts.map +1 -0
- package/{objects → src/objects}/metadata/metadata.edge.js +2 -2
- package/{objects → src/objects}/metadata/metadata.polygon.d.ts +1 -0
- package/src/objects/metadata/metadata.polygon.d.ts.map +1 -0
- package/{objects → src/objects}/metadata/metadata.uv.d.ts +2 -1
- package/src/objects/metadata/metadata.uv.d.ts.map +1 -0
- package/{objects → src/objects}/metadata/metadata.uv.js +2 -2
- package/{objects → src/objects}/password/password.edge.d.ts +3 -2
- package/src/objects/password/password.edge.d.ts.map +1 -0
- package/{objects → src/objects}/password/password.edge.js +5 -5
- package/src/objects/password/password.polygon.d.ts +6 -0
- package/src/objects/password/password.polygon.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/not-allowing-consecutive-chars-step.d.ts +3 -2
- package/src/objects/password/steps/not-allowing-consecutive-chars-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/not-allowing-consecutive-chars-step.js +1 -1
- package/{objects → src/objects}/password/steps/not-allowing-date-step.d.ts +3 -2
- package/src/objects/password/steps/not-allowing-date-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/not-allowing-date-step.js +1 -1
- package/src/objects/password/steps/not-allowing-phone-step.d.ts +8 -0
- package/src/objects/password/steps/not-allowing-phone-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/not-allowing-phone-step.js +1 -1
- package/{objects → src/objects}/password/steps/not-allowing-repeated-chars-step.d.ts +3 -2
- package/src/objects/password/steps/not-allowing-repeated-chars-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/not-allowing-repeated-chars-step.js +1 -1
- package/{objects → src/objects}/password/steps/not-allowing-string-step.d.ts +3 -2
- package/src/objects/password/steps/not-allowing-string-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/not-allowing-string-step.js +1 -1
- package/{objects → src/objects}/password/steps/not-allowing-these-chars-step.d.ts +3 -2
- package/src/objects/password/steps/not-allowing-these-chars-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/not-allowing-these-chars-step.js +1 -1
- package/src/objects/password/steps/numeric-step.d.ts +6 -0
- package/src/objects/password/steps/numeric-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/numeric-step.js +1 -1
- package/src/objects/password/steps/with-at-least-one-letter-step.d.ts +6 -0
- package/src/objects/password/steps/with-at-least-one-letter-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/with-at-least-one-letter-step.js +1 -1
- package/src/objects/password/steps/with-at-least-one-number-digit-step.d.ts +6 -0
- package/src/objects/password/steps/with-at-least-one-number-digit-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/with-at-least-one-number-digit-step.js +1 -1
- package/src/objects/password/steps/with-at-least-one-special-char-step.d.ts +6 -0
- package/src/objects/password/steps/with-at-least-one-special-char-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/with-at-least-one-special-char-step.js +1 -1
- package/{objects → src/objects}/password/steps/with-length-step.d.ts +3 -2
- package/src/objects/password/steps/with-length-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/steps/with-length-step.js +1 -1
- package/{objects → src/objects}/password/validation-step.d.ts +2 -1
- package/src/objects/password/validation-step.d.ts.map +1 -0
- package/{objects → src/objects}/password/validation-step.type.d.ts +1 -0
- package/src/objects/password/validation-step.type.d.ts.map +1 -0
- package/src/objects/password/validation-step.type.js +2 -0
- package/{objects → src/objects}/primitives/boolean.edge.sketch.d.ts +1 -0
- package/src/objects/primitives/boolean.edge.sketch.d.ts.map +1 -0
- package/src/objects/primitives/datetime.edge.sketch.d.ts +4 -0
- package/src/objects/primitives/datetime.edge.sketch.d.ts.map +1 -0
- package/{objects → src/objects}/primitives/datetime.edge.sketch.js +1 -1
- package/{objects → src/objects}/primitives/number.edge.sketch.d.ts +1 -0
- package/src/objects/primitives/number.edge.sketch.d.ts.map +1 -0
- package/{objects → src/objects}/primitives/number.edge.sketch.js +1 -1
- package/{objects → src/objects}/primitives/string.edge.sketch.d.ts +1 -0
- package/src/objects/primitives/string.edge.sketch.d.ts.map +1 -0
- package/{objects → src/objects}/scheduling/scheduling.edge.d.ts +7 -6
- package/src/objects/scheduling/scheduling.edge.d.ts.map +1 -0
- package/src/objects/scheduling/scheduling.edge.failure.d.ts +5 -0
- package/src/objects/scheduling/scheduling.edge.failure.d.ts.map +1 -0
- package/{objects → src/objects}/scheduling/scheduling.edge.failure.js +1 -1
- package/{objects → src/objects}/scheduling/scheduling.edge.js +5 -5
- package/{objects → src/objects}/time/time.edge.d.ts +2 -1
- package/src/objects/time/time.edge.d.ts.map +1 -0
- package/{objects → src/objects}/time/time.edge.js +2 -2
- package/src/objects-interface/edges/edge.abstract.d.ts +5 -0
- package/src/objects-interface/edges/edge.abstract.d.ts.map +1 -0
- package/{objects-interface → src/objects-interface}/face.abstract.d.ts +3 -2
- package/src/objects-interface/face.abstract.d.ts.map +1 -0
- package/{objects-interface → src/objects-interface}/solid.abstract.d.ts +6 -5
- package/src/objects-interface/solid.abstract.d.ts.map +1 -0
- package/{objects-interface → src/objects-interface}/solid.abstract.js +1 -1
- package/src/objects-interface/uv.abstract.d.ts +7 -0
- package/src/objects-interface/uv.abstract.d.ts.map +1 -0
- package/{objects-interface → src/objects-interface}/vertices/vertex.abstract.d.ts +6 -5
- package/src/objects-interface/vertices/vertex.abstract.d.ts.map +1 -0
- package/{objects-interface → src/objects-interface}/vertices/vertex.abstract.js +1 -1
- package/{shared → src/shared}/payload.abstract.d.ts +1 -0
- package/src/shared/payload.abstract.d.ts.map +1 -0
- package/{shared → src/shared}/request.abstract.d.ts +6 -5
- package/src/shared/request.abstract.d.ts.map +1 -0
- package/src/shared/request.abstract.js +3 -0
- package/{shared → src/shared}/response.abstract.d.ts +1 -0
- package/src/shared/response.abstract.d.ts.map +1 -0
- package/tsconfig-default.json +2 -2
- package/tsconfig-lib.json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/types/boolean.d.ts +19 -0
- package/types/string.d.ts +33 -0
- package/@tool-box/tests/builders/datetime/datetime.edge.builder.d.ts +0 -6
- package/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts +0 -4
- package/@tool-box/tests/builders/metadata/metadata-uv.builder.d.ts +0 -6
- package/@tool-box/tests/builders/metadata/metadata.edge.builder.d.ts +0 -6
- package/@tool-box/tests/builders/user/email.edge.builder.d.ts +0 -6
- package/@tool-box/tests/builders/user/username.edge.builder.d.ts +0 -6
- package/@tool-box/utils/datatypes/boolean-utils.d.ts +0 -16
- package/@tool-box/utils/datatypes/string-utils.d.ts +0 -27
- package/@tool-box/utils/datetime/mappers/month.mapper.d.ts +0 -6
- package/index.d.ts +0 -76
- package/objects/amount/amount.uv.d.ts +0 -8
- package/objects/amount/points/units.point.d.ts +0 -6
- package/objects/datetime/edges/datetime.edge.d.ts +0 -455
- package/objects/password/password.polygon.d.ts +0 -5
- package/objects/password/steps/not-allowing-phone-step.d.ts +0 -7
- package/objects/password/steps/numeric-step.d.ts +0 -5
- package/objects/password/steps/with-at-least-one-letter-step.d.ts +0 -5
- package/objects/password/steps/with-at-least-one-number-digit-step.d.ts +0 -5
- package/objects/password/steps/with-at-least-one-special-char-step.d.ts +0 -5
- package/objects/primitives/datetime.edge.sketch.d.ts +0 -3
- package/objects/scheduling/scheduling.edge.failure.d.ts +0 -4
- package/objects-interface/edges/edge.abstract.d.ts +0 -4
- package/objects-interface/uv.abstract.d.ts +0 -6
- package/shared/request.abstract.js +0 -3
- /package/{@tool-box → src/@tool-box}/tests/builder.abstract.util.js +0 -0
- /package/{@tool-box → src/@tool-box}/tests/faker/faker.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/datatypes/generic-types.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/datatypes/plainify.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/datetime/mappers/points/month-abbreviation.enum.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/datetime/mappers/points/month-number.enum.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/http-provider/http-provider-success-response.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/logger/index.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/map/map.abstract.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/random/random.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/type-guard/guardian-exception.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/type-guard/guardian.type.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/validators/is-cron-expression.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/validators/is-date-string.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/validators/is-schedule.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/validators/is-time-string.js +0 -0
- /package/{@tool-box → src/@tool-box}/utils/validators/is-ulid.js +0 -0
- /package/{objects → src/objects}/@common/points/environment.point.js +0 -0
- /package/{objects → src/objects}/@common/points/header-token-name.point.js +0 -0
- /package/{objects → src/objects}/@common/points/http-status-codes.point.js +0 -0
- /package/{objects → src/objects}/amount/amount.polygon.js +0 -0
- /package/{objects → src/objects}/amount/points/duration-unit.point.js +0 -0
- /package/{objects → src/objects}/amount/points/energy-unit.point.js +0 -0
- /package/{objects → src/objects}/amount/points/length-unit.point.js +0 -0
- /package/{objects → src/objects}/amount/points/mass-unit.point.js +0 -0
- /package/{objects → src/objects}/amount/points/month-name.point.js +0 -0
- /package/{objects → src/objects}/amount/points/object-unit.point.js +0 -0
- /package/{objects → src/objects}/amount/points/units.point.js +0 -0
- /package/{objects → src/objects}/amount/points/volume-unit.point.js +0 -0
- /package/{objects → src/objects}/amount/points/week-day.point.js +0 -0
- /package/{objects/failure/edges/failure.abstract.polygon.js → src/objects/datetime/edges/locale/holidays-country.type.js} +0 -0
- /package/{objects → src/objects}/datetime/points/month-name.enum.js +0 -0
- /package/{objects → src/objects}/datetime/points/week-day.enum.js +0 -0
- /package/{objects/metadata/metadata.polygon.js → src/objects/failure/edges/failure.abstract.polygon.js} +0 -0
- /package/{objects → src/objects}/language/points/language.point.js +0 -0
- /package/{objects/password/password.polygon.js → src/objects/metadata/metadata.polygon.js} +0 -0
- /package/{objects/password/validation-step.type.js → src/objects/password/password.polygon.js} +0 -0
- /package/{objects → src/objects}/password/validation-step.js +0 -0
- /package/{objects → src/objects}/primitives/boolean.edge.sketch.js +0 -0
- /package/{objects → src/objects}/primitives/string.edge.sketch.js +0 -0
- /package/{objects-interface → src/objects-interface}/edges/edge.abstract.js +0 -0
- /package/{objects-interface → src/objects-interface}/face.abstract.js +0 -0
- /package/{objects-interface → src/objects-interface}/uv.abstract.js +0 -0
- /package/{shared → src/shared}/payload.abstract.js +0 -0
- /package/{shared → src/shared}/response.abstract.js +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AmountEdge = void 0;
|
|
4
|
-
const convert_units_1 = require("
|
|
5
|
-
const guardian_1 = require("
|
|
6
|
-
const amount_value_edge_1 = require("
|
|
7
|
-
const energy_unit_point_1 = require("
|
|
8
|
-
const length_unit_point_1 = require("
|
|
9
|
-
const mass_unit_point_1 = require("
|
|
10
|
-
const volume_unit_point_1 = require("
|
|
4
|
+
const convert_units_1 = require("#/@tool-box/utils/convert-units/convert-units");
|
|
5
|
+
const guardian_1 = require("#/@tool-box/utils/type-guard/guardian");
|
|
6
|
+
const amount_value_edge_1 = require("#/objects/amount/amount-value.edge");
|
|
7
|
+
const energy_unit_point_1 = require("#/objects/amount/points/energy-unit.point");
|
|
8
|
+
const length_unit_point_1 = require("#/objects/amount/points/length-unit.point");
|
|
9
|
+
const mass_unit_point_1 = require("#/objects/amount/points/mass-unit.point");
|
|
10
|
+
const volume_unit_point_1 = require("#/objects/amount/points/volume-unit.point");
|
|
11
11
|
class AmountEdge {
|
|
12
12
|
constructor(_value, _unit) {
|
|
13
13
|
this._value = _value;
|
|
@@ -19,68 +19,74 @@ class AmountEdge {
|
|
|
19
19
|
get unit() {
|
|
20
20
|
return this._unit;
|
|
21
21
|
}
|
|
22
|
-
// ====================
|
|
22
|
+
// ====================
|
|
23
|
+
// Rounding and Precision
|
|
24
|
+
// ====================
|
|
23
25
|
/**
|
|
24
|
-
*
|
|
25
|
-
* @returns this
|
|
26
|
+
* Rounds the value to the nearest integer.
|
|
27
|
+
* @returns `this` to allow method chaining.
|
|
26
28
|
* @example
|
|
27
29
|
* const amount = new AmountEdge(5.7, MassUnitPoint.gram);
|
|
28
|
-
* amount.round(); //
|
|
30
|
+
* amount.round(); // value is now 6
|
|
29
31
|
*/
|
|
30
32
|
round() {
|
|
31
33
|
this._value = Math.round(this._value);
|
|
32
34
|
return this;
|
|
33
35
|
}
|
|
34
36
|
/**
|
|
35
|
-
*
|
|
36
|
-
* @returns this
|
|
37
|
+
* Rounds the value up to the next highest integer.
|
|
38
|
+
* @returns `this` to allow method chaining.
|
|
37
39
|
* @example
|
|
38
40
|
* const amount = new AmountEdge(5.2, MassUnitPoint.gram);
|
|
39
|
-
* amount.ceil(); //
|
|
41
|
+
* amount.ceil(); // value is now 6
|
|
40
42
|
*/
|
|
41
43
|
ceil() {
|
|
42
44
|
this._value = Math.ceil(this._value);
|
|
43
45
|
return this;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
|
-
*
|
|
47
|
-
* @returns this
|
|
48
|
+
* Rounds the value down to the next lowest integer.
|
|
49
|
+
* @returns `this` to allow method chaining.
|
|
48
50
|
* @example
|
|
49
51
|
* const amount = new AmountEdge(5.9, MassUnitPoint.gram);
|
|
50
|
-
* amount.floor(); //
|
|
52
|
+
* amount.floor(); // value is now 5
|
|
51
53
|
*/
|
|
52
54
|
floor() {
|
|
53
55
|
this._value = Math.floor(this._value);
|
|
54
56
|
return this;
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
57
|
-
*
|
|
58
|
-
* @param precision -
|
|
59
|
-
* @returns this
|
|
59
|
+
* Rounds the value to a specified number of decimal places.
|
|
60
|
+
* @param precision - The number of decimal places to keep.
|
|
61
|
+
* @returns `this` to allow method chaining.
|
|
60
62
|
* @example
|
|
61
63
|
* const amount = new AmountEdge(5.6789, MassUnitPoint.gram);
|
|
62
|
-
* amount.toFixed(2); //
|
|
64
|
+
* amount.toFixed(2); // value is now 5.68
|
|
63
65
|
*/
|
|
64
66
|
toFixed(precision) {
|
|
65
67
|
this._value = Number(this._value.toFixed(precision));
|
|
66
68
|
return this;
|
|
67
69
|
}
|
|
68
70
|
/**
|
|
69
|
-
*
|
|
70
|
-
* @returns this
|
|
71
|
+
* Returns the absolute value (without sign).
|
|
72
|
+
* @returns `this` to allow method chaining.
|
|
71
73
|
* @example
|
|
72
74
|
* const amount = new AmountEdge(-5.5, MassUnitPoint.gram);
|
|
73
|
-
* amount.abs(); //
|
|
75
|
+
* amount.abs(); // value is now 5.5
|
|
74
76
|
*/
|
|
75
77
|
abs() {
|
|
76
78
|
this._value = Math.abs(this._value);
|
|
77
79
|
return this;
|
|
78
80
|
}
|
|
79
|
-
// ====================
|
|
81
|
+
// ====================
|
|
82
|
+
// Unit Compaction
|
|
83
|
+
// ====================
|
|
80
84
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
85
|
+
* Compacts the amount into a more appropriate unit based on its value.
|
|
86
|
+
* For example, 1000 grams is converted to 1 kilogram.
|
|
87
|
+
*
|
|
88
|
+
* @returns A new instance with the compacted unit.
|
|
89
|
+
*
|
|
84
90
|
* @example
|
|
85
91
|
* const amount = new AmountEdge(1500, MassUnitPoint.gram);
|
|
86
92
|
* const compact = amount.compact(); // 1.5 kg
|
|
@@ -125,41 +131,43 @@ class AmountEdge {
|
|
|
125
131
|
}
|
|
126
132
|
return this;
|
|
127
133
|
}
|
|
128
|
-
// ====================
|
|
134
|
+
// ====================
|
|
135
|
+
// Arithmetic Operations
|
|
136
|
+
// ====================
|
|
129
137
|
/**
|
|
130
|
-
*
|
|
131
|
-
* @param amount -
|
|
132
|
-
* @returns this
|
|
138
|
+
* Adds another amount to the current value.
|
|
139
|
+
* @param amount - The amount to be added.
|
|
140
|
+
* @returns `this` to allow method chaining.
|
|
133
141
|
* @example
|
|
134
142
|
* const amount1 = new AmountEdge(5, MassUnitPoint.gram);
|
|
135
143
|
* const amount2 = new AmountEdge(3, MassUnitPoint.gram);
|
|
136
|
-
* amount1.sum(amount2); //
|
|
144
|
+
* amount1.sum(amount2); // value is now 8
|
|
137
145
|
*/
|
|
138
146
|
sum(amount) {
|
|
139
147
|
this._value += amount.value;
|
|
140
148
|
return this;
|
|
141
149
|
}
|
|
142
150
|
/**
|
|
143
|
-
*
|
|
144
|
-
* @param amount -
|
|
145
|
-
* @returns this
|
|
151
|
+
* Subtracts another amount from the current value.
|
|
152
|
+
* @param amount - The amount to be subtracted.
|
|
153
|
+
* @returns `this` to allow method chaining.
|
|
146
154
|
* @example
|
|
147
155
|
* const amount1 = new AmountEdge(8, MassUnitPoint.gram);
|
|
148
156
|
* const amount2 = new AmountEdge(3, MassUnitPoint.gram);
|
|
149
|
-
* amount1.subtract(amount2); //
|
|
157
|
+
* amount1.subtract(amount2); // value is now 5
|
|
150
158
|
*/
|
|
151
159
|
subtract(amount) {
|
|
152
160
|
this._value -= amount.value;
|
|
153
161
|
return this;
|
|
154
162
|
}
|
|
155
163
|
/**
|
|
156
|
-
*
|
|
157
|
-
* @param amount - Divisor (
|
|
158
|
-
* @returns this
|
|
164
|
+
* Divides the value by a number or another amount.
|
|
165
|
+
* @param amount - Divisor (number or AmountEdge)
|
|
166
|
+
* @returns `this` to allow method chaining
|
|
159
167
|
* @example
|
|
160
168
|
* const amount = new AmountEdge(10, MassUnitPoint.gram);
|
|
161
|
-
* amount.divideBy(2); //
|
|
162
|
-
* amount.divideBy(new AmountEdge(2, MassUnitPoint.gram)); //
|
|
169
|
+
* amount.divideBy(2); // value is now 5
|
|
170
|
+
* amount.divideBy(new AmountEdge(2, MassUnitPoint.gram)); // value is now 2.5
|
|
163
171
|
*/
|
|
164
172
|
divideBy(amount) {
|
|
165
173
|
if (typeof amount === "number") {
|
|
@@ -171,13 +179,13 @@ class AmountEdge {
|
|
|
171
179
|
return this;
|
|
172
180
|
}
|
|
173
181
|
/**
|
|
174
|
-
*
|
|
175
|
-
* @param amount -
|
|
176
|
-
* @returns this
|
|
182
|
+
* Multiplies the value by a number or another amount.
|
|
183
|
+
* @param amount - Multiplier (number or AmountEdge)
|
|
184
|
+
* @returns `this` to allow method chaining
|
|
177
185
|
* @example
|
|
178
186
|
* const amount = new AmountEdge(5, MassUnitPoint.gram);
|
|
179
|
-
* amount.multiplyBy(2); //
|
|
180
|
-
* amount.multiplyBy(new AmountEdge(3, MassUnitPoint.gram)); //
|
|
187
|
+
* amount.multiplyBy(2); // value is now 10
|
|
188
|
+
* amount.multiplyBy(new AmountEdge(3, MassUnitPoint.gram)); // value is now 30
|
|
181
189
|
*/
|
|
182
190
|
multiplyBy(amount) {
|
|
183
191
|
if (typeof amount === "number") {
|
|
@@ -189,12 +197,12 @@ class AmountEdge {
|
|
|
189
197
|
return this;
|
|
190
198
|
}
|
|
191
199
|
/**
|
|
192
|
-
*
|
|
193
|
-
* @param amount -
|
|
194
|
-
* @returns this
|
|
200
|
+
* Calculates the remainder (modulus) of the current value.
|
|
201
|
+
* @param amount - The divisor, either a number or an AmountEdge instance.
|
|
202
|
+
* @returns `this` to allow method chaining.
|
|
195
203
|
* @example
|
|
196
204
|
* const amount = new AmountEdge(10, MassUnitPoint.gram);
|
|
197
|
-
* amount.modBy(3); //
|
|
205
|
+
* amount.modBy(3); // value is now 1
|
|
198
206
|
*/
|
|
199
207
|
modBy(amount) {
|
|
200
208
|
if (typeof amount === "number") {
|
|
@@ -206,9 +214,9 @@ class AmountEdge {
|
|
|
206
214
|
return this;
|
|
207
215
|
}
|
|
208
216
|
/**
|
|
209
|
-
*
|
|
210
|
-
* @param amount -
|
|
211
|
-
* @returns
|
|
217
|
+
* Calculates the absolute difference between this amount and another.
|
|
218
|
+
* @param amount - The amount to compare against
|
|
219
|
+
* @returns A new instance with the absolute difference
|
|
212
220
|
* @example
|
|
213
221
|
* const amount1 = new AmountEdge(10, MassUnitPoint.gram);
|
|
214
222
|
* const amount2 = new AmountEdge(3, MassUnitPoint.gram);
|
|
@@ -219,12 +227,12 @@ class AmountEdge {
|
|
|
219
227
|
return new AmountEdge(diff, this._unit);
|
|
220
228
|
}
|
|
221
229
|
/**
|
|
222
|
-
*
|
|
223
|
-
* @param percentage -
|
|
224
|
-
* @returns this
|
|
230
|
+
* Applies a percentage to the current value.
|
|
231
|
+
* @param percentage - The percentage to apply (0-100)
|
|
232
|
+
* @returns `this` to allow method chaining
|
|
225
233
|
* @example
|
|
226
234
|
* const amount = new AmountEdge(100, MassUnitPoint.gram);
|
|
227
|
-
* amount.applyPercentage(20); //
|
|
235
|
+
* amount.applyPercentage(20); // value is now 120 (100 + 20%)
|
|
228
236
|
*/
|
|
229
237
|
applyPercentage(percentage) {
|
|
230
238
|
const percentageValue = (this._value * percentage) / 100;
|
|
@@ -232,9 +240,14 @@ class AmountEdge {
|
|
|
232
240
|
return this;
|
|
233
241
|
}
|
|
234
242
|
/**
|
|
235
|
-
*
|
|
236
|
-
* @param total -
|
|
237
|
-
* @returns
|
|
243
|
+
* Calculates the percentage that this amount represents of a total.
|
|
244
|
+
* @param total - The total amount
|
|
245
|
+
* @returns The percentage as a number (0-100)
|
|
246
|
+
* @example
|
|
247
|
+
* const amount = new AmountEdge(25, MassUnitPoint.gram);
|
|
248
|
+
* const total = new AmountEdge(100, MassUnitPoint.gram);
|
|
249
|
+
* const percentage = amount.percentageOf(total); // 25
|
|
250
|
+
* @returns The percentage as a number (0-100)
|
|
238
251
|
* @example
|
|
239
252
|
* const amount = new AmountEdge(25, MassUnitPoint.gram);
|
|
240
253
|
* const total = new AmountEdge(100, MassUnitPoint.gram);
|
|
@@ -245,11 +258,13 @@ class AmountEdge {
|
|
|
245
258
|
return 0;
|
|
246
259
|
return (this._value / total.value) * 100;
|
|
247
260
|
}
|
|
248
|
-
// ====================
|
|
261
|
+
// ====================
|
|
262
|
+
// Comparisons
|
|
263
|
+
// ====================
|
|
249
264
|
/**
|
|
250
|
-
*
|
|
251
|
-
* @param amount -
|
|
252
|
-
* @returns true
|
|
265
|
+
* Checks whether this amount is equal to another amount.
|
|
266
|
+
* @param amount - The amount to compare against.
|
|
267
|
+
* @returns `true` if both amounts have the same value and unit; otherwise, `false`.
|
|
253
268
|
* @example
|
|
254
269
|
* const amount1 = new AmountEdge(5, MassUnitPoint.gram);
|
|
255
270
|
* const amount2 = new AmountEdge(5, MassUnitPoint.gram);
|
|
@@ -259,9 +274,9 @@ class AmountEdge {
|
|
|
259
274
|
return (guardian_1._.isEqual(this._value, amount.value) && guardian_1._.isEqual(this._unit, amount.unit));
|
|
260
275
|
}
|
|
261
276
|
/**
|
|
262
|
-
*
|
|
263
|
-
* @param amount -
|
|
264
|
-
* @returns true
|
|
277
|
+
* Checks whether this amount is different from another amount.
|
|
278
|
+
* @param amount - The amount to compare against.
|
|
279
|
+
* @returns `true` if the amounts are different; otherwise, `false`.
|
|
265
280
|
* @example
|
|
266
281
|
* const amount1 = new AmountEdge(5, MassUnitPoint.gram);
|
|
267
282
|
* const amount2 = new AmountEdge(3, MassUnitPoint.gram);
|
|
@@ -271,9 +286,9 @@ class AmountEdge {
|
|
|
271
286
|
return !this.isEqual(amount);
|
|
272
287
|
}
|
|
273
288
|
/**
|
|
274
|
-
*
|
|
275
|
-
* @param amount -
|
|
276
|
-
* @returns true
|
|
289
|
+
* Checks whether this amount is greater than another amount.
|
|
290
|
+
* @param amount - The amount to compare against.
|
|
291
|
+
* @returns `true` if this amount's value is greater than `amount`'s value; otherwise, `false`.
|
|
277
292
|
* @example
|
|
278
293
|
* const amount1 = new AmountEdge(10, MassUnitPoint.gram);
|
|
279
294
|
* const amount2 = new AmountEdge(5, MassUnitPoint.gram);
|
|
@@ -283,9 +298,9 @@ class AmountEdge {
|
|
|
283
298
|
return this._value > amount.value;
|
|
284
299
|
}
|
|
285
300
|
/**
|
|
286
|
-
*
|
|
287
|
-
* @param amount -
|
|
288
|
-
* @returns true
|
|
301
|
+
* Checks whether this amount is less than another amount.
|
|
302
|
+
* @param amount - The amount to compare against.
|
|
303
|
+
* @returns `true` if this amount's value is less than `amount`'s value; otherwise, `false`.
|
|
289
304
|
* @example
|
|
290
305
|
* const amount1 = new AmountEdge(3, MassUnitPoint.gram);
|
|
291
306
|
* const amount2 = new AmountEdge(5, MassUnitPoint.gram);
|
|
@@ -295,9 +310,9 @@ class AmountEdge {
|
|
|
295
310
|
return this._value < amount.value;
|
|
296
311
|
}
|
|
297
312
|
/**
|
|
298
|
-
*
|
|
299
|
-
* @param amount -
|
|
300
|
-
* @returns true
|
|
313
|
+
* Checks whether this amount is greater than or equal to another amount.
|
|
314
|
+
* @param amount - The amount to compare against.
|
|
315
|
+
* @returns `true` if this amount's value is greater than or equal to `amount`'s value; otherwise, `false`.
|
|
301
316
|
* @example
|
|
302
317
|
* const amount1 = new AmountEdge(5, MassUnitPoint.gram);
|
|
303
318
|
* const amount2 = new AmountEdge(5, MassUnitPoint.gram);
|
|
@@ -307,9 +322,9 @@ class AmountEdge {
|
|
|
307
322
|
return this._value >= amount.value;
|
|
308
323
|
}
|
|
309
324
|
/**
|
|
310
|
-
*
|
|
311
|
-
* @param amount -
|
|
312
|
-
* @returns true
|
|
325
|
+
* Checks whether this amount is less than or equal to another amount.
|
|
326
|
+
* @param amount - The amount to compare against.
|
|
327
|
+
* @returns `true` if this amount's value is less than or equal to `amount`'s value; otherwise, `false`.
|
|
313
328
|
* @example
|
|
314
329
|
* const amount1 = new AmountEdge(5, MassUnitPoint.gram);
|
|
315
330
|
* const amount2 = new AmountEdge(5, MassUnitPoint.gram);
|
|
@@ -319,10 +334,10 @@ class AmountEdge {
|
|
|
319
334
|
return this._value <= amount.value;
|
|
320
335
|
}
|
|
321
336
|
/**
|
|
322
|
-
*
|
|
323
|
-
* @param min -
|
|
324
|
-
* @param max -
|
|
325
|
-
* @returns true
|
|
337
|
+
* Checks whether this amount is between two bounds (inclusive).
|
|
338
|
+
* @param min - The minimum amount.
|
|
339
|
+
* @param max - The maximum amount.
|
|
340
|
+
* @returns `true` if the value is between min and max; otherwise, `false`.
|
|
326
341
|
* @example
|
|
327
342
|
* const amount = new AmountEdge(5, MassUnitPoint.gram);
|
|
328
343
|
* const min = new AmountEdge(1, MassUnitPoint.gram);
|
|
@@ -332,10 +347,12 @@ class AmountEdge {
|
|
|
332
347
|
isBetween(min, max) {
|
|
333
348
|
return this.isGreaterThanOrEqual(min) && this.isLessThanOrEqual(max);
|
|
334
349
|
}
|
|
335
|
-
// ====================
|
|
350
|
+
// ====================
|
|
351
|
+
// Validations
|
|
352
|
+
// ====================
|
|
336
353
|
/**
|
|
337
|
-
*
|
|
338
|
-
* @returns true
|
|
354
|
+
* Checks whether the value is zero.
|
|
355
|
+
* @returns `true` if this.value === 0, `false` otherwise
|
|
339
356
|
* @example
|
|
340
357
|
* const amount = new AmountEdge(0, MassUnitPoint.gram);
|
|
341
358
|
* amount.isZero(); // true
|
|
@@ -344,8 +361,8 @@ class AmountEdge {
|
|
|
344
361
|
return this._value === 0;
|
|
345
362
|
}
|
|
346
363
|
/**
|
|
347
|
-
*
|
|
348
|
-
* @returns true
|
|
364
|
+
* Checks whether the value is positive (greater than zero).
|
|
365
|
+
* @returns `true` if this.value > 0, `false` otherwise
|
|
349
366
|
* @example
|
|
350
367
|
* const amount = new AmountEdge(5, MassUnitPoint.gram);
|
|
351
368
|
* amount.isPositive(); // true
|
|
@@ -354,8 +371,8 @@ class AmountEdge {
|
|
|
354
371
|
return this._value > 0;
|
|
355
372
|
}
|
|
356
373
|
/**
|
|
357
|
-
*
|
|
358
|
-
* @returns true
|
|
374
|
+
* Checks whether the value is negative (less than zero).
|
|
375
|
+
* @returns `true` if this.value < 0, `false` otherwise
|
|
359
376
|
* @example
|
|
360
377
|
* const amount = new AmountEdge(-5, MassUnitPoint.gram);
|
|
361
378
|
* amount.isNegative(); // true
|
|
@@ -364,9 +381,9 @@ class AmountEdge {
|
|
|
364
381
|
return this._value < 0;
|
|
365
382
|
}
|
|
366
383
|
/**
|
|
367
|
-
*
|
|
368
|
-
* @param unit -
|
|
369
|
-
* @returns true
|
|
384
|
+
* Checks whether the amount has a specific unit.
|
|
385
|
+
* @param unit - The unit to compare against.
|
|
386
|
+
* @returns `true` if the unit matches; otherwise, `false`.
|
|
370
387
|
* @example
|
|
371
388
|
* const amount = new AmountEdge(5, MassUnitPoint.gram);
|
|
372
389
|
* amount.hasUnit(MassUnitPoint.gram); // true
|
|
@@ -375,24 +392,28 @@ class AmountEdge {
|
|
|
375
392
|
hasUnit(unit) {
|
|
376
393
|
return guardian_1._.isEqual(this._unit, unit);
|
|
377
394
|
}
|
|
378
|
-
// ====================
|
|
395
|
+
// ====================
|
|
396
|
+
// Cloning and Immutability
|
|
397
|
+
// ====================
|
|
379
398
|
/**
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
*
|
|
399
|
+
* Creates an independent copy of this amount.
|
|
400
|
+
* Useful for avoiding unintended mutations.
|
|
401
|
+
*
|
|
402
|
+
* @returns A new instance with the same value and unit.
|
|
403
|
+
*
|
|
383
404
|
* @example
|
|
384
405
|
* const amount1 = new AmountEdge(5, MassUnitPoint.gram);
|
|
385
406
|
* const amount2 = amount1.clone();
|
|
386
|
-
* amount2.multiplyBy(2); // amount1
|
|
407
|
+
* amount2.multiplyBy(2); // amount1 remains 5, amount2 is 10
|
|
387
408
|
*/
|
|
388
409
|
clone() {
|
|
389
410
|
return new AmountEdge(this._value, this._unit);
|
|
390
411
|
}
|
|
391
412
|
/**
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
* @param value -
|
|
395
|
-
* @returns
|
|
413
|
+
* Returns a new instance with the value changed.
|
|
414
|
+
* Maintains the immutability of the original instance.
|
|
415
|
+
* @param value - New value
|
|
416
|
+
* @returns New instance with the changed value
|
|
396
417
|
* @example
|
|
397
418
|
* const amount = new AmountEdge(5, MassUnitPoint.gram);
|
|
398
419
|
* const newAmount = amount.withValue(10); // amount continua 5, newAmount é 10
|
|
@@ -401,10 +422,10 @@ class AmountEdge {
|
|
|
401
422
|
return new AmountEdge(value, this._unit);
|
|
402
423
|
}
|
|
403
424
|
/**
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
* @param unit -
|
|
407
|
-
* @returns
|
|
425
|
+
* Returns a new instance with the unit changed.
|
|
426
|
+
* Maintains the immutability of the original instance.
|
|
427
|
+
* @param unit - New unit
|
|
428
|
+
* @returns New instance with the changed unit
|
|
408
429
|
* @example
|
|
409
430
|
* const amount = new AmountEdge(5, MassUnitPoint.gram);
|
|
410
431
|
* const newAmount = amount.withUnit(MassUnitPoint.kilogram);
|
|
@@ -412,10 +433,12 @@ class AmountEdge {
|
|
|
412
433
|
withUnit(unit) {
|
|
413
434
|
return new AmountEdge(this._value, unit);
|
|
414
435
|
}
|
|
415
|
-
// ====================
|
|
436
|
+
// ====================
|
|
437
|
+
// Formatting
|
|
438
|
+
// ====================
|
|
416
439
|
/**
|
|
417
|
-
*
|
|
418
|
-
* @returns
|
|
440
|
+
* Returns a string representation of the amount.
|
|
441
|
+
* @returns A string in the format "value unit".
|
|
419
442
|
* @example
|
|
420
443
|
* const amount = new AmountEdge(5, MassUnitPoint.gram);
|
|
421
444
|
* amount.toString(); // "5 g"
|
|
@@ -424,10 +447,10 @@ class AmountEdge {
|
|
|
424
447
|
return `${this._value.toString()} ${this._unit}`;
|
|
425
448
|
}
|
|
426
449
|
/**
|
|
427
|
-
*
|
|
428
|
-
* @param locale -
|
|
429
|
-
* @param precision -
|
|
430
|
-
* @returns
|
|
450
|
+
* Formats the amount as a string with a thousands separator and decimal precision.
|
|
451
|
+
* @param locale - Locale for formatting (e.g., 'en-US', 'pt-BR')
|
|
452
|
+
* @param precision - NNumber of decimal places
|
|
453
|
+
* @returns Formatted string
|
|
431
454
|
* @example
|
|
432
455
|
* const amount = new AmountEdge(1234.5678, MassUnitPoint.gram);
|
|
433
456
|
* amount.toFormattedString('pt-BR', 2); // "1.234,57 g"
|
|
@@ -440,9 +463,9 @@ class AmountEdge {
|
|
|
440
463
|
return `${formatted} ${this._unit}`;
|
|
441
464
|
}
|
|
442
465
|
/**
|
|
443
|
-
*
|
|
444
|
-
* @param precision -
|
|
445
|
-
* @returns
|
|
466
|
+
* Returns only the value as a string with specific precision.
|
|
467
|
+
* @param precision - NNumber of decimal places
|
|
468
|
+
* @returns Formatted value string
|
|
446
469
|
* @example
|
|
447
470
|
* const amount = new AmountEdge(5.6789, MassUnitPoint.gram);
|
|
448
471
|
* amount.toValueString(2); // "5.68"
|
|
@@ -450,11 +473,13 @@ class AmountEdge {
|
|
|
450
473
|
toValueString(precision = 2) {
|
|
451
474
|
return this._value.toFixed(precision);
|
|
452
475
|
}
|
|
453
|
-
// ====================
|
|
476
|
+
// ====================
|
|
477
|
+
// Conversion
|
|
478
|
+
// ====================
|
|
454
479
|
/**
|
|
455
|
-
*
|
|
456
|
-
* @param precision -
|
|
457
|
-
* @returns
|
|
480
|
+
* Converts the amount to a Polygon object.
|
|
481
|
+
* @param precision - The number of decimal places to retain.
|
|
482
|
+
* @returns A Polygon object containing the value and unit.
|
|
458
483
|
* @example
|
|
459
484
|
* const amount = new AmountEdge(5.6789, MassUnitPoint.gram);
|
|
460
485
|
* amount.toPolygon(2); // { value: 5.68, unit: MassUnitPoint.gram }
|
|
@@ -468,8 +493,8 @@ class AmountEdge {
|
|
|
468
493
|
};
|
|
469
494
|
}
|
|
470
495
|
/**
|
|
471
|
-
*
|
|
472
|
-
* @returns
|
|
496
|
+
* Converts the amount to a JSON object.
|
|
497
|
+
* @returns JSON object with value and unit
|
|
473
498
|
* @example
|
|
474
499
|
* const amount = new AmountEdge(5, MassUnitPoint.gram);
|
|
475
500
|
* amount.toJSON(); // { value: 5, unit: "g" }
|
|
@@ -480,12 +505,14 @@ class AmountEdge {
|
|
|
480
505
|
unit: this._unit,
|
|
481
506
|
};
|
|
482
507
|
}
|
|
483
|
-
// ====================
|
|
508
|
+
// ====================
|
|
509
|
+
// Static Methods
|
|
510
|
+
// ====================
|
|
484
511
|
/**
|
|
485
|
-
*
|
|
486
|
-
* @template T -
|
|
487
|
-
* @param unit -
|
|
488
|
-
* @returns
|
|
512
|
+
* Creates a new amount with a value of zero.
|
|
513
|
+
* @template T - The unit type.
|
|
514
|
+
* @param unit - The unit of the amount.
|
|
515
|
+
* @returns A new instance with a value of zero.
|
|
489
516
|
* @example
|
|
490
517
|
* const zero = AmountEdge.zero(MassUnitPoint.gram); // 0 g
|
|
491
518
|
*/
|
|
@@ -493,10 +520,10 @@ class AmountEdge {
|
|
|
493
520
|
return new AmountEdge(0, unit);
|
|
494
521
|
}
|
|
495
522
|
/**
|
|
496
|
-
*
|
|
497
|
-
* @template T -
|
|
498
|
-
* @param amounts -
|
|
499
|
-
* @returns
|
|
523
|
+
* Sums a list of amounts.
|
|
524
|
+
* @template T - The unit type.
|
|
525
|
+
* @param amounts - An array of amounts to sum.
|
|
526
|
+
* @returns A new instance containing the total sum.
|
|
500
527
|
* @example
|
|
501
528
|
* const amounts = [
|
|
502
529
|
* new AmountEdge(5, MassUnitPoint.gram),
|
|
@@ -516,10 +543,10 @@ class AmountEdge {
|
|
|
516
543
|
return total;
|
|
517
544
|
}
|
|
518
545
|
/**
|
|
519
|
-
*
|
|
520
|
-
* @template T -
|
|
521
|
-
* @param amounts -
|
|
522
|
-
* @returns
|
|
546
|
+
* Returns the maximum amount from a list.
|
|
547
|
+
* @template T - The unit type.
|
|
548
|
+
* @param amounts - n array of amounts.
|
|
549
|
+
* @returns A new instance with the maximum value.
|
|
523
550
|
* @example
|
|
524
551
|
* const amounts = [
|
|
525
552
|
* new AmountEdge(5, MassUnitPoint.gram),
|
|
@@ -541,10 +568,10 @@ class AmountEdge {
|
|
|
541
568
|
return maxAmount;
|
|
542
569
|
}
|
|
543
570
|
/**
|
|
544
|
-
*
|
|
545
|
-
* @template T -
|
|
546
|
-
* @param amounts -
|
|
547
|
-
* @returns
|
|
571
|
+
* Returns the minimum amount from a list.
|
|
572
|
+
* @template T - The unit type.
|
|
573
|
+
* @param amounts - An array of amounts.
|
|
574
|
+
* @returns A new instance containing the smallest value.
|
|
548
575
|
* @example
|
|
549
576
|
* const amounts = [
|
|
550
577
|
* new AmountEdge(5, MassUnitPoint.gram),
|
|
@@ -566,10 +593,10 @@ class AmountEdge {
|
|
|
566
593
|
return minAmount;
|
|
567
594
|
}
|
|
568
595
|
/**
|
|
569
|
-
*
|
|
570
|
-
* @template T -
|
|
571
|
-
* @param amounts -
|
|
572
|
-
* @returns
|
|
596
|
+
* Calculates the average of a list of amounts.
|
|
597
|
+
* @template T - The unit type.
|
|
598
|
+
* @param amounts - n array of amounts.
|
|
599
|
+
* @returns A new instance with the average value.
|
|
573
600
|
* @example
|
|
574
601
|
* const amounts = [
|
|
575
602
|
* new AmountEdge(10, MassUnitPoint.gram),
|
|
@@ -584,10 +611,10 @@ class AmountEdge {
|
|
|
584
611
|
return total;
|
|
585
612
|
}
|
|
586
613
|
/**
|
|
587
|
-
*
|
|
588
|
-
* @template T -
|
|
589
|
-
* @param polygon -
|
|
590
|
-
* @returns
|
|
614
|
+
* Creates an amount from a Polygon object.
|
|
615
|
+
* @template T - The unit type.
|
|
616
|
+
* @param polygon - A Polygon object containing `value` and `unit`.
|
|
617
|
+
* @returns A new AmountEdge instance.
|
|
591
618
|
* @example
|
|
592
619
|
* const polygon = { value: 5, unit: MassUnitPoint.gram };
|
|
593
620
|
* const amount = AmountEdge.fromPolygon(polygon); // 5 g
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"amount.polygon.d.ts","sourceRoot":"","sources":["../../../../src/objects/amount/amount.polygon.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa,CAAC,UAAU;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;CACjB"}
|