@warlock.js/notifications 4.16.0 → 5.0.1
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/CHANGELOG.md +6 -0
- package/cjs/channel_api-CH3DxhRU.cjs +7463 -0
- package/cjs/channel_api-CH3DxhRU.cjs.map +1 -0
- package/cjs/chunk-fl3r8ClO.cjs +41 -0
- package/cjs/index.cjs +1 -1
- package/cjs/index.cjs.map +1 -1
- package/cjs/rabbitmq-driver-CJtyxjUQ.cjs +3 -0
- package/cjs/src-Cus6pYPC.cjs +10981 -0
- package/cjs/src-Cus6pYPC.cjs.map +1 -0
- package/esm/_virtual/_rolldown/runtime.mjs +32 -0
- package/esm/herald/src/communicators/broker-registry.mjs +204 -0
- package/esm/herald/src/communicators/broker-registry.mjs.map +1 -0
- package/esm/herald/src/communicators/broker.mjs +110 -0
- package/esm/herald/src/communicators/broker.mjs.map +1 -0
- package/esm/herald/src/communicators/index.mjs +4 -0
- package/esm/herald/src/decorators/consumable.mjs +36 -0
- package/esm/herald/src/decorators/consumable.mjs.map +1 -0
- package/esm/herald/src/decorators/index.mjs +3 -0
- package/esm/herald/src/drivers/index.mjs +5 -0
- package/esm/herald/src/drivers/rabbitmq/index.mjs +4 -0
- package/esm/herald/src/drivers/rabbitmq/rabbitmq-channel.mjs +403 -0
- package/esm/herald/src/drivers/rabbitmq/rabbitmq-channel.mjs.map +1 -0
- package/esm/herald/src/drivers/rabbitmq/rabbitmq-driver.mjs +303 -0
- package/esm/herald/src/drivers/rabbitmq/rabbitmq-driver.mjs.map +1 -0
- package/esm/herald/src/index.mjs +16 -0
- package/esm/herald/src/message-managers/event-consumer.mjs +76 -0
- package/esm/herald/src/message-managers/event-consumer.mjs.map +1 -0
- package/esm/herald/src/message-managers/event-message.mjs +85 -0
- package/esm/herald/src/message-managers/event-message.mjs.map +1 -0
- package/esm/herald/src/message-managers/index.mjs +4 -0
- package/esm/herald/src/message-managers/prepare-consumer-subscription.mjs +42 -0
- package/esm/herald/src/message-managers/prepare-consumer-subscription.mjs.map +1 -0
- package/esm/herald/src/use-case-broadcast.mjs +30 -0
- package/esm/herald/src/use-case-broadcast.mjs.map +1 -0
- package/esm/herald/src/utils/connect-to-broker.mjs +168 -0
- package/esm/herald/src/utils/connect-to-broker.mjs.map +1 -0
- package/esm/herald/src/utils/index.mjs +3 -0
- package/esm/in-app/in-app.d.mts +3 -3
- package/esm/in-app/in-app.d.mts.map +1 -1
- package/esm/node_modules/@mongez/reinforcements/esm/Random/_internal.mjs +6 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/_internal.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/bool.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/color.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/date.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/float.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/id.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/int.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/nanoid.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/pick.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/random.mjs +16 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/sample.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/string.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/token.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/uuid.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/Random/weighted.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/async/retry.mjs +3 -0
- package/esm/node_modules/@mongez/reinforcements/esm/index.mjs +24 -0
- package/esm/node_modules/@mongez/reinforcements/esm/mixed/clone/clone.mjs +82 -0
- package/esm/node_modules/@mongez/reinforcements/esm/mixed/clone/clone.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/number/round.mjs +17 -0
- package/esm/node_modules/@mongez/reinforcements/esm/number/round.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/object/except.mjs +13 -0
- package/esm/node_modules/@mongez/reinforcements/esm/object/except.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/object/get.mjs +18 -0
- package/esm/node_modules/@mongez/reinforcements/esm/object/get.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/object/omit.mjs +17 -0
- package/esm/node_modules/@mongez/reinforcements/esm/object/omit.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/object/unset.mjs +30 -0
- package/esm/node_modules/@mongez/reinforcements/esm/object/unset.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/capitalize.mjs +19 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/capitalize.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/ltrim.mjs +18 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/ltrim.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/readMoreChars.mjs +14 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/readMoreChars.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/rtrim.mjs +18 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/rtrim.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/toCamelCase.mjs +22 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/toCamelCase.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/toKebabCase.mjs +17 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/toKebabCase.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/toSnakeCase.mjs +21 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/toSnakeCase.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/toStudlyCase.mjs +21 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/toStudlyCase.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/trim.mjs +20 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/trim.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/ucfirst.mjs +15 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/ucfirst.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/words.mjs +25 -0
- package/esm/node_modules/@mongez/reinforcements/esm/string/words.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/utils/escapeRegex.mjs +11 -0
- package/esm/node_modules/@mongez/reinforcements/esm/utils/escapeRegex.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/utils/lazy.mjs +100 -0
- package/esm/node_modules/@mongez/reinforcements/esm/utils/lazy.mjs.map +1 -0
- package/esm/node_modules/@mongez/reinforcements/esm/utils/tap.mjs +27 -0
- package/esm/node_modules/@mongez/reinforcements/esm/utils/tap.mjs.map +1 -0
- package/esm/node_modules/@mongez/supportive-is/esm/index.mjs +353 -0
- package/esm/node_modules/@mongez/supportive-is/esm/index.mjs.map +1 -0
- package/esm/node_modules/amqplib/channel_api.mjs +28 -0
- package/esm/node_modules/amqplib/channel_api.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/api_args.mjs +241 -0
- package/esm/node_modules/amqplib/lib/api_args.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/bitset.mjs +130 -0
- package/esm/node_modules/amqplib/lib/bitset.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/channel.mjs +302 -0
- package/esm/node_modules/amqplib/lib/channel.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/channel_model.mjs +206 -0
- package/esm/node_modules/amqplib/lib/channel_model.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/codec.mjs +273 -0
- package/esm/node_modules/amqplib/lib/codec.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/connect.mjs +143 -0
- package/esm/node_modules/amqplib/lib/connect.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/connection.mjs +416 -0
- package/esm/node_modules/amqplib/lib/connection.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/credentials.mjs +50 -0
- package/esm/node_modules/amqplib/lib/credentials.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/defs.mjs +4600 -0
- package/esm/node_modules/amqplib/lib/defs.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/error.mjs +29 -0
- package/esm/node_modules/amqplib/lib/error.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/format.mjs +28 -0
- package/esm/node_modules/amqplib/lib/format.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/frame.mjs +130 -0
- package/esm/node_modules/amqplib/lib/frame.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/heartbeat.mjs +40 -0
- package/esm/node_modules/amqplib/lib/heartbeat.mjs.map +1 -0
- package/esm/node_modules/amqplib/lib/mux.mjs +86 -0
- package/esm/node_modules/amqplib/lib/mux.mjs.map +1 -0
- package/esm/node_modules/amqplib/package.mjs +41 -0
- package/esm/node_modules/amqplib/package.mjs.map +1 -0
- package/esm/node_modules/buffer-more-ints/buffer-more-ints.mjs +360 -0
- package/esm/node_modules/buffer-more-ints/buffer-more-ints.mjs.map +1 -0
- package/esm/node_modules/dayjs/dayjs.min.mjs +305 -0
- package/esm/node_modules/dayjs/dayjs.min.mjs.map +1 -0
- package/esm/node_modules/querystringify/index.mjs +80 -0
- package/esm/node_modules/querystringify/index.mjs.map +1 -0
- package/esm/node_modules/requires-port/index.mjs +35 -0
- package/esm/node_modules/requires-port/index.mjs.map +1 -0
- package/esm/node_modules/url-parse/index.mjs +388 -0
- package/esm/node_modules/url-parse/index.mjs.map +1 -0
- package/esm/queue/load-herald.mjs +1 -1
- package/esm/seal/src/config.mjs +15 -0
- package/esm/seal/src/config.mjs.map +1 -0
- package/esm/seal/src/factory/index.mjs +4 -0
- package/esm/seal/src/factory/validate.mjs +34 -0
- package/esm/seal/src/factory/validate.mjs.map +1 -0
- package/esm/seal/src/factory/validators.mjs +132 -0
- package/esm/seal/src/factory/validators.mjs.map +1 -0
- package/esm/seal/src/helpers/date-helpers.mjs +24 -0
- package/esm/seal/src/helpers/date-helpers.mjs.map +1 -0
- package/esm/seal/src/helpers/get-field-value.mjs +46 -0
- package/esm/seal/src/helpers/get-field-value.mjs.map +1 -0
- package/esm/seal/src/helpers/index.mjs +6 -0
- package/esm/seal/src/helpers/is-empty-value.mjs +10 -0
- package/esm/seal/src/helpers/is-empty-value.mjs.map +1 -0
- package/esm/seal/src/helpers/path-helpers.mjs +12 -0
- package/esm/seal/src/helpers/path-helpers.mjs.map +1 -0
- package/esm/seal/src/helpers/validation-helpers.mjs +72 -0
- package/esm/seal/src/helpers/validation-helpers.mjs.map +1 -0
- package/esm/seal/src/index.mjs +87 -0
- package/esm/seal/src/mutators/array-mutators.mjs +32 -0
- package/esm/seal/src/mutators/array-mutators.mjs.map +1 -0
- package/esm/seal/src/mutators/date-mutators.mjs +94 -0
- package/esm/seal/src/mutators/date-mutators.mjs.map +1 -0
- package/esm/seal/src/mutators/index.mjs +8 -0
- package/esm/seal/src/mutators/number-mutators.mjs +52 -0
- package/esm/seal/src/mutators/number-mutators.mjs.map +1 -0
- package/esm/seal/src/mutators/object-mutators.mjs +30 -0
- package/esm/seal/src/mutators/object-mutators.mjs.map +1 -0
- package/esm/seal/src/mutators/scalar-mutators.mjs +9 -0
- package/esm/seal/src/mutators/scalar-mutators.mjs.map +1 -0
- package/esm/seal/src/mutators/string-mutators.mjs +186 -0
- package/esm/seal/src/mutators/string-mutators.mjs.map +1 -0
- package/esm/seal/src/rules/array/array-rules.mjs +41 -0
- package/esm/seal/src/rules/array/array-rules.mjs.map +1 -0
- package/esm/seal/src/rules/array/index.mjs +3 -0
- package/esm/seal/src/rules/color/color-rules.mjs +104 -0
- package/esm/seal/src/rules/color/color-rules.mjs.map +1 -0
- package/esm/seal/src/rules/color/index.mjs +3 -0
- package/esm/seal/src/rules/common/enum.mjs +77 -0
- package/esm/seal/src/rules/common/enum.mjs.map +1 -0
- package/esm/seal/src/rules/common/equals-field-rules.mjs +42 -0
- package/esm/seal/src/rules/common/equals-field-rules.mjs.map +1 -0
- package/esm/seal/src/rules/common/index.mjs +8 -0
- package/esm/seal/src/rules/common/instanceof.mjs +23 -0
- package/esm/seal/src/rules/common/instanceof.mjs.map +1 -0
- package/esm/seal/src/rules/common/literal.mjs +31 -0
- package/esm/seal/src/rules/common/literal.mjs.map +1 -0
- package/esm/seal/src/rules/common/type-rules.mjs +97 -0
- package/esm/seal/src/rules/common/type-rules.mjs.map +1 -0
- package/esm/seal/src/rules/common/unknown-key.mjs +25 -0
- package/esm/seal/src/rules/common/unknown-key.mjs.map +1 -0
- package/esm/seal/src/rules/conditional/forbidden-if-rules.mjs +116 -0
- package/esm/seal/src/rules/conditional/forbidden-if-rules.mjs.map +1 -0
- package/esm/seal/src/rules/conditional/index.mjs +12 -0
- package/esm/seal/src/rules/conditional/present-if-rules.mjs +97 -0
- package/esm/seal/src/rules/conditional/present-if-rules.mjs.map +1 -0
- package/esm/seal/src/rules/conditional/present-unless-rules.mjs +30 -0
- package/esm/seal/src/rules/conditional/present-unless-rules.mjs.map +1 -0
- package/esm/seal/src/rules/conditional/present-with-rules.mjs +76 -0
- package/esm/seal/src/rules/conditional/present-with-rules.mjs.map +1 -0
- package/esm/seal/src/rules/conditional/present-without-rules.mjs +76 -0
- package/esm/seal/src/rules/conditional/present-without-rules.mjs.map +1 -0
- package/esm/seal/src/rules/conditional/required-if-rules.mjs +204 -0
- package/esm/seal/src/rules/conditional/required-if-rules.mjs.map +1 -0
- package/esm/seal/src/rules/conditional/required-unless-rules.mjs +31 -0
- package/esm/seal/src/rules/conditional/required-unless-rules.mjs.map +1 -0
- package/esm/seal/src/rules/conditional/required-when-rule.mjs +32 -0
- package/esm/seal/src/rules/conditional/required-when-rule.mjs.map +1 -0
- package/esm/seal/src/rules/conditional/required-with-rules.mjs +67 -0
- package/esm/seal/src/rules/conditional/required-with-rules.mjs.map +1 -0
- package/esm/seal/src/rules/conditional/required-without-rules.mjs +67 -0
- package/esm/seal/src/rules/conditional/required-without-rules.mjs.map +1 -0
- package/esm/seal/src/rules/core/equal.mjs +22 -0
- package/esm/seal/src/rules/core/equal.mjs.map +1 -0
- package/esm/seal/src/rules/core/forbidden.mjs +20 -0
- package/esm/seal/src/rules/core/forbidden.mjs.map +1 -0
- package/esm/seal/src/rules/core/index.mjs +7 -0
- package/esm/seal/src/rules/core/required.mjs +36 -0
- package/esm/seal/src/rules/core/required.mjs.map +1 -0
- package/esm/seal/src/rules/core/union.mjs +30 -0
- package/esm/seal/src/rules/core/union.mjs.map +1 -0
- package/esm/seal/src/rules/core/when.mjs +37 -0
- package/esm/seal/src/rules/core/when.mjs.map +1 -0
- package/esm/seal/src/rules/date/date-comparison-rules.mjs +78 -0
- package/esm/seal/src/rules/date/date-comparison-rules.mjs.map +1 -0
- package/esm/seal/src/rules/date/date-day-rules.mjs +49 -0
- package/esm/seal/src/rules/date/date-day-rules.mjs.map +1 -0
- package/esm/seal/src/rules/date/date-field-comparison-rules.mjs +82 -0
- package/esm/seal/src/rules/date/date-field-comparison-rules.mjs.map +1 -0
- package/esm/seal/src/rules/date/date-period-rules.mjs +399 -0
- package/esm/seal/src/rules/date/date-period-rules.mjs.map +1 -0
- package/esm/seal/src/rules/date/date-relative-rules.mjs +55 -0
- package/esm/seal/src/rules/date/date-relative-rules.mjs.map +1 -0
- package/esm/seal/src/rules/date/date-special-rules.mjs +58 -0
- package/esm/seal/src/rules/date/date-special-rules.mjs.map +1 -0
- package/esm/seal/src/rules/date/date.mjs +235 -0
- package/esm/seal/src/rules/date/date.mjs.map +1 -0
- package/esm/seal/src/rules/date/index.mjs +9 -0
- package/esm/seal/src/rules/file/dimensions.mjs +3 -0
- package/esm/seal/src/rules/file/file-size.mjs +3 -0
- package/esm/seal/src/rules/file/index.mjs +4 -0
- package/esm/seal/src/rules/index.mjs +54 -0
- package/esm/seal/src/rules/length/index.mjs +3 -0
- package/esm/seal/src/rules/length/length-rules.mjs +98 -0
- package/esm/seal/src/rules/length/length-rules.mjs.map +1 -0
- package/esm/seal/src/rules/number/index.mjs +3 -0
- package/esm/seal/src/rules/number/number-rules.mjs +197 -0
- package/esm/seal/src/rules/number/number-rules.mjs.map +1 -0
- package/esm/seal/src/rules/scalar/accepted-rule.mjs +116 -0
- package/esm/seal/src/rules/scalar/accepted-rule.mjs.map +1 -0
- package/esm/seal/src/rules/scalar/declined-rule.mjs +116 -0
- package/esm/seal/src/rules/scalar/declined-rule.mjs.map +1 -0
- package/esm/seal/src/rules/scalar/index.mjs +4 -0
- package/esm/seal/src/rules/string/alpha.mjs +41 -0
- package/esm/seal/src/rules/string/alpha.mjs.map +1 -0
- package/esm/seal/src/rules/string/credit-card.mjs +32 -0
- package/esm/seal/src/rules/string/credit-card.mjs.map +1 -0
- package/esm/seal/src/rules/string/email.mjs +20 -0
- package/esm/seal/src/rules/string/email.mjs.map +1 -0
- package/esm/seal/src/rules/string/id-formats.mjs +104 -0
- package/esm/seal/src/rules/string/id-formats.mjs.map +1 -0
- package/esm/seal/src/rules/string/index.mjs +13 -0
- package/esm/seal/src/rules/string/ip.mjs +66 -0
- package/esm/seal/src/rules/string/ip.mjs.map +1 -0
- package/esm/seal/src/rules/string/matches.mjs +4 -0
- package/esm/seal/src/rules/string/pattern.mjs +20 -0
- package/esm/seal/src/rules/string/pattern.mjs.map +1 -0
- package/esm/seal/src/rules/string/string-comparison.mjs +56 -0
- package/esm/seal/src/rules/string/string-comparison.mjs.map +1 -0
- package/esm/seal/src/rules/string/strong-password-rule.mjs +31 -0
- package/esm/seal/src/rules/string/strong-password-rule.mjs.map +1 -0
- package/esm/seal/src/rules/string/url.mjs +23 -0
- package/esm/seal/src/rules/string/url.mjs.map +1 -0
- package/esm/seal/src/rules/string/without-whitespace.mjs +19 -0
- package/esm/seal/src/rules/string/without-whitespace.mjs.map +1 -0
- package/esm/seal/src/standard-schema/json-schema.mjs +81 -0
- package/esm/seal/src/standard-schema/json-schema.mjs.map +1 -0
- package/esm/seal/src/standard-schema/map-result.mjs +26 -0
- package/esm/seal/src/standard-schema/map-result.mjs.map +1 -0
- package/esm/seal/src/types/date-types.mjs +17 -0
- package/esm/seal/src/types/date-types.mjs.map +1 -0
- package/esm/seal/src/validators/any-validator.mjs +38 -0
- package/esm/seal/src/validators/any-validator.mjs.map +1 -0
- package/esm/seal/src/validators/array-validator.mjs +177 -0
- package/esm/seal/src/validators/array-validator.mjs.map +1 -0
- package/esm/seal/src/validators/base-validator.mjs +691 -0
- package/esm/seal/src/validators/base-validator.mjs.map +1 -0
- package/esm/seal/src/validators/boolean-validator.mjs +126 -0
- package/esm/seal/src/validators/boolean-validator.mjs.map +1 -0
- package/esm/seal/src/validators/computed-validator.mjs +118 -0
- package/esm/seal/src/validators/computed-validator.mjs.map +1 -0
- package/esm/seal/src/validators/date-validator.mjs +639 -0
- package/esm/seal/src/validators/date-validator.mjs.map +1 -0
- package/esm/seal/src/validators/discriminated-union-validator.mjs +129 -0
- package/esm/seal/src/validators/discriminated-union-validator.mjs.map +1 -0
- package/esm/seal/src/validators/float-validator.mjs +18 -0
- package/esm/seal/src/validators/float-validator.mjs.map +1 -0
- package/esm/seal/src/validators/index.mjs +28 -0
- package/esm/seal/src/validators/instanceof-validator.mjs +64 -0
- package/esm/seal/src/validators/instanceof-validator.mjs.map +1 -0
- package/esm/seal/src/validators/int-validator.mjs +30 -0
- package/esm/seal/src/validators/int-validator.mjs.map +1 -0
- package/esm/seal/src/validators/lazy-validator.mjs +87 -0
- package/esm/seal/src/validators/lazy-validator.mjs.map +1 -0
- package/esm/seal/src/validators/literal-validator.mjs +71 -0
- package/esm/seal/src/validators/literal-validator.mjs.map +1 -0
- package/esm/seal/src/validators/managed-validator.mjs +39 -0
- package/esm/seal/src/validators/managed-validator.mjs.map +1 -0
- package/esm/seal/src/validators/methods/equality-conditional-methods.mjs +129 -0
- package/esm/seal/src/validators/methods/equality-conditional-methods.mjs.map +1 -0
- package/esm/seal/src/validators/methods/forbidden-methods.mjs +131 -0
- package/esm/seal/src/validators/methods/forbidden-methods.mjs.map +1 -0
- package/esm/seal/src/validators/methods/present-methods.mjs +235 -0
- package/esm/seal/src/validators/methods/present-methods.mjs.map +1 -0
- package/esm/seal/src/validators/methods/required-methods.mjs +347 -0
- package/esm/seal/src/validators/methods/required-methods.mjs.map +1 -0
- package/esm/seal/src/validators/number-validator.mjs +310 -0
- package/esm/seal/src/validators/number-validator.mjs.map +1 -0
- package/esm/seal/src/validators/numeric-validator.mjs +27 -0
- package/esm/seal/src/validators/numeric-validator.mjs.map +1 -0
- package/esm/seal/src/validators/object-validator.mjs +442 -0
- package/esm/seal/src/validators/object-validator.mjs.map +1 -0
- package/esm/seal/src/validators/primitive-validator.mjs +89 -0
- package/esm/seal/src/validators/primitive-validator.mjs.map +1 -0
- package/esm/seal/src/validators/record-validator.mjs +112 -0
- package/esm/seal/src/validators/record-validator.mjs.map +1 -0
- package/esm/seal/src/validators/scalar-validator.mjs +172 -0
- package/esm/seal/src/validators/scalar-validator.mjs.map +1 -0
- package/esm/seal/src/validators/string-validator.mjs +459 -0
- package/esm/seal/src/validators/string-validator.mjs.map +1 -0
- package/esm/seal/src/validators/tuple-validator.mjs +134 -0
- package/esm/seal/src/validators/tuple-validator.mjs.map +1 -0
- package/esm/seal/src/validators/union-validator.mjs +66 -0
- package/esm/seal/src/validators/union-validator.mjs.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { brokerRegistry } from "../communicators/broker-registry.mjs";
|
|
2
|
+
import "../communicators/index.mjs";
|
|
3
|
+
|
|
4
|
+
//#region ../herald/src/utils/connect-to-broker.ts
|
|
5
|
+
/**
|
|
6
|
+
* Connect to a message broker and register it.
|
|
7
|
+
*
|
|
8
|
+
* This is a high-level utility function that simplifies connection setup
|
|
9
|
+
* for most projects. It handles driver instantiation, connection,
|
|
10
|
+
* broker creation, and automatic registration.
|
|
11
|
+
*
|
|
12
|
+
* **Supported Drivers:**
|
|
13
|
+
* - `rabbitmq` (default) - RabbitMQ/AMQP driver
|
|
14
|
+
* - `kafka` - Apache Kafka driver (coming soon)
|
|
15
|
+
*
|
|
16
|
+
* @param options - Connection configuration options
|
|
17
|
+
* @returns A connected and registered Broker instance
|
|
18
|
+
* @throws {Error} If connection fails or driver is not implemented
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // RabbitMQ connection
|
|
23
|
+
* const broker = await connectToBroker({
|
|
24
|
+
* driver: "rabbitmq",
|
|
25
|
+
* host: "localhost",
|
|
26
|
+
* port: 5672,
|
|
27
|
+
* username: "guest",
|
|
28
|
+
* password: "guest",
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* // Use the broker
|
|
32
|
+
* await broker.channel("user.created").publish({ userId: 1 });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* // Multiple brokers
|
|
38
|
+
* await connectToBroker({
|
|
39
|
+
* driver: "rabbitmq",
|
|
40
|
+
* name: "notifications",
|
|
41
|
+
* isDefault: true,
|
|
42
|
+
* host: process.env.RABBITMQ_HOST,
|
|
43
|
+
* });
|
|
44
|
+
*
|
|
45
|
+
* await connectToBroker({
|
|
46
|
+
* driver: "rabbitmq",
|
|
47
|
+
* name: "analytics",
|
|
48
|
+
* host: process.env.ANALYTICS_RABBITMQ_HOST,
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* // Use default broker
|
|
52
|
+
* herald().channel("notifications").publish({ ... });
|
|
53
|
+
*
|
|
54
|
+
* // Use specific broker
|
|
55
|
+
* herald("analytics").channel("events").publish({ ... });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
async function connectToBroker(options) {
|
|
59
|
+
const driverType = options.driver ?? "rabbitmq";
|
|
60
|
+
const brokerName = options.name ?? "default";
|
|
61
|
+
const isDefault = options.isDefault ?? true;
|
|
62
|
+
let driver;
|
|
63
|
+
switch (driverType) {
|
|
64
|
+
case "rabbitmq": {
|
|
65
|
+
const rabbitOptions = options;
|
|
66
|
+
const { RabbitMQDriver } = await import("../drivers/rabbitmq/rabbitmq-driver.mjs");
|
|
67
|
+
driver = new RabbitMQDriver(rabbitOptions);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case "kafka": throw new Error("Kafka driver is not yet implemented. Coming soon! For now, please use RabbitMQ.");
|
|
71
|
+
default: throw new Error(`Unknown driver: "${driverType}". Supported drivers: rabbitmq, kafka`);
|
|
72
|
+
}
|
|
73
|
+
const broker = brokerRegistry.register({
|
|
74
|
+
name: brokerName,
|
|
75
|
+
driver,
|
|
76
|
+
isDefault
|
|
77
|
+
});
|
|
78
|
+
try {
|
|
79
|
+
await driver.connect();
|
|
80
|
+
} catch (error) {
|
|
81
|
+
throw new Error(`Failed to connect to ${driverType}: ${error instanceof Error ? error.message : String(error)}`);
|
|
82
|
+
}
|
|
83
|
+
return broker;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Get a broker by name or the default one.
|
|
87
|
+
*
|
|
88
|
+
* This is the main entry point for using brokers in your application.
|
|
89
|
+
* Named after the package — `herald()` carries your messages!
|
|
90
|
+
*
|
|
91
|
+
* @param name - Optional broker name (uses default if not provided)
|
|
92
|
+
* @returns Broker instance
|
|
93
|
+
* @throws MissingBrokerError if broker not found
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* // Get default broker
|
|
97
|
+
* const channel = herald().channel("user.created");
|
|
98
|
+
* await channel.publish({ userId: 1 });
|
|
99
|
+
*
|
|
100
|
+
* // Get specific broker
|
|
101
|
+
* const analyticsChannel = herald("analytics").channel("events");
|
|
102
|
+
* await analyticsChannel.publish({ event: "page_view" });
|
|
103
|
+
*
|
|
104
|
+
* // Subscribe to messages
|
|
105
|
+
* herald()
|
|
106
|
+
* .channel<UserPayload>("user.created")
|
|
107
|
+
* .subscribe(async (message, ctx) => {
|
|
108
|
+
* console.log("User created:", message.payload);
|
|
109
|
+
* await ctx.ack();
|
|
110
|
+
* });
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
function herald(name) {
|
|
114
|
+
return brokerRegistry.get(name);
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Get channel instance for the given name from default broker.
|
|
118
|
+
*
|
|
119
|
+
* Shorthand for `herald().channel(name, options)`.
|
|
120
|
+
*
|
|
121
|
+
* @param name - Channel name
|
|
122
|
+
* @param options - Optional channel options
|
|
123
|
+
* @returns Channel instance
|
|
124
|
+
* @throws MissingBrokerError if broker not found
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* const channel = heraldChannel("user.created");
|
|
129
|
+
* await channel.publish({ userId: 1 });
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
function heraldChannel(name, options) {
|
|
133
|
+
return herald().channel(name, options);
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Publish an EventMessage to the default broker.
|
|
137
|
+
*
|
|
138
|
+
* @param event - Event message to publish
|
|
139
|
+
* @returns Promise that resolves when the event is published
|
|
140
|
+
* @throws Error if the broker is not connected
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* await publishEvent(new UserUpdatedEvent({ id: 1, name: "John Doe" }));
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
async function publishEvent(event) {
|
|
148
|
+
return herald().publish(event);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Subscribe an EventConsumer class to the default broker.
|
|
152
|
+
*
|
|
153
|
+
* @param Consumer - Event consumer class
|
|
154
|
+
* @returns Unsubscribe function
|
|
155
|
+
* @throws MissingBrokerError if broker not found
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* await subscribeConsumer(UserUpdatedConsumer);
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
async function subscribeConsumer(Consumer) {
|
|
163
|
+
return herald().subscribe(Consumer);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
//#endregion
|
|
167
|
+
export { connectToBroker, herald, heraldChannel, publishEvent, subscribeConsumer };
|
|
168
|
+
//# sourceMappingURL=connect-to-broker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect-to-broker.mjs","names":[],"sources":["../../../../../../../../../herald/src/utils/connect-to-broker.ts"],"sourcesContent":["import { Broker, brokerRegistry } from \"../communicators\";\r\nimport type { BrokerDriverContract, ChannelContract } from \"../contracts\";\r\nimport { EventConsumerClass, EventMessage } from \"../message-managers\";\r\nimport type { ChannelOptions, ConnectionOptions, RabbitMQConnectionOptions } from \"../types\";\r\n\r\n/**\r\n * Connect to a message broker and register it.\r\n *\r\n * This is a high-level utility function that simplifies connection setup\r\n * for most projects. It handles driver instantiation, connection,\r\n * broker creation, and automatic registration.\r\n *\r\n * **Supported Drivers:**\r\n * - `rabbitmq` (default) - RabbitMQ/AMQP driver\r\n * - `kafka` - Apache Kafka driver (coming soon)\r\n *\r\n * @param options - Connection configuration options\r\n * @returns A connected and registered Broker instance\r\n * @throws {Error} If connection fails or driver is not implemented\r\n *\r\n * @example\r\n * ```typescript\r\n * // RabbitMQ connection\r\n * const broker = await connectToBroker({\r\n * driver: \"rabbitmq\",\r\n * host: \"localhost\",\r\n * port: 5672,\r\n * username: \"guest\",\r\n * password: \"guest\",\r\n * });\r\n *\r\n * // Use the broker\r\n * await broker.channel(\"user.created\").publish({ userId: 1 });\r\n * ```\r\n *\r\n * @example\r\n * ```typescript\r\n * // Multiple brokers\r\n * await connectToBroker({\r\n * driver: \"rabbitmq\",\r\n * name: \"notifications\",\r\n * isDefault: true,\r\n * host: process.env.RABBITMQ_HOST,\r\n * });\r\n *\r\n * await connectToBroker({\r\n * driver: \"rabbitmq\",\r\n * name: \"analytics\",\r\n * host: process.env.ANALYTICS_RABBITMQ_HOST,\r\n * });\r\n *\r\n * // Use default broker\r\n * herald().channel(\"notifications\").publish({ ... });\r\n *\r\n * // Use specific broker\r\n * herald(\"analytics\").channel(\"events\").publish({ ... });\r\n * ```\r\n */\r\nexport async function connectToBroker(options: ConnectionOptions): Promise<Broker> {\r\n // Default values\r\n const driverType = options.driver ?? \"rabbitmq\";\r\n const brokerName = options.name ?? \"default\";\r\n const isDefault = options.isDefault ?? true;\r\n\r\n // Create driver based on type\r\n let driver: BrokerDriverContract;\r\n\r\n switch (driverType) {\r\n case \"rabbitmq\": {\r\n const rabbitOptions = options as RabbitMQConnectionOptions;\r\n // Dynamic import to avoid requiring amqplib if not used\r\n const { RabbitMQDriver } = await import(\"../drivers/rabbitmq/rabbitmq-driver\");\r\n driver = new RabbitMQDriver(rabbitOptions);\r\n break;\r\n }\r\n\r\n case \"kafka\": {\r\n // const kafkaOptions = options as KafkaConnectionOptions;\r\n // Dynamic import to avoid requiring kafkajs if not used\r\n throw new Error(\r\n \"Kafka driver is not yet implemented. Coming soon! For now, please use RabbitMQ.\",\r\n );\r\n }\r\n\r\n default:\r\n throw new Error(`Unknown driver: \"${driverType}\". Supported drivers: rabbitmq, kafka`);\r\n }\r\n\r\n // Create broker\r\n const broker = brokerRegistry.register({\r\n name: brokerName,\r\n driver,\r\n isDefault,\r\n });\r\n\r\n // Connect to the message broker\r\n try {\r\n await driver.connect();\r\n } catch (error) {\r\n throw new Error(\r\n `Failed to connect to ${driverType}: ${error instanceof Error ? error.message : String(error)}`,\r\n );\r\n }\r\n\r\n return broker;\r\n}\r\n\r\n/**\r\n * Get a broker by name or the default one.\r\n *\r\n * This is the main entry point for using brokers in your application.\r\n * Named after the package — `herald()` carries your messages!\r\n *\r\n * @param name - Optional broker name (uses default if not provided)\r\n * @returns Broker instance\r\n * @throws MissingBrokerError if broker not found\r\n *\r\n * @example\r\n * // Get default broker\r\n * const channel = herald().channel(\"user.created\");\r\n * await channel.publish({ userId: 1 });\r\n *\r\n * // Get specific broker\r\n * const analyticsChannel = herald(\"analytics\").channel(\"events\");\r\n * await analyticsChannel.publish({ event: \"page_view\" });\r\n *\r\n * // Subscribe to messages\r\n * herald()\r\n * .channel<UserPayload>(\"user.created\")\r\n * .subscribe(async (message, ctx) => {\r\n * console.log(\"User created:\", message.payload);\r\n * await ctx.ack();\r\n * });\r\n * ```\r\n */\r\nexport function herald(name?: string): Broker {\r\n return brokerRegistry.get(name);\r\n}\r\n\r\n/**\r\n * Get channel instance for the given name from default broker.\r\n *\r\n * Shorthand for `herald().channel(name, options)`.\r\n *\r\n * @param name - Channel name\r\n * @param options - Optional channel options\r\n * @returns Channel instance\r\n * @throws MissingBrokerError if broker not found\r\n *\r\n * @example\r\n * ```typescript\r\n * const channel = heraldChannel(\"user.created\");\r\n * await channel.publish({ userId: 1 });\r\n * ```\r\n */\r\nexport function heraldChannel<TPayload = unknown>(\r\n name: string,\r\n options?: ChannelOptions<TPayload>,\r\n): ChannelContract<TPayload> {\r\n return herald().channel<TPayload>(name, options);\r\n}\r\n\r\n/**\r\n * Publish an EventMessage to the default broker.\r\n *\r\n * @param event - Event message to publish\r\n * @returns Promise that resolves when the event is published\r\n * @throws Error if the broker is not connected\r\n *\r\n * @example\r\n * ```typescript\r\n * await publishEvent(new UserUpdatedEvent({ id: 1, name: \"John Doe\" }));\r\n * ```\r\n */\r\nexport async function publishEvent<TPayload = Record<string, any>>(event: EventMessage<TPayload>) {\r\n return herald().publish(event);\r\n}\r\n\r\n/**\r\n * Subscribe an EventConsumer class to the default broker.\r\n *\r\n * @param Consumer - Event consumer class\r\n * @returns Unsubscribe function\r\n * @throws MissingBrokerError if broker not found\r\n *\r\n * @example\r\n * ```typescript\r\n * await subscribeConsumer(UserUpdatedConsumer);\r\n * ```\r\n */\r\nexport async function subscribeConsumer<TPayload = Record<string, any>>(\r\n Consumer: EventConsumerClass<TPayload>,\r\n) {\r\n return herald().subscribe(Consumer);\r\n}\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,eAAsB,gBAAgB,SAA6C;CAEjF,MAAM,aAAa,QAAQ,UAAU;CACrC,MAAM,aAAa,QAAQ,QAAQ;CACnC,MAAM,YAAY,QAAQ,aAAa;CAGvC,IAAI;CAEJ,QAAQ,YAAR;EACE,KAAK,YAAY;GACf,MAAM,gBAAgB;GAEtB,MAAM,EAAE,mBAAmB,MAAM,OAAO;GACxC,SAAS,IAAI,eAAe,aAAa;GACzC;EACF;EAEA,KAAK,SAGH,MAAM,IAAI,MACR,iFACF;EAGF,SACE,MAAM,IAAI,MAAM,oBAAoB,WAAW,sCAAsC;CACzF;CAGA,MAAM,SAAS,eAAe,SAAS;EACrC,MAAM;EACN;EACA;CACF,CAAC;CAGD,IAAI;EACF,MAAM,OAAO,QAAQ;CACvB,SAAS,OAAO;EACd,MAAM,IAAI,MACR,wBAAwB,WAAW,IAAI,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAC9F;CACF;CAEA,OAAO;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,OAAO,MAAuB;CAC5C,OAAO,eAAe,IAAI,IAAI;AAChC;;;;;;;;;;;;;;;;;AAkBA,SAAgB,cACd,MACA,SAC2B;CAC3B,OAAO,OAAO,CAAC,CAAC,QAAkB,MAAM,OAAO;AACjD;;;;;;;;;;;;;AAcA,eAAsB,aAA6C,OAA+B;CAChG,OAAO,OAAO,CAAC,CAAC,QAAQ,KAAK;AAC/B;;;;;;;;;;;;;AAcA,eAAsB,kBACpB,UACA;CACA,OAAO,OAAO,CAAC,CAAC,UAAU,QAAQ;AACpC"}
|
package/esm/in-app/in-app.d.mts
CHANGED
|
@@ -32,14 +32,14 @@ declare class InApp {
|
|
|
32
32
|
configure(options: ConfigureOptions): Channel<DatabasePayload>;
|
|
33
33
|
private get repository();
|
|
34
34
|
/** General list — scoped to recipient; pass `options` for paging + filters. */
|
|
35
|
-
list(recipient: Notifiable | Id, options?: NotificationsListOptions):
|
|
35
|
+
list(recipient: Notifiable | Id, options?: NotificationsListOptions): Promise<import("@warlock.js/core").PaginationResult<NotificationContract>>;
|
|
36
36
|
/** Unread-only list — common case for badges + dashboards. */
|
|
37
|
-
listUnread(recipient: Notifiable | Id, options?: NotificationsListOptions):
|
|
37
|
+
listUnread(recipient: Notifiable | Id, options?: NotificationsListOptions): Promise<import("@warlock.js/core").PaginationResult<NotificationContract>>;
|
|
38
38
|
/**
|
|
39
39
|
* Cached unread count — backs the badge. Auto-invalidated by the repo's
|
|
40
40
|
* model create/update events (`RepositoryManager.registerEvents`).
|
|
41
41
|
*/
|
|
42
|
-
countUnread(recipient: Notifiable | Id):
|
|
42
|
+
countUnread(recipient: Notifiable | Id): Promise<number>;
|
|
43
43
|
/** Find one notification for a recipient — for a detail view. */
|
|
44
44
|
find(recipient: Notifiable | Id, id: Id): Promise<NotificationContract | null>;
|
|
45
45
|
/** Mark read — `id` omitted = all unread for this recipient. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-app.d.mts","names":[],"sources":["../../../../../../../notifications/src/in-app/in-app.ts"],"mappings":";;;;;;;;;;;;KA4CY,wBAAA,GAA2B,+BAA+B,CAAC,mBAAA;;;;;;KAO3D,gBAAA;EACN,KAAA,EAAO,sBAAA;EAAwB,UAAA;AAAA;EAC/B,UAAA,EAAY,2BAA2B;EAAE,KAAA;AAAA;AAAA,cAKzC,KAAA;EAAA,QACI,IAAA;
|
|
1
|
+
{"version":3,"file":"in-app.d.mts","names":[],"sources":["../../../../../../../notifications/src/in-app/in-app.ts"],"mappings":";;;;;;;;;;;;KA4CY,wBAAA,GAA2B,+BAA+B,CAAC,mBAAA;;;;;;KAO3D,gBAAA;EACN,KAAA,EAAO,sBAAA;EAAwB,UAAA;AAAA;EAC/B,UAAA,EAAY,2BAA2B;EAAE,KAAA;AAAA;AAAA,cAKzC,KAAA;EAAA,QACI,IAAA;EAqDuB;;;;EA/CxB,SAAA,CAAU,OAAA,EAAS,gBAAA,GAAmB,OAAA,CAAQ,eAAA;EAAA,YAQzC,UAAA;EA4CoC;EAjCzC,IAAA,CAAK,SAAA,EAAW,UAAA,GAAa,EAAA,EAAI,OAAA,GAAU,wBAAA,GAAwB,OAAA,4BAAA,gBAAA,CAAA,oBAAA;EAiCxB;EA5B3C,UAAA,CAAW,SAAA,EAAW,UAAA,GAAa,EAAA,EAAI,OAAA,GAAU,wBAAA,GAAwB,OAAA,4BAAA,gBAAA,CAAA,oBAAA;EA9BxE;;;;EAsCD,WAAA,CAAY,SAAA,EAAW,UAAA,GAAa,EAAA,GAAE,OAAA;EAhCQ;EAqC9C,IAAA,CAAK,SAAA,EAAW,UAAA,GAAa,EAAA,EAAI,EAAA,EAAI,EAAA,GAAE,OAAA,CAAA,oBAAA;EAlBvC;EAuBA,UAAA,CAAW,SAAA,EAAW,UAAA,GAAa,EAAA,EAAI,EAAA,GAAK,EAAA,GAAE,OAAA;EAvBjB;EA4B7B,YAAA,CAAa,SAAA,EAAW,UAAA,GAAa,EAAA,EAAI,EAAA,GAAK,EAAA,GAAE,OAAA;EA5BL;EAiC3C,OAAA,CAAQ,SAAA,EAAW,UAAA,GAAa,EAAA,EAAI,EAAA,GAAK,EAAA,GAAE,OAAA;AAAA;;cAMvC,KAAA,EAAK,KAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_internal.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/@mongez/reinforcements/esm/Random/_internal.mjs"],"sourcesContent":["//#region ../reinforcements/src/Random/_internal.ts\nconst ALPHANUMERIC = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\nconst URL_SAFE = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-\";\nconst cryptoRef = typeof globalThis !== \"undefined\" && globalThis.crypto ? globalThis.crypto : {};\nconst BYTE_VALUES = 256;\n/** Thrown by every security-shaped generator when no CSPRNG exists. */\nconst NO_CSPRNG_ERROR = \"No CSPRNG available: crypto.getRandomValues is required\";\n/**\n* Return the runtime CSPRNG, throwing when there is none. Tokens, ids\n* and uuids must never silently degrade to the seedable `next()` — a\n* predictable token is worse than a loud failure.\n*/\nfunction requireCsprng() {\n\tif (typeof cryptoRef.getRandomValues !== \"function\") throw new Error(NO_CSPRNG_ERROR);\n\treturn cryptoRef.getRandomValues.bind(cryptoRef);\n}\n/** Cryptographically secure random bytes. Throws without a CSPRNG. */\nfunction cryptoBytes(size) {\n\treturn requireCsprng()(new Uint8Array(size));\n}\n/**\n* Build a `length`-character string out of `charset` using CSPRNG\n* bytes. Bytes above the largest multiple of the charset size are\n* rejected and redrawn so every character stays equally likely — a\n* plain `byte % charset.length` would bias the leading characters.\n*\n* Throws when no CSPRNG is available, whatever the requested length.\n*/\nfunction cryptoStringOf(charset, length) {\n\tconst getRandomValues = requireCsprng();\n\tconst size = charset.length;\n\tconst limit = Math.floor(BYTE_VALUES / size) * size;\n\tlet text = \"\";\n\twhile (text.length < length) {\n\t\tconst bytes = getRandomValues(new Uint8Array(length - text.length));\n\t\tfor (let i = 0; i < bytes.length && text.length < length; i++) {\n\t\t\tif (bytes[i] >= limit) continue;\n\t\t\ttext += charset.charAt(bytes[i] % size);\n\t\t}\n\t}\n\treturn text;\n}\nlet rngState;\nfunction setSeed(seed) {\n\trngState = seed;\n}\n/**\n* Return the next pseudo-random value in `[0, 1)`. Uses `Math.random` by\n* default; switches to a seeded mulberry32 PRNG when `setSeed` is called\n* with a numeric seed.\n*/\nfunction next() {\n\tif (rngState === void 0) return Math.random();\n\trngState |= 0;\n\trngState = rngState + 1831565813 | 0;\n\tlet t = rngState;\n\tt = Math.imul(t ^ t >>> 15, t | 1);\n\tt ^= t + Math.imul(t ^ t >>> 7, t | 61);\n\treturn ((t ^ t >>> 14) >>> 0) / 4294967296;\n}\n\n//#endregion\nexport { ALPHANUMERIC, URL_SAFE, cryptoBytes, cryptoRef, cryptoStringOf, next, setSeed };\n//# sourceMappingURL=_internal.mjs.map"],"x_google_ignoreList":[0],"mappings":";AAGA,MAAM,YAAY,OAAO,eAAe,eAAe,WAAW,SAAS,WAAW,SAAS,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./_internal.mjs";
|
|
2
|
+
import "./bool.mjs";
|
|
3
|
+
import "./color.mjs";
|
|
4
|
+
import "./int.mjs";
|
|
5
|
+
import "./date.mjs";
|
|
6
|
+
import "./float.mjs";
|
|
7
|
+
import "./string.mjs";
|
|
8
|
+
import "./id.mjs";
|
|
9
|
+
import "./nanoid.mjs";
|
|
10
|
+
import "./pick.mjs";
|
|
11
|
+
import "./sample.mjs";
|
|
12
|
+
import "./token.mjs";
|
|
13
|
+
import "./uuid.mjs";
|
|
14
|
+
import "./weighted.mjs";
|
|
15
|
+
|
|
16
|
+
export { };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { get } from "./object/get.mjs";
|
|
2
|
+
import { clone } from "./mixed/clone/clone.mjs";
|
|
3
|
+
import { round } from "./number/round.mjs";
|
|
4
|
+
import { unset } from "./object/unset.mjs";
|
|
5
|
+
import { omit } from "./object/omit.mjs";
|
|
6
|
+
import { except } from "./object/except.mjs";
|
|
7
|
+
import "./Random/random.mjs";
|
|
8
|
+
import { ucfirst } from "./string/ucfirst.mjs";
|
|
9
|
+
import { capitalize } from "./string/capitalize.mjs";
|
|
10
|
+
import { escapeRegex } from "./utils/escapeRegex.mjs";
|
|
11
|
+
import { trim } from "./string/trim.mjs";
|
|
12
|
+
import { ltrim } from "./string/ltrim.mjs";
|
|
13
|
+
import { readMoreChars } from "./string/readMoreChars.mjs";
|
|
14
|
+
import { rtrim } from "./string/rtrim.mjs";
|
|
15
|
+
import { words } from "./string/words.mjs";
|
|
16
|
+
import { toCamelCase } from "./string/toCamelCase.mjs";
|
|
17
|
+
import { toSnakeCase } from "./string/toSnakeCase.mjs";
|
|
18
|
+
import { toKebabCase } from "./string/toKebabCase.mjs";
|
|
19
|
+
import { toStudlyCase } from "./string/toStudlyCase.mjs";
|
|
20
|
+
import { lazy } from "./utils/lazy.mjs";
|
|
21
|
+
import { tap } from "./utils/tap.mjs";
|
|
22
|
+
import "./async/retry.mjs";
|
|
23
|
+
|
|
24
|
+
export { };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
//#region ../node_modules/@mongez/reinforcements/esm/mixed/clone/clone.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Deep-clone a value. Supports plain objects, arrays, `Date`, `RegExp`,
|
|
4
|
+
* `Map`, `Set`, `Error`, and typed arrays. Handles circular references
|
|
5
|
+
* via an internal `WeakMap`.
|
|
6
|
+
*
|
|
7
|
+
* Non-plain class instances are returned by reference — cloning custom
|
|
8
|
+
* constructors requires the class's own copy logic, so this function
|
|
9
|
+
* stops at that boundary rather than silently producing a half-clone.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* const original = { user: { name: "Ada" }, tags: ["x"] };
|
|
13
|
+
* const copy = clone(original);
|
|
14
|
+
*
|
|
15
|
+
* copy.user.name = "Bob";
|
|
16
|
+
* original.user.name; // "Ada"
|
|
17
|
+
*/
|
|
18
|
+
function clone(value) {
|
|
19
|
+
if (value === null || typeof value !== "object") return value;
|
|
20
|
+
return cloneDeep(value, /* @__PURE__ */ new WeakMap());
|
|
21
|
+
}
|
|
22
|
+
function cloneDeep(value, seen) {
|
|
23
|
+
if (value === null || typeof value !== "object") return value;
|
|
24
|
+
if (seen.has(value)) return seen.get(value);
|
|
25
|
+
if (value instanceof Date) return new Date(value.getTime());
|
|
26
|
+
if (value instanceof RegExp) return cloneRegExp(value);
|
|
27
|
+
if (value instanceof Error) return cloneError(value, seen);
|
|
28
|
+
if (Array.isArray(value)) return cloneArray(value, seen);
|
|
29
|
+
if (value instanceof Map) return cloneMap(value, seen);
|
|
30
|
+
if (value instanceof Set) return cloneSet(value, seen);
|
|
31
|
+
if (ArrayBuffer.isView(value) && !(value instanceof DataView)) return cloneTypedArray(value);
|
|
32
|
+
if (value instanceof ArrayBuffer) return value.slice(0);
|
|
33
|
+
return clonePlainObject(value, seen);
|
|
34
|
+
}
|
|
35
|
+
function cloneRegExp(value) {
|
|
36
|
+
const copy = new RegExp(value.source, value.flags);
|
|
37
|
+
copy.lastIndex = value.lastIndex;
|
|
38
|
+
return copy;
|
|
39
|
+
}
|
|
40
|
+
function cloneError(value, seen) {
|
|
41
|
+
const Ctor = value.constructor;
|
|
42
|
+
const copy = new Ctor(value.message);
|
|
43
|
+
copy.stack = value.stack;
|
|
44
|
+
copy.name = value.name;
|
|
45
|
+
seen.set(value, copy);
|
|
46
|
+
for (const key of Object.keys(value)) copy[key] = cloneDeep(value[key], seen);
|
|
47
|
+
return copy;
|
|
48
|
+
}
|
|
49
|
+
function cloneArray(value, seen) {
|
|
50
|
+
const copy = [];
|
|
51
|
+
seen.set(value, copy);
|
|
52
|
+
for (const item of value) copy.push(cloneDeep(item, seen));
|
|
53
|
+
return copy;
|
|
54
|
+
}
|
|
55
|
+
function cloneMap(value, seen) {
|
|
56
|
+
const copy = /* @__PURE__ */ new Map();
|
|
57
|
+
seen.set(value, copy);
|
|
58
|
+
for (const [key, val] of value) copy.set(cloneDeep(key, seen), cloneDeep(val, seen));
|
|
59
|
+
return copy;
|
|
60
|
+
}
|
|
61
|
+
function cloneSet(value, seen) {
|
|
62
|
+
const copy = /* @__PURE__ */ new Set();
|
|
63
|
+
seen.set(value, copy);
|
|
64
|
+
for (const item of value) copy.add(cloneDeep(item, seen));
|
|
65
|
+
return copy;
|
|
66
|
+
}
|
|
67
|
+
function cloneTypedArray(value) {
|
|
68
|
+
const Ctor = value.constructor;
|
|
69
|
+
return new Ctor(value.buffer.slice(0));
|
|
70
|
+
}
|
|
71
|
+
function clonePlainObject(value, seen) {
|
|
72
|
+
const proto = Object.getPrototypeOf(value);
|
|
73
|
+
if (!(proto === Object.prototype || proto === null)) return value;
|
|
74
|
+
const copy = Object.create(proto);
|
|
75
|
+
seen.set(value, copy);
|
|
76
|
+
for (const key of Object.keys(value)) copy[key] = cloneDeep(value[key], seen);
|
|
77
|
+
return copy;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
export { clone };
|
|
82
|
+
//# sourceMappingURL=clone.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clone.mjs","names":[],"sources":["../../../../../../../../../../../../node_modules/@mongez/reinforcements/esm/mixed/clone/clone.mjs"],"sourcesContent":["//#region ../reinforcements/src/mixed/clone/clone.ts\n/**\n* Deep-clone a value. Supports plain objects, arrays, `Date`, `RegExp`,\n* `Map`, `Set`, `Error`, and typed arrays. Handles circular references\n* via an internal `WeakMap`.\n*\n* Non-plain class instances are returned by reference — cloning custom\n* constructors requires the class's own copy logic, so this function\n* stops at that boundary rather than silently producing a half-clone.\n*\n* @example\n* const original = { user: { name: \"Ada\" }, tags: [\"x\"] };\n* const copy = clone(original);\n*\n* copy.user.name = \"Bob\";\n* original.user.name; // \"Ada\"\n*/\nfunction clone(value) {\n\tif (value === null || typeof value !== \"object\") return value;\n\treturn cloneDeep(value, /* @__PURE__ */ new WeakMap());\n}\nfunction cloneDeep(value, seen) {\n\tif (value === null || typeof value !== \"object\") return value;\n\tif (seen.has(value)) return seen.get(value);\n\tif (value instanceof Date) return new Date(value.getTime());\n\tif (value instanceof RegExp) return cloneRegExp(value);\n\tif (value instanceof Error) return cloneError(value, seen);\n\tif (Array.isArray(value)) return cloneArray(value, seen);\n\tif (value instanceof Map) return cloneMap(value, seen);\n\tif (value instanceof Set) return cloneSet(value, seen);\n\tif (ArrayBuffer.isView(value) && !(value instanceof DataView)) return cloneTypedArray(value);\n\tif (value instanceof ArrayBuffer) return value.slice(0);\n\treturn clonePlainObject(value, seen);\n}\nfunction cloneRegExp(value) {\n\tconst copy = new RegExp(value.source, value.flags);\n\tcopy.lastIndex = value.lastIndex;\n\treturn copy;\n}\nfunction cloneError(value, seen) {\n\tconst Ctor = value.constructor;\n\tconst copy = new Ctor(value.message);\n\tcopy.stack = value.stack;\n\tcopy.name = value.name;\n\tseen.set(value, copy);\n\tfor (const key of Object.keys(value)) copy[key] = cloneDeep(value[key], seen);\n\treturn copy;\n}\nfunction cloneArray(value, seen) {\n\tconst copy = [];\n\tseen.set(value, copy);\n\tfor (const item of value) copy.push(cloneDeep(item, seen));\n\treturn copy;\n}\nfunction cloneMap(value, seen) {\n\tconst copy = /* @__PURE__ */ new Map();\n\tseen.set(value, copy);\n\tfor (const [key, val] of value) copy.set(cloneDeep(key, seen), cloneDeep(val, seen));\n\treturn copy;\n}\nfunction cloneSet(value, seen) {\n\tconst copy = /* @__PURE__ */ new Set();\n\tseen.set(value, copy);\n\tfor (const item of value) copy.add(cloneDeep(item, seen));\n\treturn copy;\n}\nfunction cloneTypedArray(value) {\n\tconst Ctor = value.constructor;\n\treturn new Ctor(value.buffer.slice(0));\n}\nfunction clonePlainObject(value, seen) {\n\tconst proto = Object.getPrototypeOf(value);\n\tif (!(proto === Object.prototype || proto === null)) return value;\n\tconst copy = Object.create(proto);\n\tseen.set(value, copy);\n\tfor (const key of Object.keys(value)) copy[key] = cloneDeep(value[key], seen);\n\treturn copy;\n}\n\n//#endregion\nexport { clone as default };\n//# sourceMappingURL=clone.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAS,MAAM,OAAO;CACrB,IAAI,UAAU,QAAQ,OAAO,UAAU,UAAU,OAAO;CACxD,OAAO,UAAU,uBAAuB,IAAI,QAAQ,CAAC;AACtD;AACA,SAAS,UAAU,OAAO,MAAM;CAC/B,IAAI,UAAU,QAAQ,OAAO,UAAU,UAAU,OAAO;CACxD,IAAI,KAAK,IAAI,KAAK,GAAG,OAAO,KAAK,IAAI,KAAK;CAC1C,IAAI,iBAAiB,MAAM,OAAO,IAAI,KAAK,MAAM,QAAQ,CAAC;CAC1D,IAAI,iBAAiB,QAAQ,OAAO,YAAY,KAAK;CACrD,IAAI,iBAAiB,OAAO,OAAO,WAAW,OAAO,IAAI;CACzD,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,WAAW,OAAO,IAAI;CACvD,IAAI,iBAAiB,KAAK,OAAO,SAAS,OAAO,IAAI;CACrD,IAAI,iBAAiB,KAAK,OAAO,SAAS,OAAO,IAAI;CACrD,IAAI,YAAY,OAAO,KAAK,KAAK,EAAE,iBAAiB,WAAW,OAAO,gBAAgB,KAAK;CAC3F,IAAI,iBAAiB,aAAa,OAAO,MAAM,MAAM,CAAC;CACtD,OAAO,iBAAiB,OAAO,IAAI;AACpC;AACA,SAAS,YAAY,OAAO;CAC3B,MAAM,OAAO,IAAI,OAAO,MAAM,QAAQ,MAAM,KAAK;CACjD,KAAK,YAAY,MAAM;CACvB,OAAO;AACR;AACA,SAAS,WAAW,OAAO,MAAM;CAChC,MAAM,OAAO,MAAM;CACnB,MAAM,OAAO,IAAI,KAAK,MAAM,OAAO;CACnC,KAAK,QAAQ,MAAM;CACnB,KAAK,OAAO,MAAM;CAClB,KAAK,IAAI,OAAO,IAAI;CACpB,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG,KAAK,OAAO,UAAU,MAAM,MAAM,IAAI;CAC5E,OAAO;AACR;AACA,SAAS,WAAW,OAAO,MAAM;CAChC,MAAM,OAAO,CAAC;CACd,KAAK,IAAI,OAAO,IAAI;CACpB,KAAK,MAAM,QAAQ,OAAO,KAAK,KAAK,UAAU,MAAM,IAAI,CAAC;CACzD,OAAO;AACR;AACA,SAAS,SAAS,OAAO,MAAM;CAC9B,MAAM,uBAAuB,IAAI,IAAI;CACrC,KAAK,IAAI,OAAO,IAAI;CACpB,KAAK,MAAM,CAAC,KAAK,QAAQ,OAAO,KAAK,IAAI,UAAU,KAAK,IAAI,GAAG,UAAU,KAAK,IAAI,CAAC;CACnF,OAAO;AACR;AACA,SAAS,SAAS,OAAO,MAAM;CAC9B,MAAM,uBAAuB,IAAI,IAAI;CACrC,KAAK,IAAI,OAAO,IAAI;CACpB,KAAK,MAAM,QAAQ,OAAO,KAAK,IAAI,UAAU,MAAM,IAAI,CAAC;CACxD,OAAO;AACR;AACA,SAAS,gBAAgB,OAAO;CAC/B,MAAM,OAAO,MAAM;CACnB,OAAO,IAAI,KAAK,MAAM,OAAO,MAAM,CAAC,CAAC;AACtC;AACA,SAAS,iBAAiB,OAAO,MAAM;CACtC,MAAM,QAAQ,OAAO,eAAe,KAAK;CACzC,IAAI,EAAE,UAAU,OAAO,aAAa,UAAU,OAAO,OAAO;CAC5D,MAAM,OAAO,OAAO,OAAO,KAAK;CAChC,KAAK,IAAI,OAAO,IAAI;CACpB,KAAK,MAAM,OAAO,OAAO,KAAK,KAAK,GAAG,KAAK,OAAO,UAAU,MAAM,MAAM,IAAI;CAC5E,OAAO;AACR"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region ../node_modules/@mongez/reinforcements/esm/number/round.mjs
|
|
2
|
+
/**
|
|
3
|
+
* Round `value` to the given number of decimal places (banker's-style
|
|
4
|
+
* `Math.round`).
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* round(1.235, 2); // 1.24
|
|
8
|
+
* round(1.5); // 2
|
|
9
|
+
*/
|
|
10
|
+
function round(value, precision = 2) {
|
|
11
|
+
const multiplier = Math.pow(10, precision || 0);
|
|
12
|
+
return Math.round(value * multiplier) / multiplier;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { round };
|
|
17
|
+
//# sourceMappingURL=round.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"round.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/@mongez/reinforcements/esm/number/round.mjs"],"sourcesContent":["//#region ../reinforcements/src/number/round.ts\n/**\n* Round `value` to the given number of decimal places (banker's-style\n* `Math.round`).\n*\n* @example\n* round(1.235, 2); // 1.24\n* round(1.5); // 2\n*/\nfunction round(value, precision = 2) {\n\tconst multiplier = Math.pow(10, precision || 0);\n\treturn Math.round(value * multiplier) / multiplier;\n}\n\n//#endregion\nexport { round as default };\n//# sourceMappingURL=round.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AASA,SAAS,MAAM,OAAO,YAAY,GAAG;CACpC,MAAM,aAAa,KAAK,IAAI,IAAI,aAAa,CAAC;CAC9C,OAAO,KAAK,MAAM,QAAQ,UAAU,IAAI;AACzC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { omit } from "./omit.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../node_modules/@mongez/reinforcements/esm/object/except.mjs
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use {@link omit} instead. Will be removed in a future major release.
|
|
6
|
+
*/
|
|
7
|
+
function except(object, keys) {
|
|
8
|
+
return omit(object, keys);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { except };
|
|
13
|
+
//# sourceMappingURL=except.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"except.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/@mongez/reinforcements/esm/object/except.mjs"],"sourcesContent":["import omit from \"./omit.mjs\";\n\n//#region ../reinforcements/src/object/except.ts\n/**\n* @deprecated Use {@link omit} instead. Will be removed in a future major release.\n*/\nfunction except(object, keys) {\n\treturn omit(object, keys);\n}\n\n//#endregion\nexport { except as default };\n//# sourceMappingURL=except.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;AAMA,SAAS,OAAO,QAAQ,MAAM;CAC7B,OAAO,KAAK,QAAQ,IAAI;AACzB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//#region ../node_modules/@mongez/reinforcements/esm/object/get.mjs
|
|
2
|
+
function get(object, path, defaultValue) {
|
|
3
|
+
if (object === null || object === void 0) return defaultValue;
|
|
4
|
+
if (path === "") return defaultValue;
|
|
5
|
+
const segments = path.split(".");
|
|
6
|
+
let current = object;
|
|
7
|
+
for (const key of segments) {
|
|
8
|
+
if (current === null || current === void 0) return defaultValue;
|
|
9
|
+
if (typeof current !== "object") return defaultValue;
|
|
10
|
+
if (!Object.prototype.hasOwnProperty.call(current, key)) return defaultValue;
|
|
11
|
+
current = current[key];
|
|
12
|
+
}
|
|
13
|
+
return current === void 0 ? defaultValue : current;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { get };
|
|
18
|
+
//# sourceMappingURL=get.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/@mongez/reinforcements/esm/object/get.mjs"],"sourcesContent":["//#region ../reinforcements/src/object/get.ts\nfunction get(object, path, defaultValue) {\n\tif (object === null || object === void 0) return defaultValue;\n\tif (path === \"\") return defaultValue;\n\tconst segments = path.split(\".\");\n\tlet current = object;\n\tfor (const key of segments) {\n\t\tif (current === null || current === void 0) return defaultValue;\n\t\tif (typeof current !== \"object\") return defaultValue;\n\t\tif (!Object.prototype.hasOwnProperty.call(current, key)) return defaultValue;\n\t\tcurrent = current[key];\n\t}\n\treturn current === void 0 ? defaultValue : current;\n}\n\n//#endregion\nexport { get as default };\n//# sourceMappingURL=get.mjs.map"],"x_google_ignoreList":[0],"mappings":";AACA,SAAS,IAAI,QAAQ,MAAM,cAAc;CACxC,IAAI,WAAW,QAAQ,WAAW,KAAK,GAAG,OAAO;CACjD,IAAI,SAAS,IAAI,OAAO;CACxB,MAAM,WAAW,KAAK,MAAM,GAAG;CAC/B,IAAI,UAAU;CACd,KAAK,MAAM,OAAO,UAAU;EAC3B,IAAI,YAAY,QAAQ,YAAY,KAAK,GAAG,OAAO;EACnD,IAAI,OAAO,YAAY,UAAU,OAAO;EACxC,IAAI,CAAC,OAAO,UAAU,eAAe,KAAK,SAAS,GAAG,GAAG,OAAO;EAChE,UAAU,QAAQ;CACnB;CACA,OAAO,YAAY,KAAK,IAAI,eAAe;AAC5C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { unset } from "./unset.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../node_modules/@mongez/reinforcements/esm/object/omit.mjs
|
|
4
|
+
function omit(object, keysOrPredicate) {
|
|
5
|
+
if (!object || typeof object !== "object" || Array.isArray(object)) return object;
|
|
6
|
+
if (typeof keysOrPredicate === "function") return omitByPredicate(object, keysOrPredicate);
|
|
7
|
+
return unset({ ...object }, keysOrPredicate);
|
|
8
|
+
}
|
|
9
|
+
function omitByPredicate(object, predicate) {
|
|
10
|
+
const result = {};
|
|
11
|
+
for (const key of Object.keys(object)) if (!predicate(object[key], key)) result[key] = object[key];
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { omit };
|
|
17
|
+
//# sourceMappingURL=omit.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"omit.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/@mongez/reinforcements/esm/object/omit.mjs"],"sourcesContent":["import unset from \"./unset.mjs\";\n\n//#region ../reinforcements/src/object/omit.ts\nfunction omit(object, keysOrPredicate) {\n\tif (!object || typeof object !== \"object\" || Array.isArray(object)) return object;\n\tif (typeof keysOrPredicate === \"function\") return omitByPredicate(object, keysOrPredicate);\n\treturn unset({ ...object }, keysOrPredicate);\n}\nfunction omitByPredicate(object, predicate) {\n\tconst result = {};\n\tfor (const key of Object.keys(object)) if (!predicate(object[key], key)) result[key] = object[key];\n\treturn result;\n}\n\n//#endregion\nexport { omit as default };\n//# sourceMappingURL=omit.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;AAGA,SAAS,KAAK,QAAQ,iBAAiB;CACtC,IAAI,CAAC,UAAU,OAAO,WAAW,YAAY,MAAM,QAAQ,MAAM,GAAG,OAAO;CAC3E,IAAI,OAAO,oBAAoB,YAAY,OAAO,gBAAgB,QAAQ,eAAe;CACzF,OAAO,MAAM,EAAE,GAAG,OAAO,GAAG,eAAe;AAC5C;AACA,SAAS,gBAAgB,QAAQ,WAAW;CAC3C,MAAM,SAAS,CAAC;CAChB,KAAK,MAAM,OAAO,OAAO,KAAK,MAAM,GAAG,IAAI,CAAC,UAAU,OAAO,MAAM,GAAG,GAAG,OAAO,OAAO,OAAO;CAC9F,OAAO;AACR"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { get } from "./get.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../node_modules/@mongez/reinforcements/esm/object/unset.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Remove one or more dot-notation paths from `object`. Mutates and
|
|
6
|
+
* returns the input.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* unset({ a: 1, b: 2 }, ["a"]); // { b: 2 }
|
|
10
|
+
* unset({ a: { b: 1, c: 2 } }, ["a.b"]); // { a: { c: 2 } }
|
|
11
|
+
*/
|
|
12
|
+
function unset(object, keys) {
|
|
13
|
+
if (!object || typeof object !== "object" || Array.isArray(object)) return object;
|
|
14
|
+
for (const key of keys) deletePath(object, key);
|
|
15
|
+
return object;
|
|
16
|
+
}
|
|
17
|
+
function deletePath(object, path) {
|
|
18
|
+
const segments = path.split(".");
|
|
19
|
+
if (segments.length === 1) {
|
|
20
|
+
delete object[path];
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const lastKey = segments.pop();
|
|
24
|
+
const parent = get(object, segments.join("."));
|
|
25
|
+
if (parent && typeof parent === "object") delete parent[lastKey];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { unset };
|
|
30
|
+
//# sourceMappingURL=unset.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unset.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/@mongez/reinforcements/esm/object/unset.mjs"],"sourcesContent":["import get from \"./get.mjs\";\n\n//#region ../reinforcements/src/object/unset.ts\n/**\n* Remove one or more dot-notation paths from `object`. Mutates and\n* returns the input.\n*\n* @example\n* unset({ a: 1, b: 2 }, [\"a\"]); // { b: 2 }\n* unset({ a: { b: 1, c: 2 } }, [\"a.b\"]); // { a: { c: 2 } }\n*/\nfunction unset(object, keys) {\n\tif (!object || typeof object !== \"object\" || Array.isArray(object)) return object;\n\tfor (const key of keys) deletePath(object, key);\n\treturn object;\n}\nfunction deletePath(object, path) {\n\tconst segments = path.split(\".\");\n\tif (segments.length === 1) {\n\t\tdelete object[path];\n\t\treturn;\n\t}\n\tconst lastKey = segments.pop();\n\tconst parent = get(object, segments.join(\".\"));\n\tif (parent && typeof parent === \"object\") delete parent[lastKey];\n}\n\n//#endregion\nexport { unset as default };\n//# sourceMappingURL=unset.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AAWA,SAAS,MAAM,QAAQ,MAAM;CAC5B,IAAI,CAAC,UAAU,OAAO,WAAW,YAAY,MAAM,QAAQ,MAAM,GAAG,OAAO;CAC3E,KAAK,MAAM,OAAO,MAAM,WAAW,QAAQ,GAAG;CAC9C,OAAO;AACR;AACA,SAAS,WAAW,QAAQ,MAAM;CACjC,MAAM,WAAW,KAAK,MAAM,GAAG;CAC/B,IAAI,SAAS,WAAW,GAAG;EAC1B,OAAO,OAAO;EACd;CACD;CACA,MAAM,UAAU,SAAS,IAAI;CAC7B,MAAM,SAAS,IAAI,QAAQ,SAAS,KAAK,GAAG,CAAC;CAC7C,IAAI,UAAU,OAAO,WAAW,UAAU,OAAO,OAAO;AACzD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ucfirst } from "./ucfirst.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../node_modules/@mongez/reinforcements/esm/string/capitalize.mjs
|
|
4
|
+
const WHITESPACE_RUN = /\s+/;
|
|
5
|
+
const WHITESPACE_GROUP = /(\s+)/;
|
|
6
|
+
/**
|
|
7
|
+
* Capitalize the first letter of each whitespace-separated word.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* capitalize("hello world"); // "Hello World"
|
|
11
|
+
*/
|
|
12
|
+
function capitalize(string) {
|
|
13
|
+
if (!string) return "";
|
|
14
|
+
return string.split(WHITESPACE_GROUP).map((part) => WHITESPACE_RUN.test(part) ? part : ucfirst(part)).join("");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { capitalize };
|
|
19
|
+
//# sourceMappingURL=capitalize.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capitalize.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/@mongez/reinforcements/esm/string/capitalize.mjs"],"sourcesContent":["import ucfirst from \"./ucfirst.mjs\";\n\n//#region ../reinforcements/src/string/capitalize.ts\nconst WHITESPACE_RUN = /\\s+/;\nconst WHITESPACE_GROUP = /(\\s+)/;\n/**\n* Capitalize the first letter of each whitespace-separated word.\n*\n* @example\n* capitalize(\"hello world\"); // \"Hello World\"\n*/\nfunction capitalize(string) {\n\tif (!string) return \"\";\n\treturn string.split(WHITESPACE_GROUP).map((part) => WHITESPACE_RUN.test(part) ? part : ucfirst(part)).join(\"\");\n}\n\n//#endregion\nexport { capitalize as default };\n//# sourceMappingURL=capitalize.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;AAGA,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;;;;;;;AAOzB,SAAS,WAAW,QAAQ;CAC3B,IAAI,CAAC,QAAQ,OAAO;CACpB,OAAO,OAAO,MAAM,gBAAgB,CAAC,CAAC,KAAK,SAAS,eAAe,KAAK,IAAI,IAAI,OAAO,QAAQ,IAAI,CAAC,CAAC,CAAC,KAAK,EAAE;AAC9G"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { escapeRegex } from "../utils/escapeRegex.mjs";
|
|
2
|
+
|
|
3
|
+
//#region ../node_modules/@mongez/reinforcements/esm/string/ltrim.mjs
|
|
4
|
+
/**
|
|
5
|
+
* Remove the given needle from the start of string
|
|
6
|
+
*
|
|
7
|
+
* @param string needle
|
|
8
|
+
* @return string
|
|
9
|
+
*/
|
|
10
|
+
function ltrim(string, needle = " ") {
|
|
11
|
+
if (!string) return "";
|
|
12
|
+
const pattern = "^" + escapeRegex(needle) + "+", regex = new RegExp(pattern, "g");
|
|
13
|
+
return string.replace(regex, "");
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { ltrim };
|
|
18
|
+
//# sourceMappingURL=ltrim.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ltrim.mjs","names":[],"sources":["../../../../../../../../../../../node_modules/@mongez/reinforcements/esm/string/ltrim.mjs"],"sourcesContent":["import escapeRegex from \"../utils/escapeRegex.mjs\";\n\n//#region ../reinforcements/src/string/ltrim.ts\n/**\n* Remove the given needle from the start of string\n*\n* @param string needle\n* @return string\n*/\nfunction ltrim(string, needle = \" \") {\n\tif (!string) return \"\";\n\tconst pattern = \"^\" + escapeRegex(needle) + \"+\", regex = new RegExp(pattern, \"g\");\n\treturn string.replace(regex, \"\");\n}\n\n//#endregion\nexport { ltrim as default };\n//# sourceMappingURL=ltrim.mjs.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;AASA,SAAS,MAAM,QAAQ,SAAS,KAAK;CACpC,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,UAAU,MAAM,YAAY,MAAM,IAAI,KAAK,QAAQ,IAAI,OAAO,SAAS,GAAG;CAChF,OAAO,OAAO,QAAQ,OAAO,EAAE;AAChC"}
|