@directus/api 35.0.2 → 35.1.0
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/dist/_virtual/rolldown_runtime.js +1 -24
- package/dist/ai/chat/controllers/chat.post.js +9 -22
- package/dist/ai/chat/controllers/object.post.js +58 -0
- package/dist/ai/chat/lib/create-ui-stream.js +10 -18
- package/dist/ai/chat/lib/transform-file-parts.js +1 -3
- package/dist/ai/chat/middleware/load-settings.js +1 -2
- package/dist/ai/chat/models/chat-request.js +2 -9
- package/dist/ai/chat/models/object-request.js +19 -0
- package/dist/ai/chat/router.js +3 -2
- package/dist/ai/chat/utils/add-additional-properties-to-json-schema.js +37 -0
- package/dist/ai/chat/utils/chat-request-tool-to-ai-sdk-tool.js +3 -8
- package/dist/ai/chat/utils/fix-error-tool-calls.js +4 -6
- package/dist/ai/chat/utils/format-context.js +17 -27
- package/dist/ai/chat/utils/parse-json-schema-7.js +3 -6
- package/dist/ai/chat/utils/zod-jsonschema7-parser.js +16 -0
- package/dist/ai/devtools/index.js +1 -2
- package/dist/ai/files/adapters/anthropic.js +1 -3
- package/dist/ai/files/adapters/google.js +5 -12
- package/dist/ai/files/adapters/openai.js +1 -3
- package/dist/ai/files/controllers/upload.js +8 -24
- package/dist/ai/files/lib/fetch-provider.js +1 -3
- package/dist/ai/files/lib/upload-to-provider.js +6 -16
- package/dist/ai/mcp/server.js +58 -102
- package/dist/ai/mcp/transport.js +2 -6
- package/dist/ai/providers/anthropic-file-support.js +28 -41
- package/dist/ai/providers/anthropic-tool-search.js +10 -14
- package/dist/ai/providers/index.js +0 -1
- package/dist/ai/providers/options.js +2 -7
- package/dist/ai/providers/registry.js +38 -48
- package/dist/ai/telemetry/braintrust.js +3 -9
- package/dist/ai/telemetry/index.js +14 -13
- package/dist/ai/telemetry/langfuse.js +8 -22
- package/dist/ai/tools/assets/index.js +15 -23
- package/dist/ai/tools/collections/index.js +9 -19
- package/dist/ai/tools/fields/index.js +13 -27
- package/dist/ai/tools/files/index.js +11 -24
- package/dist/ai/tools/flows/index.js +8 -16
- package/dist/ai/tools/folders/index.js +11 -23
- package/dist/ai/tools/items/index.js +19 -44
- package/dist/ai/tools/operations/index.js +7 -13
- package/dist/ai/tools/relations/index.js +5 -11
- package/dist/ai/tools/schema/index.js +39 -91
- package/dist/ai/tools/trigger-flow/index.js +9 -16
- package/dist/ai/tools/utils.js +4 -8
- package/dist/app.js +19 -51
- package/dist/auth/auth.js +3 -9
- package/dist/auth/drivers/ldap.js +39 -82
- package/dist/auth/drivers/local.js +4 -12
- package/dist/auth/drivers/oauth2.js +32 -63
- package/dist/auth/drivers/openid.js +49 -89
- package/dist/auth/drivers/saml.js +16 -31
- package/dist/auth/utils/generate-callback-url.js +2 -7
- package/dist/auth/utils/resolve-login-redirect.js +11 -21
- package/dist/auth.js +2 -5
- package/dist/bus/lib/use-bus.js +3 -7
- package/dist/cache.js +11 -24
- package/dist/cli/commands/bootstrap/index.js +10 -19
- package/dist/cli/commands/cache/clear.js +1 -3
- package/dist/cli/commands/database/migrate.js +2 -5
- package/dist/cli/commands/init/index.js +3 -5
- package/dist/cli/commands/init/questions.js +2 -3
- package/dist/cli/commands/schema/apply.js +39 -81
- package/dist/cli/commands/schema/snapshot.js +3 -8
- package/dist/cli/commands/users/create.js +3 -5
- package/dist/cli/commands/users/passwd.js +2 -5
- package/dist/cli/index.js +1 -2
- package/dist/cli/load-extensions.js +3 -6
- package/dist/cli/utils/create-db-connection.js +7 -12
- package/dist/cli/utils/create-env/index.js +2 -6
- package/dist/cli/utils/drivers.js +1 -3
- package/dist/controllers/access.js +15 -30
- package/dist/controllers/activity.js +5 -10
- package/dist/controllers/assets.js +24 -61
- package/dist/controllers/auth.js +19 -52
- package/dist/controllers/collections.js +8 -17
- package/dist/controllers/comments.js +15 -30
- package/dist/controllers/dashboards.js +13 -25
- package/dist/controllers/deployment-webhooks.js +6 -12
- package/dist/controllers/deployment.js +39 -90
- package/dist/controllers/extensions.js +53 -98
- package/dist/controllers/fields.js +17 -38
- package/dist/controllers/files.js +31 -68
- package/dist/controllers/flows.js +15 -30
- package/dist/controllers/folders.js +16 -32
- package/dist/controllers/graphql.js +2 -6
- package/dist/controllers/items.js +18 -38
- package/dist/controllers/mcp.js +4 -8
- package/dist/controllers/metrics.js +4 -12
- package/dist/controllers/not-found.js +2 -5
- package/dist/controllers/notifications.js +16 -32
- package/dist/controllers/operations.js +13 -25
- package/dist/controllers/panels.js +13 -25
- package/dist/controllers/permissions.js +18 -35
- package/dist/controllers/policies.js +15 -30
- package/dist/controllers/presets.js +16 -32
- package/dist/controllers/relations.js +12 -24
- package/dist/controllers/revisions.js +2 -3
- package/dist/controllers/roles.js +13 -25
- package/dist/controllers/schema.js +19 -30
- package/dist/controllers/server.js +32 -44
- package/dist/controllers/settings.js +5 -9
- package/dist/controllers/shares.js +20 -40
- package/dist/controllers/translations.js +16 -32
- package/dist/controllers/tus.js +4 -11
- package/dist/controllers/users.js +46 -100
- package/dist/controllers/utils/handle-registry-error.js +26 -0
- package/dist/controllers/utils.js +20 -41
- package/dist/controllers/versions.js +20 -41
- package/dist/database/errors/dialects/mssql.js +8 -21
- package/dist/database/errors/dialects/mysql.js +7 -14
- package/dist/database/errors/dialects/oracle.js +3 -6
- package/dist/database/errors/dialects/postgres.js +8 -18
- package/dist/database/errors/dialects/sqlite.js +16 -21
- package/dist/database/errors/translate.js +1 -2
- package/dist/database/get-ast-from-query/get-ast-from-query.js +4 -12
- package/dist/database/get-ast-from-query/lib/convert-wildcards.js +15 -29
- package/dist/database/get-ast-from-query/lib/parse-fields.js +17 -41
- package/dist/database/get-ast-from-query/utils/get-allowed-sort.js +5 -14
- package/dist/database/get-ast-from-query/utils/get-related-collection.js +2 -6
- package/dist/database/helpers/date/dialects/mysql.js +1 -1
- package/dist/database/helpers/date/dialects/oracle.js +3 -9
- package/dist/database/helpers/date/dialects/sqlite.js +3 -9
- package/dist/database/helpers/date/types.js +1 -3
- package/dist/database/helpers/fn/dialects/mssql.js +4 -12
- package/dist/database/helpers/fn/dialects/mysql.js +5 -14
- package/dist/database/helpers/fn/dialects/oracle.js +4 -12
- package/dist/database/helpers/fn/dialects/postgres.js +5 -14
- package/dist/database/helpers/fn/dialects/sqlite.js +4 -12
- package/dist/database/helpers/fn/json/parse-function.js +9 -27
- package/dist/database/helpers/fn/types.js +1 -3
- package/dist/database/helpers/geometry/dialects/mssql.js +1 -3
- package/dist/database/helpers/geometry/dialects/oracle.js +1 -3
- package/dist/database/helpers/geometry/dialects/postgres.js +1 -2
- package/dist/database/helpers/geometry/dialects/redshift.js +1 -3
- package/dist/database/helpers/geometry/dialects/sqlite.js +1 -2
- package/dist/database/helpers/index.js +1 -2
- package/dist/database/helpers/number/dialects/postgres.js +1 -3
- package/dist/database/helpers/number/utils/decimal-limit.js +2 -4
- package/dist/database/helpers/number/utils/maybe-stringify-big-int.js +1 -3
- package/dist/database/helpers/schema/dialects/cockroachdb.js +8 -15
- package/dist/database/helpers/schema/dialects/mssql.js +8 -15
- package/dist/database/helpers/schema/dialects/mysql.js +8 -14
- package/dist/database/helpers/schema/dialects/oracle.js +13 -28
- package/dist/database/helpers/schema/dialects/postgres.js +6 -10
- package/dist/database/helpers/schema/dialects/sqlite.js +1 -3
- package/dist/database/helpers/schema/types.js +12 -35
- package/dist/database/helpers/schema/utils/prep-query-params.js +4 -7
- package/dist/database/helpers/sequence/types.js +1 -3
- package/dist/database/index.js +41 -79
- package/dist/database/migrations/20201029A-remove-system-relations.js +1 -5
- package/dist/database/migrations/20201029B-remove-system-collections.js +1 -5
- package/dist/database/migrations/20201029C-remove-system-fields.js +1 -5
- package/dist/database/migrations/20201105A-add-cascade-system-relations.js +9 -15
- package/dist/database/migrations/20210225A-add-relations-sort-field.js +4 -6
- package/dist/database/migrations/20210415A-make-filesize-nullable.js +2 -4
- package/dist/database/migrations/20210506A-rename-interfaces.js +13 -20
- package/dist/database/migrations/20210518A-add-foreign-key-constraints.js +7 -18
- package/dist/database/migrations/20210519A-add-system-fk-triggers.js +58 -67
- package/dist/database/migrations/20210626A-change-filesize-bigint.js +2 -8
- package/dist/database/migrations/20210802A-replace-groups.js +7 -9
- package/dist/database/migrations/20210805A-update-groups.js +4 -14
- package/dist/database/migrations/20210805B-change-image-metadata-structure.js +2 -6
- package/dist/database/migrations/20210920A-webhooks-url-not-null.js +2 -6
- package/dist/database/migrations/20210927A-replace-fields-group.js +5 -11
- package/dist/database/migrations/20211007A-update-presets.js +4 -12
- package/dist/database/migrations/20220303A-remove-default-project-color.js +2 -4
- package/dist/database/migrations/20220322A-rename-field-typecast-flags.js +2 -6
- package/dist/database/migrations/20220325A-fix-typecast-flags.js +3 -8
- package/dist/database/migrations/20220402A-remove-default-value-panel-icon.js +2 -4
- package/dist/database/migrations/20220429A-add-flows.js +2 -4
- package/dist/database/migrations/20220801A-update-notifications-timestamp-column.js +2 -4
- package/dist/database/migrations/20230401A-update-material-icons.js +2 -4
- package/dist/database/migrations/20230526A-migrate-translation-strings.js +9 -16
- package/dist/database/migrations/20230721A-require-shares-fields.js +9 -20
- package/dist/database/migrations/20231009A-update-csv-fields-to-text.js +15 -22
- package/dist/database/migrations/20231009B-update-panel-options.js +4 -12
- package/dist/database/migrations/20240204A-marketplace.js +20 -26
- package/dist/database/migrations/20240311A-deprecate-webhooks.js +1 -1
- package/dist/database/migrations/20240716A-update-files-date-fields.js +8 -14
- package/dist/database/migrations/20240806A-permissions-policies.js +17 -39
- package/dist/database/migrations/20240909A-separate-comments.js +14 -17
- package/dist/database/migrations/20240924A-migrate-legacy-comments.js +6 -11
- package/dist/database/migrations/20240924B-populate-versioning-deltas.js +1 -3
- package/dist/database/migrations/20250224A-visual-editor.js +1 -2
- package/dist/database/migrations/20250609A-license-banner.js +1 -2
- package/dist/database/migrations/20250613A-add-project-id.js +2 -5
- package/dist/database/migrations/20251014A-add-project-owner.js +7 -10
- package/dist/database/migrations/20251028A-add-retention-indexes.js +7 -15
- package/dist/database/migrations/20260113A-add-revisions-index.js +7 -15
- package/dist/database/migrations/run.js +23 -50
- package/dist/database/run-ast/lib/apply-query/add-join.js +8 -20
- package/dist/database/run-ast/lib/apply-query/aggregate.js +1 -3
- package/dist/database/run-ast/lib/apply-query/filter/get-filter-type.js +3 -9
- package/dist/database/run-ast/lib/apply-query/filter/index.js +9 -27
- package/dist/database/run-ast/lib/apply-query/filter/operator.js +42 -107
- package/dist/database/run-ast/lib/apply-query/filter/validate-operator.js +3 -9
- package/dist/database/run-ast/lib/apply-query/get-filter-path.js +2 -6
- package/dist/database/run-ast/lib/apply-query/get-operation.js +9 -14
- package/dist/database/run-ast/lib/apply-query/index.js +20 -39
- package/dist/database/run-ast/lib/apply-query/join-filter-with-cases.js +3 -7
- package/dist/database/run-ast/lib/apply-query/pagination.js +2 -6
- package/dist/database/run-ast/lib/apply-query/search.js +17 -41
- package/dist/database/run-ast/lib/apply-query/sort.js +16 -30
- package/dist/database/run-ast/lib/get-db-query.js +7 -15
- package/dist/database/run-ast/lib/parse-current-level.js +10 -23
- package/dist/database/run-ast/modules/fetch-permitted-ast-root-fields.js +10 -14
- package/dist/database/run-ast/run-ast.js +30 -52
- package/dist/database/run-ast/utils/apply-case-when.js +1 -3
- package/dist/database/run-ast/utils/apply-function-to-column-name.js +2 -6
- package/dist/database/run-ast/utils/apply-parent-filters.js +14 -19
- package/dist/database/run-ast/utils/generate-alias.js +9 -14
- package/dist/database/run-ast/utils/get-column-pre-processor.js +14 -26
- package/dist/database/run-ast/utils/get-column.js +5 -14
- package/dist/database/run-ast/utils/get-inner-query-column-pre-processor.js +1 -3
- package/dist/database/run-ast/utils/merge-with-parent-items.js +31 -63
- package/dist/database/run-ast/utils/remove-temporary-fields.js +15 -29
- package/dist/database/run-ast/utils/with-preprocess-bindings.js +2 -6
- package/dist/database/seeds/run.js +19 -45
- package/dist/deployment/deployment.js +2 -8
- package/dist/deployment/drivers/netlify.js +43 -88
- package/dist/deployment/drivers/vercel.js +34 -72
- package/dist/deployment.js +8 -14
- package/dist/emitter.js +14 -21
- package/dist/extensions/index.js +1 -3
- package/dist/extensions/lib/get-extensions-path.js +1 -3
- package/dist/extensions/lib/get-extensions-settings.js +26 -42
- package/dist/extensions/lib/get-extensions.js +3 -7
- package/dist/extensions/lib/get-shared-deps-mapping.js +3 -7
- package/dist/extensions/lib/installation/index.js +1 -3
- package/dist/extensions/lib/installation/manager.js +9 -23
- package/dist/extensions/lib/sandbox/generate-host-function-reference.js +2 -5
- package/dist/extensions/lib/sandbox/register/call-reference.js +1 -1
- package/dist/extensions/lib/sandbox/register/filter.js +1 -2
- package/dist/extensions/lib/sandbox/register/operation.js +1 -2
- package/dist/extensions/lib/sandbox/register/route.js +2 -4
- package/dist/extensions/lib/sandbox/sdk/generators/log.js +1 -1
- package/dist/extensions/lib/sandbox/sdk/generators/request.js +13 -28
- package/dist/extensions/lib/sandbox/sdk/generators/sleep.js +2 -3
- package/dist/extensions/lib/sandbox/sdk/utils/wrap.js +4 -9
- package/dist/extensions/lib/sync/status.js +4 -11
- package/dist/extensions/lib/sync/sync.js +6 -12
- package/dist/extensions/lib/sync/tracker.js +7 -10
- package/dist/extensions/lib/sync/utils.js +5 -9
- package/dist/extensions/manager.js +59 -107
- package/dist/flows.js +233 -275
- package/dist/lock/lib/use-lock.js +3 -7
- package/dist/logger/index.js +37 -57
- package/dist/logger/redact-query.js +1 -3
- package/dist/mailer.js +12 -18
- package/dist/metrics/lib/create-metrics.js +69 -117
- package/dist/metrics/lib/use-metrics.js +3 -8
- package/dist/middleware/authenticate.js +1 -3
- package/dist/middleware/cache.js +5 -8
- package/dist/middleware/collection-exists.js +3 -8
- package/dist/middleware/cors.js +8 -10
- package/dist/middleware/error-handler.js +10 -21
- package/dist/middleware/extract-token.js +3 -9
- package/dist/middleware/graphql.js +16 -27
- package/dist/middleware/rate-limiter-global.js +1 -3
- package/dist/middleware/rate-limiter-ip.js +9 -11
- package/dist/middleware/rate-limiter-registration.js +9 -11
- package/dist/middleware/request-counter.js +8 -15
- package/dist/middleware/respond.js +8 -16
- package/dist/middleware/validate-batch.js +5 -15
- package/dist/operations/condition/index.js +4 -10
- package/dist/operations/exec/index.js +1 -2
- package/dist/operations/item-create/index.js +18 -26
- package/dist/operations/item-delete/index.js +21 -31
- package/dist/operations/item-read/index.js +21 -31
- package/dist/operations/item-update/index.js +23 -36
- package/dist/operations/log/index.js +1 -2
- package/dist/operations/mail/index.js +5 -8
- package/dist/operations/mail/rate-limiter.js +6 -10
- package/dist/operations/notification/index.js +13 -19
- package/dist/operations/request/index.js +8 -13
- package/dist/operations/throw-error/index.js +1 -2
- package/dist/operations/trigger/index.js +4 -8
- package/dist/packages/types/dist/index.js +219 -231
- package/dist/permissions/cache.js +2 -3
- package/dist/permissions/lib/fetch-permissions.js +1 -3
- package/dist/permissions/lib/fetch-policies.js +5 -10
- package/dist/permissions/modules/fetch-accountability-collection-access/fetch-accountability-collection-access.js +19 -32
- package/dist/permissions/modules/fetch-allowed-collections/fetch-allowed-collections.js +7 -12
- package/dist/permissions/modules/fetch-allowed-field-map/fetch-allowed-field-map.js +8 -17
- package/dist/permissions/modules/fetch-global-access/fetch-global-access.js +1 -1
- package/dist/permissions/modules/fetch-inconsistent-field-map/fetch-inconsistent-field-map.js +6 -10
- package/dist/permissions/modules/fetch-policies-ip-access/fetch-policies-ip-access.js +9 -15
- package/dist/permissions/modules/process-ast/lib/extract-fields-from-children.js +2 -8
- package/dist/permissions/modules/process-ast/lib/extract-fields-from-query.js +32 -34
- package/dist/permissions/modules/process-ast/lib/field-map-from-ast.js +2 -2
- package/dist/permissions/modules/process-ast/lib/get-cases.js +3 -8
- package/dist/permissions/modules/process-ast/lib/inject-cases.js +6 -19
- package/dist/permissions/modules/process-ast/process-ast.js +4 -12
- package/dist/permissions/modules/process-ast/utils/collections-in-field-map.js +2 -4
- package/dist/permissions/modules/process-ast/utils/dedupe-access.js +6 -10
- package/dist/permissions/modules/process-ast/utils/extract-paths-from-query.js +9 -25
- package/dist/permissions/modules/process-ast/utils/find-related-collection.js +1 -3
- package/dist/permissions/modules/process-ast/utils/flatten-filter.js +7 -10
- package/dist/permissions/modules/process-ast/utils/get-info-for-path.js +4 -6
- package/dist/permissions/modules/process-ast/utils/validate-path/create-error.js +1 -2
- package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-existence.js +3 -8
- package/dist/permissions/modules/process-ast/utils/validate-path/validate-path-permissions.js +5 -13
- package/dist/permissions/modules/process-payload/lib/is-field-nullable.js +1 -2
- package/dist/permissions/modules/process-payload/process-payload.js +6 -15
- package/dist/permissions/modules/validate-access/lib/validate-collection-access.js +2 -3
- package/dist/permissions/modules/validate-access/lib/validate-item-access.js +14 -28
- package/dist/permissions/modules/validate-access/validate-access.js +5 -15
- package/dist/permissions/modules/validate-remaining-admin/validate-remaining-admin-count.js +1 -3
- package/dist/permissions/utils/extract-required-dynamic-variable-context.js +10 -15
- package/dist/permissions/utils/fetch-dynamic-variable-data.js +17 -35
- package/dist/permissions/utils/fetch-raw-permissions.js +3 -9
- package/dist/permissions/utils/fetch-share-info.js +1 -2
- package/dist/permissions/utils/filter-policies-by-ip.js +2 -6
- package/dist/permissions/utils/get-permissions-for-share.js +22 -47
- package/dist/permissions/utils/get-unaliased-field-key.js +2 -5
- package/dist/permissions/utils/merge-permissions.js +13 -36
- package/dist/permissions/utils/with-cache.js +1 -3
- package/dist/rate-limiter.js +2 -7
- package/dist/redis/lib/create-redis.js +1 -2
- package/dist/redis/lib/use-redis.js +1 -1
- package/dist/redis/utils/redis-config-available.js +1 -3
- package/dist/request/agent-with-ip-validation.js +3 -7
- package/dist/request/is-denied-ip.js +1 -3
- package/dist/schedules/metrics.js +4 -11
- package/dist/schedules/retention.js +17 -33
- package/dist/schedules/telemetry.js +1 -2
- package/dist/schedules/tus.js +5 -7
- package/dist/server.js +12 -24
- package/dist/services/access.js +1 -3
- package/dist/services/assets/name-deduper.js +2 -6
- package/dist/services/assets.js +43 -79
- package/dist/services/authentication.js +63 -96
- package/dist/services/collections.js +107 -218
- package/dist/services/comments.js +18 -32
- package/dist/services/deployment-projects.js +17 -31
- package/dist/services/deployment.js +63 -106
- package/dist/services/extensions.js +25 -63
- package/dist/services/fields/build-collection-and-field-relations.js +8 -14
- package/dist/services/fields/get-collection-meta-updates.js +4 -12
- package/dist/services/fields/get-collection-relation-list.js +2 -4
- package/dist/services/fields.js +162 -314
- package/dist/services/files/lib/extract-metadata.js +7 -20
- package/dist/services/files/utils/get-metadata.js +31 -64
- package/dist/services/files/utils/parse-image-metadata.js +7 -19
- package/dist/services/files.js +102 -173
- package/dist/services/flows.js +3 -6
- package/dist/services/folders.js +13 -17
- package/dist/services/graphql/errors/format.js +2 -2
- package/dist/services/graphql/index.js +4 -13
- package/dist/services/graphql/resolvers/get-collection-type.js +1 -3
- package/dist/services/graphql/resolvers/get-field-type.js +1 -3
- package/dist/services/graphql/resolvers/get-relation-type.js +1 -3
- package/dist/services/graphql/resolvers/mutation.js +6 -14
- package/dist/services/graphql/resolvers/query.js +3 -10
- package/dist/services/graphql/resolvers/system-admin.js +13 -27
- package/dist/services/graphql/resolvers/system-global.js +31 -71
- package/dist/services/graphql/resolvers/system.js +209 -245
- package/dist/services/graphql/schema/get-types.js +69 -101
- package/dist/services/graphql/schema/index.js +74 -92
- package/dist/services/graphql/schema/parse-args.js +1 -2
- package/dist/services/graphql/schema/parse-query.js +8 -21
- package/dist/services/graphql/schema/read.js +83 -106
- package/dist/services/graphql/schema/write.js +36 -41
- package/dist/services/graphql/subscription.js +30 -51
- package/dist/services/graphql/types/bigint.js +5 -15
- package/dist/services/graphql/types/string-or-float.js +2 -6
- package/dist/services/graphql/utils/add-path-to-validation-error.js +1 -3
- package/dist/services/graphql/utils/aggregate-query.js +2 -6
- package/dist/services/graphql/utils/dedupe-resolvers.js +8 -13
- package/dist/services/graphql/utils/filter-replace-m2a.js +9 -18
- package/dist/services/graphql/utils/process-error.js +21 -31
- package/dist/services/graphql/utils/replace-fragments.js +2 -5
- package/dist/services/graphql/utils/replace-funcs.js +2 -5
- package/dist/services/graphql/utils/sanitize-gql-schema.js +10 -21
- package/dist/services/import-export.js +68 -143
- package/dist/services/items.js +126 -271
- package/dist/services/mail/index.js +13 -26
- package/dist/services/mail/rate-limiter.js +6 -10
- package/dist/services/meta.js +4 -9
- package/dist/services/notifications.js +2 -3
- package/dist/services/operations.js +3 -6
- package/dist/services/payload.js +188 -316
- package/dist/services/permissions.js +14 -26
- package/dist/services/policies.js +7 -18
- package/dist/services/relations.js +82 -181
- package/dist/services/revisions.js +8 -15
- package/dist/services/roles.js +4 -12
- package/dist/services/schema.js +4 -9
- package/dist/services/server.js +31 -66
- package/dist/services/shares.js +25 -35
- package/dist/services/specifications.js +87 -139
- package/dist/services/tfa.js +8 -24
- package/dist/services/translations.js +6 -12
- package/dist/services/tus/data-store.js +23 -55
- package/dist/services/tus/lockers.js +4 -10
- package/dist/services/tus/server.js +2 -5
- package/dist/services/users.js +79 -153
- package/dist/services/utils.js +12 -31
- package/dist/services/versions.js +52 -96
- package/dist/services/websocket.js +8 -12
- package/dist/storage/get-storage-driver.js +2 -5
- package/dist/storage/register-drivers.js +1 -3
- package/dist/storage/register-locations.js +2 -4
- package/dist/synchronization.js +6 -17
- package/dist/telemetry/counter/use-buffered-counter.js +6 -22
- package/dist/telemetry/counter/use-counters.js +2 -6
- package/dist/telemetry/lib/send-report.js +2 -6
- package/dist/telemetry/lib/track.js +3 -8
- package/dist/telemetry/utils/check-user-limits.js +3 -9
- package/dist/telemetry/utils/format-api-request-counts.js +1 -3
- package/dist/telemetry/utils/get-extension-count.js +3 -8
- package/dist/telemetry/utils/get-item-count.js +2 -5
- package/dist/telemetry/utils/get-settings.js +2 -3
- package/dist/telemetry/utils/get-user-item-count.js +2 -4
- package/dist/telemetry/utils/should-check-user-limits.js +1 -3
- package/dist/types/index.js +0 -6
- package/dist/utils/apply-diff.js +111 -143
- package/dist/utils/apply-snapshot.js +1 -2
- package/dist/utils/calculate-field-depth.js +6 -19
- package/dist/utils/construct-flow-tree.js +5 -12
- package/dist/utils/create-admin.js +1 -2
- package/dist/utils/deep-map-response.js +31 -35
- package/dist/utils/encrypt.js +2 -3
- package/dist/utils/fetch-user-count/fetch-access-lookup.js +5 -15
- package/dist/utils/fetch-user-count/get-user-count-query.js +4 -12
- package/dist/utils/filter-items.js +9 -14
- package/dist/utils/freeze-schema.js +3 -8
- package/dist/utils/generate-translations.js +87 -137
- package/dist/utils/get-accountability-for-role.js +12 -17
- package/dist/utils/get-accountability-for-token.js +25 -31
- package/dist/utils/get-address.js +2 -7
- package/dist/utils/get-allowed-log-levels.js +1 -3
- package/dist/utils/get-auth-providers.js +12 -14
- package/dist/utils/get-cache-headers.js +2 -4
- package/dist/utils/get-cache-key.js +16 -4
- package/dist/utils/get-collection-from-alias.js +1 -6
- package/dist/utils/get-column-path.js +10 -21
- package/dist/utils/get-config-from-env.js +6 -15
- package/dist/utils/get-default-index-name.js +2 -4
- package/dist/utils/get-default-value.js +5 -9
- package/dist/utils/get-field-relational-depth.js +2 -5
- package/dist/utils/get-graphql-query-and-variables.js +1 -2
- package/dist/utils/get-graphql-type.js +1 -3
- package/dist/utils/get-ip-from-req.js +6 -15
- package/dist/utils/get-local-type.js +5 -13
- package/dist/utils/get-milliseconds.js +1 -3
- package/dist/utils/get-module-default.js +1 -3
- package/dist/utils/get-schema.js +9 -21
- package/dist/utils/get-secret.js +2 -6
- package/dist/utils/get-snapshot-diff.js +15 -23
- package/dist/utils/get-snapshot.js +6 -17
- package/dist/utils/is-directus-jwt.js +1 -2
- package/dist/utils/is-field-allowed.js +1 -3
- package/dist/utils/job-queue.js +2 -7
- package/dist/utils/jwt.js +7 -13
- package/dist/utils/md.js +1 -2
- package/dist/utils/parse-filter-key.js +2 -4
- package/dist/utils/parse-numeric-string.js +5 -11
- package/dist/utils/permissions-cacheable.js +9 -22
- package/dist/utils/redact-object.js +27 -57
- package/dist/utils/reduce-schema.js +8 -25
- package/dist/utils/sanitize-query.js +46 -98
- package/dist/utils/sanitize-schema.js +2 -3
- package/dist/utils/schedule.js +2 -6
- package/dist/utils/should-clear-cache.js +2 -6
- package/dist/utils/should-skip-cache.js +3 -8
- package/dist/utils/split-fields.js +4 -12
- package/dist/utils/stall.js +1 -3
- package/dist/utils/store.js +2 -5
- package/dist/utils/transaction.js +29 -58
- package/dist/utils/transformations.js +28 -43
- package/dist/utils/translations-shared.js +4 -12
- package/dist/utils/url.js +3 -10
- package/dist/utils/user-name.js +4 -12
- package/dist/utils/validate-diff.js +10 -35
- package/dist/utils/validate-env.js +3 -5
- package/dist/utils/validate-keys.js +4 -10
- package/dist/utils/validate-query.js +67 -118
- package/dist/utils/validate-snapshot.js +3 -9
- package/dist/utils/validate-storage.js +12 -19
- package/dist/utils/validate-user-count-integrity.js +3 -9
- package/dist/utils/verify-session-jwt.js +2 -6
- package/dist/utils/versioning/handle-version.js +10 -29
- package/dist/utils/versioning/merge-version-data.js +1 -5
- package/dist/utils/versioning/split-recursive.js +6 -3
- package/dist/websocket/authenticate.js +7 -18
- package/dist/websocket/collab/calculate-cache-metadata.js +33 -51
- package/dist/websocket/collab/collab.js +49 -113
- package/dist/websocket/collab/filter-to-fields.js +2 -5
- package/dist/websocket/collab/messenger.js +48 -73
- package/dist/websocket/collab/payload-permissions.js +20 -51
- package/dist/websocket/collab/permissions-cache.js +17 -46
- package/dist/websocket/collab/room.js +57 -124
- package/dist/websocket/collab/verify-permissions.js +37 -48
- package/dist/websocket/controllers/base.js +34 -61
- package/dist/websocket/controllers/graphql.js +11 -18
- package/dist/websocket/controllers/index.js +3 -12
- package/dist/websocket/controllers/logs.js +3 -7
- package/dist/websocket/errors.js +2 -5
- package/dist/websocket/handlers/heartbeat.js +11 -19
- package/dist/websocket/handlers/index.js +5 -15
- package/dist/websocket/handlers/items.js +15 -26
- package/dist/websocket/handlers/logs.js +24 -41
- package/dist/websocket/handlers/subscribe.js +37 -66
- package/dist/websocket/utils/get-expires-at-for-token.js +1 -3
- package/dist/websocket/utils/items.js +10 -27
- package/dist/websocket/utils/message.js +6 -10
- package/package.json +23 -23
- package/dist/__utils__/items-utils.js +0 -32
- package/dist/__utils__/schemas.js +0 -297
- package/dist/__utils__/snapshots.js +0 -899
- package/dist/database/run-ast/lib/apply-query/mock.js +0 -9
- package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +0 -445
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/index.js +0 -176
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/system/policy.js +0 -54
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/any.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/any/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/argument.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/argument/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/array.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/array/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/async-iterator.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/async-iterator/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/awaited.js +0 -37
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/awaited/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/bigint.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/bigint/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/boolean.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/boolean/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/type.js +0 -17
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/clone/value.js +0 -35
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/composite.js +0 -42
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/composite/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/computed.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/computed/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/const.js +0 -52
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/const/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/constructor.js +0 -17
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/constructor-parameters.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/constructor-parameters/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/immutable.js +0 -32
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/create/type.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/date.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/date/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/discard.js +0 -12
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/discard/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/enum.js +0 -23
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/enum/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/error.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/error/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-mapped-result.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude-from-template-literal.js +0 -11
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/exclude.js +0 -25
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/exclude/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-check.js +0 -267
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-key.js +0 -29
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-from-mapped-result.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends-undefined.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/extends.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extends/index.js +0 -7
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-mapped-result.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract-from-template-literal.js +0 -11
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/extract.js +0 -25
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/extract/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/function.js +0 -17
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/function/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/kind.js +0 -204
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/type.js +0 -293
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/guard/value.js +0 -68
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/helpers.js +0 -8
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/helpers/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/index.js +0 -6
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-key.js +0 -27
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-from-mapped-result.js +0 -24
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed-property-keys.js +0 -24
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/indexed/indexed.js +0 -67
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instance-type/instance-type.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/instantiate/instantiate.js +0 -102
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/integer/integer.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-create.js +0 -23
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-evaluated.js +0 -35
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect-type.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intersect/intersect.js +0 -17
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/capitalize.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/index.js +0 -8
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic-from-mapped-key.js +0 -30
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/intrinsic.js +0 -54
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/lowercase.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uncapitalize.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/intrinsic/uppercase.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/iterator/iterator.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/index.js +0 -6
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-from-mapped-result.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-entries.js +0 -17
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof-property-keys.js +0 -52
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/keyof/keyof.js +0 -38
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/literal/literal.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-key.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped-result.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/mapped/mapped.js +0 -86
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/compute.js +0 -144
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/module/module.js +0 -44
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/never/never.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/not/not.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/null/null.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/number/number.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/object/object.js +0 -33
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-key.js +0 -27
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit-from-mapped-result.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/omit/omit.js +0 -65
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional-from-mapped-result.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/optional/optional.js +0 -29
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/parameters/parameters.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial-from-mapped-result.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/partial/partial.js +0 -62
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/patterns/patterns.js +0 -12
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-key.js +0 -27
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick-from-mapped-result.js +0 -21
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/pick/pick.js +0 -63
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/promise/promise.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly-from-mapped-result.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly/readonly.js +0 -29
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/readonly-optional/readonly-optional.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/record/record.js +0 -92
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/recursive/recursive.js +0 -24
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/ref/ref.js +0 -19
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/regexp/regexp.js +0 -19
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/format.js +0 -30
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/registry/type.js +0 -30
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required-from-mapped-result.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/required/required.js +0 -60
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/rest/rest.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/return-type/return-type.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/anyschema.js +0 -1
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/index.js +0 -4
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/schema/schema.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/sets/set.js +0 -42
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/static/static.js +0 -1
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/string/string.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbol/symbol.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/symbols/symbols.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/finite.js +0 -28
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/generate.js +0 -37
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/index.js +0 -9
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/parse.js +0 -125
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/pattern.js +0 -24
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/syntax.js +0 -55
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/template-literal.js +0 -20
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/template-literal/union.js +0 -16
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/transform/transform.js +0 -51
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/tuple/tuple.js +0 -24
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/index.js +0 -10
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/javascript.js +0 -123
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/json.js +0 -263
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/type/type.js +0 -191
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/uint8array/uint8array.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/undefined/undefined.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/index.js +0 -5
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-create.js +0 -14
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-evaluated.js +0 -33
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union-type.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/union/union.js +0 -13
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unknown/unknown.js +0 -12
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/unsafe/unsafe.js +0 -12
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/index.js +0 -3
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/type/void/void.js +0 -15
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/guard.js +0 -140
- package/dist/node_modules/.pnpm/@sinclair_typebox@0.34.41/node_modules/@sinclair/typebox/build/esm/value/guard/index.js +0 -3
- package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.js +0 -1714
- package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js +0 -1287
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js +0 -2151
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.js +0 -8
- package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.js +0 -8
- package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.js +0 -2082
- package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.js +0 -192
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js +0 -158
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.js +0 -1535
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.js +0 -155
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js +0 -244
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.js +0 -621
- package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js +0 -890
- package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js +0 -3558
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/branding.js +0 -13
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/index.js +0 -115
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/messages.js +0 -77
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/overloads.js +0 -13
- package/dist/node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/utils.js +0 -30
- package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js +0 -398
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/MockClient.js +0 -79
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/MockConnection.js +0 -64
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/Tracker.js +0 -185
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/constants.js +0 -30
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/index.js +0 -37
- package/dist/node_modules/.pnpm/knex-mock-client@3.0.2_knex@3.1.0_mysql2@3.15.3_pg@8.16.3_sqlite3@5.1.7_tedious@18.6.1_/node_modules/knex-mock-client/dist/utils.js +0 -17
- package/dist/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js +0 -1486
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js +0 -11
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js +0 -18
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js +0 -11
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js +0 -19
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js +0 -15
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js +0 -39
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js +0 -14
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js +0 -141
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js +0 -43
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js +0 -138
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js +0 -25
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js +0 -22
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js +0 -27
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js +0 -6
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js +0 -12
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js +0 -18
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js +0 -27
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js +0 -10
- package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js +0 -36
- package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +0 -1258
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +0 -21
- package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +0 -478
- package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.js +0 -84
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js +0 -85
- package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js +0 -15
- package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.js +0 -158
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +0 -8
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/benchmark.CYdenmiT.js +0 -41
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +0 -50
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/index.CdQS2e2Q.js +0 -38
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +0 -66
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +0 -2986
- package/dist/node_modules/.pnpm/vitest@3.2.4_@types_node@22.13.14_@vitest_ui@3.2.4_happy-dom@20.8.9_jiti@2.6.1_jsdom@20_c24d183060b6f93f55300b66d0779768/node_modules/vitest/dist/index.js +0 -24
- package/dist/test-utils/cache.js +0 -64
- package/dist/test-utils/controllers.js +0 -101
- package/dist/test-utils/database.js +0 -54
- package/dist/test-utils/emitter.js +0 -38
- package/dist/test-utils/env.js +0 -77
- package/dist/test-utils/knex.js +0 -222
- package/dist/test-utils/schema.js +0 -35
- package/dist/test-utils/services/fields-service.js +0 -38
- package/dist/test-utils/services/files-service.js +0 -35
- package/dist/test-utils/services/folders-service.js +0 -34
- package/dist/test-utils/services/items-service.js +0 -52
- package/dist/test-utils/storage.js +0 -150
|
@@ -1,1535 +0,0 @@
|
|
|
1
|
-
import { u } from "../../../../../tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js";
|
|
2
|
-
import { format, plugins } from "../../../../../@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js";
|
|
3
|
-
import "../../../../../loupe@3.2.1/node_modules/loupe/lib/index.js";
|
|
4
|
-
import { getDefaultExportFromCjs, stringify } from "./chunk-_commonjsHelpers.js";
|
|
5
|
-
import { deepClone, getOwnProperties, getType } from "./helpers.js";
|
|
6
|
-
|
|
7
|
-
//#region ../node_modules/.pnpm/@vitest+utils@3.2.4/node_modules/@vitest/utils/dist/diff.js
|
|
8
|
-
/**
|
|
9
|
-
* Diff Match and Patch
|
|
10
|
-
* Copyright 2018 The diff-match-patch Authors.
|
|
11
|
-
* https://github.com/google/diff-match-patch
|
|
12
|
-
*
|
|
13
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
-
* you may not use this file except in compliance with the License.
|
|
15
|
-
* You may obtain a copy of the License at
|
|
16
|
-
*
|
|
17
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
-
*
|
|
19
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
20
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
-
* See the License for the specific language governing permissions and
|
|
23
|
-
* limitations under the License.
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* @fileoverview Computes the difference between two texts to create a patch.
|
|
27
|
-
* Applies the patch onto another text, allowing for errors.
|
|
28
|
-
* @author fraser@google.com (Neil Fraser)
|
|
29
|
-
*/
|
|
30
|
-
/**
|
|
31
|
-
* CHANGES by pedrottimark to diff_match_patch_uncompressed.ts file:
|
|
32
|
-
*
|
|
33
|
-
* 1. Delete anything not needed to use diff_cleanupSemantic method
|
|
34
|
-
* 2. Convert from prototype properties to var declarations
|
|
35
|
-
* 3. Convert Diff to class from constructor and prototype
|
|
36
|
-
* 4. Add type annotations for arguments and return values
|
|
37
|
-
* 5. Add exports
|
|
38
|
-
*/
|
|
39
|
-
/**
|
|
40
|
-
* The data structure representing a diff is an array of tuples:
|
|
41
|
-
* [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]
|
|
42
|
-
* which means: delete 'Hello', add 'Goodbye' and keep ' world.'
|
|
43
|
-
*/
|
|
44
|
-
const DIFF_DELETE = -1;
|
|
45
|
-
const DIFF_INSERT = 1;
|
|
46
|
-
const DIFF_EQUAL = 0;
|
|
47
|
-
/**
|
|
48
|
-
* Class representing one diff tuple.
|
|
49
|
-
* Attempts to look like a two-element array (which is what this used to be).
|
|
50
|
-
* @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL.
|
|
51
|
-
* @param {string} text Text to be deleted, inserted, or retained.
|
|
52
|
-
* @constructor
|
|
53
|
-
*/
|
|
54
|
-
var Diff = class {
|
|
55
|
-
0;
|
|
56
|
-
1;
|
|
57
|
-
constructor(op, text) {
|
|
58
|
-
this[0] = op;
|
|
59
|
-
this[1] = text;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* Determine the common prefix of two strings.
|
|
64
|
-
* @param {string} text1 First string.
|
|
65
|
-
* @param {string} text2 Second string.
|
|
66
|
-
* @return {number} The number of characters common to the start of each
|
|
67
|
-
* string.
|
|
68
|
-
*/
|
|
69
|
-
function diff_commonPrefix(text1, text2) {
|
|
70
|
-
if (!text1 || !text2 || text1.charAt(0) !== text2.charAt(0)) {
|
|
71
|
-
return 0;
|
|
72
|
-
}
|
|
73
|
-
let pointermin = 0;
|
|
74
|
-
let pointermax = Math.min(text1.length, text2.length);
|
|
75
|
-
let pointermid = pointermax;
|
|
76
|
-
let pointerstart = 0;
|
|
77
|
-
while (pointermin < pointermid) {
|
|
78
|
-
if (text1.substring(pointerstart, pointermid) === text2.substring(pointerstart, pointermid)) {
|
|
79
|
-
pointermin = pointermid;
|
|
80
|
-
pointerstart = pointermin;
|
|
81
|
-
} else {
|
|
82
|
-
pointermax = pointermid;
|
|
83
|
-
}
|
|
84
|
-
pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
|
|
85
|
-
}
|
|
86
|
-
return pointermid;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Determine the common suffix of two strings.
|
|
90
|
-
* @param {string} text1 First string.
|
|
91
|
-
* @param {string} text2 Second string.
|
|
92
|
-
* @return {number} The number of characters common to the end of each string.
|
|
93
|
-
*/
|
|
94
|
-
function diff_commonSuffix(text1, text2) {
|
|
95
|
-
if (!text1 || !text2 || text1.charAt(text1.length - 1) !== text2.charAt(text2.length - 1)) {
|
|
96
|
-
return 0;
|
|
97
|
-
}
|
|
98
|
-
let pointermin = 0;
|
|
99
|
-
let pointermax = Math.min(text1.length, text2.length);
|
|
100
|
-
let pointermid = pointermax;
|
|
101
|
-
let pointerend = 0;
|
|
102
|
-
while (pointermin < pointermid) {
|
|
103
|
-
if (text1.substring(text1.length - pointermid, text1.length - pointerend) === text2.substring(text2.length - pointermid, text2.length - pointerend)) {
|
|
104
|
-
pointermin = pointermid;
|
|
105
|
-
pointerend = pointermin;
|
|
106
|
-
} else {
|
|
107
|
-
pointermax = pointermid;
|
|
108
|
-
}
|
|
109
|
-
pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
|
|
110
|
-
}
|
|
111
|
-
return pointermid;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Determine if the suffix of one string is the prefix of another.
|
|
115
|
-
* @param {string} text1 First string.
|
|
116
|
-
* @param {string} text2 Second string.
|
|
117
|
-
* @return {number} The number of characters common to the end of the first
|
|
118
|
-
* string and the start of the second string.
|
|
119
|
-
* @private
|
|
120
|
-
*/
|
|
121
|
-
function diff_commonOverlap_(text1, text2) {
|
|
122
|
-
const text1_length = text1.length;
|
|
123
|
-
const text2_length = text2.length;
|
|
124
|
-
if (text1_length === 0 || text2_length === 0) {
|
|
125
|
-
return 0;
|
|
126
|
-
}
|
|
127
|
-
if (text1_length > text2_length) {
|
|
128
|
-
text1 = text1.substring(text1_length - text2_length);
|
|
129
|
-
} else if (text1_length < text2_length) {
|
|
130
|
-
text2 = text2.substring(0, text1_length);
|
|
131
|
-
}
|
|
132
|
-
const text_length = Math.min(text1_length, text2_length);
|
|
133
|
-
if (text1 === text2) {
|
|
134
|
-
return text_length;
|
|
135
|
-
}
|
|
136
|
-
let best = 0;
|
|
137
|
-
let length = 1;
|
|
138
|
-
while (true) {
|
|
139
|
-
const pattern = text1.substring(text_length - length);
|
|
140
|
-
const found = text2.indexOf(pattern);
|
|
141
|
-
if (found === -1) {
|
|
142
|
-
return best;
|
|
143
|
-
}
|
|
144
|
-
length += found;
|
|
145
|
-
if (found === 0 || text1.substring(text_length - length) === text2.substring(0, length)) {
|
|
146
|
-
best = length;
|
|
147
|
-
length++;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Reduce the number of edits by eliminating semantically trivial equalities.
|
|
153
|
-
* @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
|
|
154
|
-
*/
|
|
155
|
-
function diff_cleanupSemantic(diffs) {
|
|
156
|
-
let changes = false;
|
|
157
|
-
const equalities = [];
|
|
158
|
-
let equalitiesLength = 0;
|
|
159
|
-
/** @type {?string} */
|
|
160
|
-
let lastEquality = null;
|
|
161
|
-
let pointer = 0;
|
|
162
|
-
let length_insertions1 = 0;
|
|
163
|
-
let length_deletions1 = 0;
|
|
164
|
-
let length_insertions2 = 0;
|
|
165
|
-
let length_deletions2 = 0;
|
|
166
|
-
while (pointer < diffs.length) {
|
|
167
|
-
if (diffs[pointer][0] === DIFF_EQUAL) {
|
|
168
|
-
equalities[equalitiesLength++] = pointer;
|
|
169
|
-
length_insertions1 = length_insertions2;
|
|
170
|
-
length_deletions1 = length_deletions2;
|
|
171
|
-
length_insertions2 = 0;
|
|
172
|
-
length_deletions2 = 0;
|
|
173
|
-
lastEquality = diffs[pointer][1];
|
|
174
|
-
} else {
|
|
175
|
-
if (diffs[pointer][0] === DIFF_INSERT) {
|
|
176
|
-
length_insertions2 += diffs[pointer][1].length;
|
|
177
|
-
} else {
|
|
178
|
-
length_deletions2 += diffs[pointer][1].length;
|
|
179
|
-
}
|
|
180
|
-
if (lastEquality && lastEquality.length <= Math.max(length_insertions1, length_deletions1) && lastEquality.length <= Math.max(length_insertions2, length_deletions2)) {
|
|
181
|
-
diffs.splice(equalities[equalitiesLength - 1], 0, new Diff(DIFF_DELETE, lastEquality));
|
|
182
|
-
diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
|
|
183
|
-
equalitiesLength--;
|
|
184
|
-
equalitiesLength--;
|
|
185
|
-
pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
|
|
186
|
-
length_insertions1 = 0;
|
|
187
|
-
length_deletions1 = 0;
|
|
188
|
-
length_insertions2 = 0;
|
|
189
|
-
length_deletions2 = 0;
|
|
190
|
-
lastEquality = null;
|
|
191
|
-
changes = true;
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
pointer++;
|
|
195
|
-
}
|
|
196
|
-
if (changes) {
|
|
197
|
-
diff_cleanupMerge(diffs);
|
|
198
|
-
}
|
|
199
|
-
diff_cleanupSemanticLossless(diffs);
|
|
200
|
-
pointer = 1;
|
|
201
|
-
while (pointer < diffs.length) {
|
|
202
|
-
if (diffs[pointer - 1][0] === DIFF_DELETE && diffs[pointer][0] === DIFF_INSERT) {
|
|
203
|
-
const deletion = diffs[pointer - 1][1];
|
|
204
|
-
const insertion = diffs[pointer][1];
|
|
205
|
-
const overlap_length1 = diff_commonOverlap_(deletion, insertion);
|
|
206
|
-
const overlap_length2 = diff_commonOverlap_(insertion, deletion);
|
|
207
|
-
if (overlap_length1 >= overlap_length2) {
|
|
208
|
-
if (overlap_length1 >= deletion.length / 2 || overlap_length1 >= insertion.length / 2) {
|
|
209
|
-
diffs.splice(pointer, 0, new Diff(DIFF_EQUAL, insertion.substring(0, overlap_length1)));
|
|
210
|
-
diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlap_length1);
|
|
211
|
-
diffs[pointer + 1][1] = insertion.substring(overlap_length1);
|
|
212
|
-
pointer++;
|
|
213
|
-
}
|
|
214
|
-
} else {
|
|
215
|
-
if (overlap_length2 >= deletion.length / 2 || overlap_length2 >= insertion.length / 2) {
|
|
216
|
-
diffs.splice(pointer, 0, new Diff(DIFF_EQUAL, deletion.substring(0, overlap_length2)));
|
|
217
|
-
diffs[pointer - 1][0] = DIFF_INSERT;
|
|
218
|
-
diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlap_length2);
|
|
219
|
-
diffs[pointer + 1][0] = DIFF_DELETE;
|
|
220
|
-
diffs[pointer + 1][1] = deletion.substring(overlap_length2);
|
|
221
|
-
pointer++;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
pointer++;
|
|
225
|
-
}
|
|
226
|
-
pointer++;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
const nonAlphaNumericRegex_ = /[^a-z0-9]/i;
|
|
230
|
-
const whitespaceRegex_ = /\s/;
|
|
231
|
-
const linebreakRegex_ = /[\r\n]/;
|
|
232
|
-
const blanklineEndRegex_ = /\n\r?\n$/;
|
|
233
|
-
const blanklineStartRegex_ = /^\r?\n\r?\n/;
|
|
234
|
-
/**
|
|
235
|
-
* Look for single edits surrounded on both sides by equalities
|
|
236
|
-
* which can be shifted sideways to align the edit to a word boundary.
|
|
237
|
-
* e.g: The c<ins>at c</ins>ame. -> The <ins>cat </ins>came.
|
|
238
|
-
* @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
|
|
239
|
-
*/
|
|
240
|
-
function diff_cleanupSemanticLossless(diffs) {
|
|
241
|
-
let pointer = 1;
|
|
242
|
-
while (pointer < diffs.length - 1) {
|
|
243
|
-
if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
|
|
244
|
-
let equality1 = diffs[pointer - 1][1];
|
|
245
|
-
let edit = diffs[pointer][1];
|
|
246
|
-
let equality2 = diffs[pointer + 1][1];
|
|
247
|
-
const commonOffset = diff_commonSuffix(equality1, edit);
|
|
248
|
-
if (commonOffset) {
|
|
249
|
-
const commonString = edit.substring(edit.length - commonOffset);
|
|
250
|
-
equality1 = equality1.substring(0, equality1.length - commonOffset);
|
|
251
|
-
edit = commonString + edit.substring(0, edit.length - commonOffset);
|
|
252
|
-
equality2 = commonString + equality2;
|
|
253
|
-
}
|
|
254
|
-
let bestEquality1 = equality1;
|
|
255
|
-
let bestEdit = edit;
|
|
256
|
-
let bestEquality2 = equality2;
|
|
257
|
-
let bestScore = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
|
|
258
|
-
while (edit.charAt(0) === equality2.charAt(0)) {
|
|
259
|
-
equality1 += edit.charAt(0);
|
|
260
|
-
edit = edit.substring(1) + equality2.charAt(0);
|
|
261
|
-
equality2 = equality2.substring(1);
|
|
262
|
-
const score = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
|
|
263
|
-
if (score >= bestScore) {
|
|
264
|
-
bestScore = score;
|
|
265
|
-
bestEquality1 = equality1;
|
|
266
|
-
bestEdit = edit;
|
|
267
|
-
bestEquality2 = equality2;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
if (diffs[pointer - 1][1] !== bestEquality1) {
|
|
271
|
-
if (bestEquality1) {
|
|
272
|
-
diffs[pointer - 1][1] = bestEquality1;
|
|
273
|
-
} else {
|
|
274
|
-
diffs.splice(pointer - 1, 1);
|
|
275
|
-
pointer--;
|
|
276
|
-
}
|
|
277
|
-
diffs[pointer][1] = bestEdit;
|
|
278
|
-
if (bestEquality2) {
|
|
279
|
-
diffs[pointer + 1][1] = bestEquality2;
|
|
280
|
-
} else {
|
|
281
|
-
diffs.splice(pointer + 1, 1);
|
|
282
|
-
pointer--;
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
pointer++;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Reorder and merge like edit sections. Merge equalities.
|
|
291
|
-
* Any edit section can move as long as it doesn't cross an equality.
|
|
292
|
-
* @param {!Array.<!diff_match_patch.Diff>} diffs Array of diff tuples.
|
|
293
|
-
*/
|
|
294
|
-
function diff_cleanupMerge(diffs) {
|
|
295
|
-
diffs.push(new Diff(DIFF_EQUAL, ""));
|
|
296
|
-
let pointer = 0;
|
|
297
|
-
let count_delete = 0;
|
|
298
|
-
let count_insert = 0;
|
|
299
|
-
let text_delete = "";
|
|
300
|
-
let text_insert = "";
|
|
301
|
-
let commonlength;
|
|
302
|
-
while (pointer < diffs.length) {
|
|
303
|
-
switch (diffs[pointer][0]) {
|
|
304
|
-
case DIFF_INSERT:
|
|
305
|
-
count_insert++;
|
|
306
|
-
text_insert += diffs[pointer][1];
|
|
307
|
-
pointer++;
|
|
308
|
-
break;
|
|
309
|
-
case DIFF_DELETE:
|
|
310
|
-
count_delete++;
|
|
311
|
-
text_delete += diffs[pointer][1];
|
|
312
|
-
pointer++;
|
|
313
|
-
break;
|
|
314
|
-
case DIFF_EQUAL:
|
|
315
|
-
if (count_delete + count_insert > 1) {
|
|
316
|
-
if (count_delete !== 0 && count_insert !== 0) {
|
|
317
|
-
commonlength = diff_commonPrefix(text_insert, text_delete);
|
|
318
|
-
if (commonlength !== 0) {
|
|
319
|
-
if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] === DIFF_EQUAL) {
|
|
320
|
-
diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
|
|
321
|
-
} else {
|
|
322
|
-
diffs.splice(0, 0, new Diff(DIFF_EQUAL, text_insert.substring(0, commonlength)));
|
|
323
|
-
pointer++;
|
|
324
|
-
}
|
|
325
|
-
text_insert = text_insert.substring(commonlength);
|
|
326
|
-
text_delete = text_delete.substring(commonlength);
|
|
327
|
-
}
|
|
328
|
-
commonlength = diff_commonSuffix(text_insert, text_delete);
|
|
329
|
-
if (commonlength !== 0) {
|
|
330
|
-
diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
|
|
331
|
-
text_insert = text_insert.substring(0, text_insert.length - commonlength);
|
|
332
|
-
text_delete = text_delete.substring(0, text_delete.length - commonlength);
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
pointer -= count_delete + count_insert;
|
|
336
|
-
diffs.splice(pointer, count_delete + count_insert);
|
|
337
|
-
if (text_delete.length) {
|
|
338
|
-
diffs.splice(pointer, 0, new Diff(DIFF_DELETE, text_delete));
|
|
339
|
-
pointer++;
|
|
340
|
-
}
|
|
341
|
-
if (text_insert.length) {
|
|
342
|
-
diffs.splice(pointer, 0, new Diff(DIFF_INSERT, text_insert));
|
|
343
|
-
pointer++;
|
|
344
|
-
}
|
|
345
|
-
pointer++;
|
|
346
|
-
} else if (pointer !== 0 && diffs[pointer - 1][0] === DIFF_EQUAL) {
|
|
347
|
-
diffs[pointer - 1][1] += diffs[pointer][1];
|
|
348
|
-
diffs.splice(pointer, 1);
|
|
349
|
-
} else {
|
|
350
|
-
pointer++;
|
|
351
|
-
}
|
|
352
|
-
count_insert = 0;
|
|
353
|
-
count_delete = 0;
|
|
354
|
-
text_delete = "";
|
|
355
|
-
text_insert = "";
|
|
356
|
-
break;
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
if (diffs[diffs.length - 1][1] === "") {
|
|
360
|
-
diffs.pop();
|
|
361
|
-
}
|
|
362
|
-
let changes = false;
|
|
363
|
-
pointer = 1;
|
|
364
|
-
while (pointer < diffs.length - 1) {
|
|
365
|
-
if (diffs[pointer - 1][0] === DIFF_EQUAL && diffs[pointer + 1][0] === DIFF_EQUAL) {
|
|
366
|
-
if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) === diffs[pointer - 1][1]) {
|
|
367
|
-
diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
|
|
368
|
-
diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
|
|
369
|
-
diffs.splice(pointer - 1, 1);
|
|
370
|
-
changes = true;
|
|
371
|
-
} else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) === diffs[pointer + 1][1]) {
|
|
372
|
-
diffs[pointer - 1][1] += diffs[pointer + 1][1];
|
|
373
|
-
diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
|
|
374
|
-
diffs.splice(pointer + 1, 1);
|
|
375
|
-
changes = true;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
pointer++;
|
|
379
|
-
}
|
|
380
|
-
if (changes) {
|
|
381
|
-
diff_cleanupMerge(diffs);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
/**
|
|
385
|
-
* Given two strings, compute a score representing whether the internal
|
|
386
|
-
* boundary falls on logical boundaries.
|
|
387
|
-
* Scores range from 6 (best) to 0 (worst).
|
|
388
|
-
* Closure, but does not reference any external variables.
|
|
389
|
-
* @param {string} one First string.
|
|
390
|
-
* @param {string} two Second string.
|
|
391
|
-
* @return {number} The score.
|
|
392
|
-
* @private
|
|
393
|
-
*/
|
|
394
|
-
function diff_cleanupSemanticScore_(one, two) {
|
|
395
|
-
if (!one || !two) {
|
|
396
|
-
return 6;
|
|
397
|
-
}
|
|
398
|
-
const char1 = one.charAt(one.length - 1);
|
|
399
|
-
const char2 = two.charAt(0);
|
|
400
|
-
const nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_);
|
|
401
|
-
const nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_);
|
|
402
|
-
const whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_);
|
|
403
|
-
const whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_);
|
|
404
|
-
const lineBreak1 = whitespace1 && char1.match(linebreakRegex_);
|
|
405
|
-
const lineBreak2 = whitespace2 && char2.match(linebreakRegex_);
|
|
406
|
-
const blankLine1 = lineBreak1 && one.match(blanklineEndRegex_);
|
|
407
|
-
const blankLine2 = lineBreak2 && two.match(blanklineStartRegex_);
|
|
408
|
-
if (blankLine1 || blankLine2) {
|
|
409
|
-
return 5;
|
|
410
|
-
} else if (lineBreak1 || lineBreak2) {
|
|
411
|
-
return 4;
|
|
412
|
-
} else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {
|
|
413
|
-
return 3;
|
|
414
|
-
} else if (whitespace1 || whitespace2) {
|
|
415
|
-
return 2;
|
|
416
|
-
} else if (nonAlphaNumeric1 || nonAlphaNumeric2) {
|
|
417
|
-
return 1;
|
|
418
|
-
}
|
|
419
|
-
return 0;
|
|
420
|
-
}
|
|
421
|
-
/**
|
|
422
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
423
|
-
*
|
|
424
|
-
* This source code is licensed under the MIT license found in the
|
|
425
|
-
* LICENSE file in the root directory of this source tree.
|
|
426
|
-
*/
|
|
427
|
-
const NO_DIFF_MESSAGE = "Compared values have no visual difference.";
|
|
428
|
-
const SIMILAR_MESSAGE = "Compared values serialize to the same structure.\n" + "Printing internal object structure without calling `toJSON` instead.";
|
|
429
|
-
var build = {};
|
|
430
|
-
var hasRequiredBuild;
|
|
431
|
-
function requireBuild() {
|
|
432
|
-
if (hasRequiredBuild) return build;
|
|
433
|
-
hasRequiredBuild = 1;
|
|
434
|
-
Object.defineProperty(build, "__esModule", { value: true });
|
|
435
|
-
build.default = diffSequence;
|
|
436
|
-
/**
|
|
437
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
438
|
-
*
|
|
439
|
-
* This source code is licensed under the MIT license found in the
|
|
440
|
-
* LICENSE file in the root directory of this source tree.
|
|
441
|
-
*
|
|
442
|
-
*/
|
|
443
|
-
const pkg = "diff-sequences";
|
|
444
|
-
const NOT_YET_SET = 0;
|
|
445
|
-
const countCommonItemsF = (aIndex, aEnd, bIndex, bEnd, isCommon) => {
|
|
446
|
-
let nCommon = 0;
|
|
447
|
-
while (aIndex < aEnd && bIndex < bEnd && isCommon(aIndex, bIndex)) {
|
|
448
|
-
aIndex += 1;
|
|
449
|
-
bIndex += 1;
|
|
450
|
-
nCommon += 1;
|
|
451
|
-
}
|
|
452
|
-
return nCommon;
|
|
453
|
-
};
|
|
454
|
-
const countCommonItemsR = (aStart, aIndex, bStart, bIndex, isCommon) => {
|
|
455
|
-
let nCommon = 0;
|
|
456
|
-
while (aStart <= aIndex && bStart <= bIndex && isCommon(aIndex, bIndex)) {
|
|
457
|
-
aIndex -= 1;
|
|
458
|
-
bIndex -= 1;
|
|
459
|
-
nCommon += 1;
|
|
460
|
-
}
|
|
461
|
-
return nCommon;
|
|
462
|
-
};
|
|
463
|
-
const extendPathsF = (d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF) => {
|
|
464
|
-
let iF = 0;
|
|
465
|
-
let kF = -d;
|
|
466
|
-
let aFirst = aIndexesF[iF];
|
|
467
|
-
let aIndexPrev1 = aFirst;
|
|
468
|
-
aIndexesF[iF] += countCommonItemsF(aFirst + 1, aEnd, bF + aFirst - kF + 1, bEnd, isCommon);
|
|
469
|
-
const nF = d < iMaxF ? d : iMaxF;
|
|
470
|
-
for (iF += 1, kF += 2; iF <= nF; iF += 1, kF += 2) {
|
|
471
|
-
if (iF !== d && aIndexPrev1 < aIndexesF[iF]) {
|
|
472
|
-
aFirst = aIndexesF[iF];
|
|
473
|
-
} else {
|
|
474
|
-
aFirst = aIndexPrev1 + 1;
|
|
475
|
-
if (aEnd <= aFirst) {
|
|
476
|
-
return iF - 1;
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
aIndexPrev1 = aIndexesF[iF];
|
|
480
|
-
aIndexesF[iF] = aFirst + countCommonItemsF(aFirst + 1, aEnd, bF + aFirst - kF + 1, bEnd, isCommon);
|
|
481
|
-
}
|
|
482
|
-
return iMaxF;
|
|
483
|
-
};
|
|
484
|
-
const extendPathsR = (d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR) => {
|
|
485
|
-
let iR = 0;
|
|
486
|
-
let kR = d;
|
|
487
|
-
let aFirst = aIndexesR[iR];
|
|
488
|
-
let aIndexPrev1 = aFirst;
|
|
489
|
-
aIndexesR[iR] -= countCommonItemsR(aStart, aFirst - 1, bStart, bR + aFirst - kR - 1, isCommon);
|
|
490
|
-
const nR = d < iMaxR ? d : iMaxR;
|
|
491
|
-
for (iR += 1, kR -= 2; iR <= nR; iR += 1, kR -= 2) {
|
|
492
|
-
if (iR !== d && aIndexesR[iR] < aIndexPrev1) {
|
|
493
|
-
aFirst = aIndexesR[iR];
|
|
494
|
-
} else {
|
|
495
|
-
aFirst = aIndexPrev1 - 1;
|
|
496
|
-
if (aFirst < aStart) {
|
|
497
|
-
return iR - 1;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
aIndexPrev1 = aIndexesR[iR];
|
|
501
|
-
aIndexesR[iR] = aFirst - countCommonItemsR(aStart, aFirst - 1, bStart, bR + aFirst - kR - 1, isCommon);
|
|
502
|
-
}
|
|
503
|
-
return iMaxR;
|
|
504
|
-
};
|
|
505
|
-
const extendOverlappablePathsF = (d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division) => {
|
|
506
|
-
const bF = bStart - aStart;
|
|
507
|
-
const aLength = aEnd - aStart;
|
|
508
|
-
const bLength = bEnd - bStart;
|
|
509
|
-
const baDeltaLength = bLength - aLength;
|
|
510
|
-
const kMinOverlapF = -baDeltaLength - (d - 1);
|
|
511
|
-
const kMaxOverlapF = -baDeltaLength + (d - 1);
|
|
512
|
-
let aIndexPrev1 = NOT_YET_SET;
|
|
513
|
-
const nF = d < iMaxF ? d : iMaxF;
|
|
514
|
-
for (let iF = 0, kF = -d; iF <= nF; iF += 1, kF += 2) {
|
|
515
|
-
const insert = iF === 0 || iF !== d && aIndexPrev1 < aIndexesF[iF];
|
|
516
|
-
const aLastPrev = insert ? aIndexesF[iF] : aIndexPrev1;
|
|
517
|
-
const aFirst = insert ? aLastPrev : aLastPrev + 1;
|
|
518
|
-
const bFirst = bF + aFirst - kF;
|
|
519
|
-
const nCommonF = countCommonItemsF(aFirst + 1, aEnd, bFirst + 1, bEnd, isCommon);
|
|
520
|
-
const aLast = aFirst + nCommonF;
|
|
521
|
-
aIndexPrev1 = aIndexesF[iF];
|
|
522
|
-
aIndexesF[iF] = aLast;
|
|
523
|
-
if (kMinOverlapF <= kF && kF <= kMaxOverlapF) {
|
|
524
|
-
const iR = (d - 1 - (kF + baDeltaLength)) / 2;
|
|
525
|
-
if (iR <= iMaxR && aIndexesR[iR] - 1 <= aLast) {
|
|
526
|
-
const bLastPrev = bF + aLastPrev - (insert ? kF + 1 : kF - 1);
|
|
527
|
-
const nCommonR = countCommonItemsR(aStart, aLastPrev, bStart, bLastPrev, isCommon);
|
|
528
|
-
const aIndexPrevFirst = aLastPrev - nCommonR;
|
|
529
|
-
const bIndexPrevFirst = bLastPrev - nCommonR;
|
|
530
|
-
const aEndPreceding = aIndexPrevFirst + 1;
|
|
531
|
-
const bEndPreceding = bIndexPrevFirst + 1;
|
|
532
|
-
division.nChangePreceding = d - 1;
|
|
533
|
-
if (d - 1 === aEndPreceding + bEndPreceding - aStart - bStart) {
|
|
534
|
-
division.aEndPreceding = aStart;
|
|
535
|
-
division.bEndPreceding = bStart;
|
|
536
|
-
} else {
|
|
537
|
-
division.aEndPreceding = aEndPreceding;
|
|
538
|
-
division.bEndPreceding = bEndPreceding;
|
|
539
|
-
}
|
|
540
|
-
division.nCommonPreceding = nCommonR;
|
|
541
|
-
if (nCommonR !== 0) {
|
|
542
|
-
division.aCommonPreceding = aEndPreceding;
|
|
543
|
-
division.bCommonPreceding = bEndPreceding;
|
|
544
|
-
}
|
|
545
|
-
division.nCommonFollowing = nCommonF;
|
|
546
|
-
if (nCommonF !== 0) {
|
|
547
|
-
division.aCommonFollowing = aFirst + 1;
|
|
548
|
-
division.bCommonFollowing = bFirst + 1;
|
|
549
|
-
}
|
|
550
|
-
const aStartFollowing = aLast + 1;
|
|
551
|
-
const bStartFollowing = bFirst + nCommonF + 1;
|
|
552
|
-
division.nChangeFollowing = d - 1;
|
|
553
|
-
if (d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing) {
|
|
554
|
-
division.aStartFollowing = aEnd;
|
|
555
|
-
division.bStartFollowing = bEnd;
|
|
556
|
-
} else {
|
|
557
|
-
division.aStartFollowing = aStartFollowing;
|
|
558
|
-
division.bStartFollowing = bStartFollowing;
|
|
559
|
-
}
|
|
560
|
-
return true;
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
return false;
|
|
565
|
-
};
|
|
566
|
-
const extendOverlappablePathsR = (d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division) => {
|
|
567
|
-
const bR = bEnd - aEnd;
|
|
568
|
-
const aLength = aEnd - aStart;
|
|
569
|
-
const bLength = bEnd - bStart;
|
|
570
|
-
const baDeltaLength = bLength - aLength;
|
|
571
|
-
const kMinOverlapR = baDeltaLength - d;
|
|
572
|
-
const kMaxOverlapR = baDeltaLength + d;
|
|
573
|
-
let aIndexPrev1 = NOT_YET_SET;
|
|
574
|
-
const nR = d < iMaxR ? d : iMaxR;
|
|
575
|
-
for (let iR = 0, kR = d; iR <= nR; iR += 1, kR -= 2) {
|
|
576
|
-
const insert = iR === 0 || iR !== d && aIndexesR[iR] < aIndexPrev1;
|
|
577
|
-
const aLastPrev = insert ? aIndexesR[iR] : aIndexPrev1;
|
|
578
|
-
const aFirst = insert ? aLastPrev : aLastPrev - 1;
|
|
579
|
-
const bFirst = bR + aFirst - kR;
|
|
580
|
-
const nCommonR = countCommonItemsR(aStart, aFirst - 1, bStart, bFirst - 1, isCommon);
|
|
581
|
-
const aLast = aFirst - nCommonR;
|
|
582
|
-
aIndexPrev1 = aIndexesR[iR];
|
|
583
|
-
aIndexesR[iR] = aLast;
|
|
584
|
-
if (kMinOverlapR <= kR && kR <= kMaxOverlapR) {
|
|
585
|
-
const iF = (d + (kR - baDeltaLength)) / 2;
|
|
586
|
-
if (iF <= iMaxF && aLast - 1 <= aIndexesF[iF]) {
|
|
587
|
-
const bLast = bFirst - nCommonR;
|
|
588
|
-
division.nChangePreceding = d;
|
|
589
|
-
if (d === aLast + bLast - aStart - bStart) {
|
|
590
|
-
division.aEndPreceding = aStart;
|
|
591
|
-
division.bEndPreceding = bStart;
|
|
592
|
-
} else {
|
|
593
|
-
division.aEndPreceding = aLast;
|
|
594
|
-
division.bEndPreceding = bLast;
|
|
595
|
-
}
|
|
596
|
-
division.nCommonPreceding = nCommonR;
|
|
597
|
-
if (nCommonR !== 0) {
|
|
598
|
-
division.aCommonPreceding = aLast;
|
|
599
|
-
division.bCommonPreceding = bLast;
|
|
600
|
-
}
|
|
601
|
-
division.nChangeFollowing = d - 1;
|
|
602
|
-
if (d === 1) {
|
|
603
|
-
division.nCommonFollowing = 0;
|
|
604
|
-
division.aStartFollowing = aEnd;
|
|
605
|
-
division.bStartFollowing = bEnd;
|
|
606
|
-
} else {
|
|
607
|
-
const bLastPrev = bR + aLastPrev - (insert ? kR - 1 : kR + 1);
|
|
608
|
-
const nCommonF = countCommonItemsF(aLastPrev, aEnd, bLastPrev, bEnd, isCommon);
|
|
609
|
-
division.nCommonFollowing = nCommonF;
|
|
610
|
-
if (nCommonF !== 0) {
|
|
611
|
-
division.aCommonFollowing = aLastPrev;
|
|
612
|
-
division.bCommonFollowing = bLastPrev;
|
|
613
|
-
}
|
|
614
|
-
const aStartFollowing = aLastPrev + nCommonF;
|
|
615
|
-
const bStartFollowing = bLastPrev + nCommonF;
|
|
616
|
-
if (d - 1 === aEnd + bEnd - aStartFollowing - bStartFollowing) {
|
|
617
|
-
division.aStartFollowing = aEnd;
|
|
618
|
-
division.bStartFollowing = bEnd;
|
|
619
|
-
} else {
|
|
620
|
-
division.aStartFollowing = aStartFollowing;
|
|
621
|
-
division.bStartFollowing = bStartFollowing;
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
return true;
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
return false;
|
|
629
|
-
};
|
|
630
|
-
const divide = (nChange, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, aIndexesR, division) => {
|
|
631
|
-
const bF = bStart - aStart;
|
|
632
|
-
const bR = bEnd - aEnd;
|
|
633
|
-
const aLength = aEnd - aStart;
|
|
634
|
-
const bLength = bEnd - bStart;
|
|
635
|
-
const baDeltaLength = bLength - aLength;
|
|
636
|
-
let iMaxF = aLength;
|
|
637
|
-
let iMaxR = aLength;
|
|
638
|
-
aIndexesF[0] = aStart - 1;
|
|
639
|
-
aIndexesR[0] = aEnd;
|
|
640
|
-
if (baDeltaLength % 2 === 0) {
|
|
641
|
-
const dMin = (nChange || baDeltaLength) / 2;
|
|
642
|
-
const dMax = (aLength + bLength) / 2;
|
|
643
|
-
for (let d = 1; d <= dMax; d += 1) {
|
|
644
|
-
iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
|
|
645
|
-
if (d < dMin) {
|
|
646
|
-
iMaxR = extendPathsR(d, aStart, bStart, bR, isCommon, aIndexesR, iMaxR);
|
|
647
|
-
} else if (extendOverlappablePathsR(d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division)) {
|
|
648
|
-
return;
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
} else {
|
|
652
|
-
const dMin = ((nChange || baDeltaLength) + 1) / 2;
|
|
653
|
-
const dMax = (aLength + bLength + 1) / 2;
|
|
654
|
-
let d = 1;
|
|
655
|
-
iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
|
|
656
|
-
for (d += 1; d <= dMax; d += 1) {
|
|
657
|
-
iMaxR = extendPathsR(d - 1, aStart, bStart, bR, isCommon, aIndexesR, iMaxR);
|
|
658
|
-
if (d < dMin) {
|
|
659
|
-
iMaxF = extendPathsF(d, aEnd, bEnd, bF, isCommon, aIndexesF, iMaxF);
|
|
660
|
-
} else if (extendOverlappablePathsF(d, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, iMaxF, aIndexesR, iMaxR, division)) {
|
|
661
|
-
return;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
/* istanbul ignore next */
|
|
666
|
-
throw new Error(`${pkg}: no overlap aStart=${aStart} aEnd=${aEnd} bStart=${bStart} bEnd=${bEnd}`);
|
|
667
|
-
};
|
|
668
|
-
const findSubsequences = (nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division) => {
|
|
669
|
-
if (bEnd - bStart < aEnd - aStart) {
|
|
670
|
-
transposed = !transposed;
|
|
671
|
-
if (transposed && callbacks.length === 1) {
|
|
672
|
-
const { foundSubsequence: foundSubsequence$1, isCommon: isCommon$1 } = callbacks[0];
|
|
673
|
-
callbacks[1] = {
|
|
674
|
-
foundSubsequence: (nCommon, bCommon, aCommon) => {
|
|
675
|
-
foundSubsequence$1(nCommon, aCommon, bCommon);
|
|
676
|
-
},
|
|
677
|
-
isCommon: (bIndex, aIndex) => isCommon$1(aIndex, bIndex)
|
|
678
|
-
};
|
|
679
|
-
}
|
|
680
|
-
const tStart = aStart;
|
|
681
|
-
const tEnd = aEnd;
|
|
682
|
-
aStart = bStart;
|
|
683
|
-
aEnd = bEnd;
|
|
684
|
-
bStart = tStart;
|
|
685
|
-
bEnd = tEnd;
|
|
686
|
-
}
|
|
687
|
-
const { foundSubsequence, isCommon } = callbacks[transposed ? 1 : 0];
|
|
688
|
-
divide(nChange, aStart, aEnd, bStart, bEnd, isCommon, aIndexesF, aIndexesR, division);
|
|
689
|
-
const { nChangePreceding, aEndPreceding, bEndPreceding, nCommonPreceding, aCommonPreceding, bCommonPreceding, nCommonFollowing, aCommonFollowing, bCommonFollowing, nChangeFollowing, aStartFollowing, bStartFollowing } = division;
|
|
690
|
-
if (aStart < aEndPreceding && bStart < bEndPreceding) {
|
|
691
|
-
findSubsequences(nChangePreceding, aStart, aEndPreceding, bStart, bEndPreceding, transposed, callbacks, aIndexesF, aIndexesR, division);
|
|
692
|
-
}
|
|
693
|
-
if (nCommonPreceding !== 0) {
|
|
694
|
-
foundSubsequence(nCommonPreceding, aCommonPreceding, bCommonPreceding);
|
|
695
|
-
}
|
|
696
|
-
if (nCommonFollowing !== 0) {
|
|
697
|
-
foundSubsequence(nCommonFollowing, aCommonFollowing, bCommonFollowing);
|
|
698
|
-
}
|
|
699
|
-
if (aStartFollowing < aEnd && bStartFollowing < bEnd) {
|
|
700
|
-
findSubsequences(nChangeFollowing, aStartFollowing, aEnd, bStartFollowing, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division);
|
|
701
|
-
}
|
|
702
|
-
};
|
|
703
|
-
const validateLength = (name, arg) => {
|
|
704
|
-
if (typeof arg !== "number") {
|
|
705
|
-
throw new TypeError(`${pkg}: ${name} typeof ${typeof arg} is not a number`);
|
|
706
|
-
}
|
|
707
|
-
if (!Number.isSafeInteger(arg)) {
|
|
708
|
-
throw new RangeError(`${pkg}: ${name} value ${arg} is not a safe integer`);
|
|
709
|
-
}
|
|
710
|
-
if (arg < 0) {
|
|
711
|
-
throw new RangeError(`${pkg}: ${name} value ${arg} is a negative integer`);
|
|
712
|
-
}
|
|
713
|
-
};
|
|
714
|
-
const validateCallback = (name, arg) => {
|
|
715
|
-
const type = typeof arg;
|
|
716
|
-
if (type !== "function") {
|
|
717
|
-
throw new TypeError(`${pkg}: ${name} typeof ${type} is not a function`);
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
function diffSequence(aLength, bLength, isCommon, foundSubsequence) {
|
|
721
|
-
validateLength("aLength", aLength);
|
|
722
|
-
validateLength("bLength", bLength);
|
|
723
|
-
validateCallback("isCommon", isCommon);
|
|
724
|
-
validateCallback("foundSubsequence", foundSubsequence);
|
|
725
|
-
const nCommonF = countCommonItemsF(0, aLength, 0, bLength, isCommon);
|
|
726
|
-
if (nCommonF !== 0) {
|
|
727
|
-
foundSubsequence(nCommonF, 0, 0);
|
|
728
|
-
}
|
|
729
|
-
if (aLength !== nCommonF || bLength !== nCommonF) {
|
|
730
|
-
const aStart = nCommonF;
|
|
731
|
-
const bStart = nCommonF;
|
|
732
|
-
const nCommonR = countCommonItemsR(aStart, aLength - 1, bStart, bLength - 1, isCommon);
|
|
733
|
-
const aEnd = aLength - nCommonR;
|
|
734
|
-
const bEnd = bLength - nCommonR;
|
|
735
|
-
const nCommonFR = nCommonF + nCommonR;
|
|
736
|
-
if (aLength !== nCommonFR && bLength !== nCommonFR) {
|
|
737
|
-
const nChange = 0;
|
|
738
|
-
const transposed = false;
|
|
739
|
-
const callbacks = [{
|
|
740
|
-
foundSubsequence,
|
|
741
|
-
isCommon
|
|
742
|
-
}];
|
|
743
|
-
const aIndexesF = [NOT_YET_SET];
|
|
744
|
-
const aIndexesR = [NOT_YET_SET];
|
|
745
|
-
const division = {
|
|
746
|
-
aCommonFollowing: NOT_YET_SET,
|
|
747
|
-
aCommonPreceding: NOT_YET_SET,
|
|
748
|
-
aEndPreceding: NOT_YET_SET,
|
|
749
|
-
aStartFollowing: NOT_YET_SET,
|
|
750
|
-
bCommonFollowing: NOT_YET_SET,
|
|
751
|
-
bCommonPreceding: NOT_YET_SET,
|
|
752
|
-
bEndPreceding: NOT_YET_SET,
|
|
753
|
-
bStartFollowing: NOT_YET_SET,
|
|
754
|
-
nChangeFollowing: NOT_YET_SET,
|
|
755
|
-
nChangePreceding: NOT_YET_SET,
|
|
756
|
-
nCommonFollowing: NOT_YET_SET,
|
|
757
|
-
nCommonPreceding: NOT_YET_SET
|
|
758
|
-
};
|
|
759
|
-
findSubsequences(nChange, aStart, aEnd, bStart, bEnd, transposed, callbacks, aIndexesF, aIndexesR, division);
|
|
760
|
-
}
|
|
761
|
-
if (nCommonR !== 0) {
|
|
762
|
-
foundSubsequence(nCommonR, aEnd, bEnd);
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
return build;
|
|
767
|
-
}
|
|
768
|
-
var buildExports = requireBuild();
|
|
769
|
-
var diffSequences = /* @__PURE__ */ getDefaultExportFromCjs(buildExports);
|
|
770
|
-
function formatTrailingSpaces(line, trailingSpaceFormatter) {
|
|
771
|
-
return line.replace(/\s+$/, (match) => trailingSpaceFormatter(match));
|
|
772
|
-
}
|
|
773
|
-
function printDiffLine(line, isFirstOrLast, color, indicator, trailingSpaceFormatter, emptyFirstOrLastLinePlaceholder) {
|
|
774
|
-
return line.length !== 0 ? color(`${indicator} ${formatTrailingSpaces(line, trailingSpaceFormatter)}`) : indicator !== " " ? color(indicator) : isFirstOrLast && emptyFirstOrLastLinePlaceholder.length !== 0 ? color(`${indicator} ${emptyFirstOrLastLinePlaceholder}`) : "";
|
|
775
|
-
}
|
|
776
|
-
function printDeleteLine(line, isFirstOrLast, { aColor, aIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder }) {
|
|
777
|
-
return printDiffLine(line, isFirstOrLast, aColor, aIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
|
|
778
|
-
}
|
|
779
|
-
function printInsertLine(line, isFirstOrLast, { bColor, bIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder }) {
|
|
780
|
-
return printDiffLine(line, isFirstOrLast, bColor, bIndicator, changeLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
|
|
781
|
-
}
|
|
782
|
-
function printCommonLine(line, isFirstOrLast, { commonColor, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder }) {
|
|
783
|
-
return printDiffLine(line, isFirstOrLast, commonColor, commonIndicator, commonLineTrailingSpaceColor, emptyFirstOrLastLinePlaceholder);
|
|
784
|
-
}
|
|
785
|
-
function createPatchMark(aStart, aEnd, bStart, bEnd, { patchColor }) {
|
|
786
|
-
return patchColor(`@@ -${aStart + 1},${aEnd - aStart} +${bStart + 1},${bEnd - bStart} @@`);
|
|
787
|
-
}
|
|
788
|
-
function joinAlignedDiffsNoExpand(diffs, options) {
|
|
789
|
-
const iLength = diffs.length;
|
|
790
|
-
const nContextLines = options.contextLines;
|
|
791
|
-
const nContextLines2 = nContextLines + nContextLines;
|
|
792
|
-
let jLength = iLength;
|
|
793
|
-
let hasExcessAtStartOrEnd = false;
|
|
794
|
-
let nExcessesBetweenChanges = 0;
|
|
795
|
-
let i = 0;
|
|
796
|
-
while (i !== iLength) {
|
|
797
|
-
const iStart = i;
|
|
798
|
-
while (i !== iLength && diffs[i][0] === DIFF_EQUAL) {
|
|
799
|
-
i += 1;
|
|
800
|
-
}
|
|
801
|
-
if (iStart !== i) {
|
|
802
|
-
if (iStart === 0) {
|
|
803
|
-
if (i > nContextLines) {
|
|
804
|
-
jLength -= i - nContextLines;
|
|
805
|
-
hasExcessAtStartOrEnd = true;
|
|
806
|
-
}
|
|
807
|
-
} else if (i === iLength) {
|
|
808
|
-
const n = i - iStart;
|
|
809
|
-
if (n > nContextLines) {
|
|
810
|
-
jLength -= n - nContextLines;
|
|
811
|
-
hasExcessAtStartOrEnd = true;
|
|
812
|
-
}
|
|
813
|
-
} else {
|
|
814
|
-
const n = i - iStart;
|
|
815
|
-
if (n > nContextLines2) {
|
|
816
|
-
jLength -= n - nContextLines2;
|
|
817
|
-
nExcessesBetweenChanges += 1;
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
while (i !== iLength && diffs[i][0] !== DIFF_EQUAL) {
|
|
822
|
-
i += 1;
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
const hasPatch = nExcessesBetweenChanges !== 0 || hasExcessAtStartOrEnd;
|
|
826
|
-
if (nExcessesBetweenChanges !== 0) {
|
|
827
|
-
jLength += nExcessesBetweenChanges + 1;
|
|
828
|
-
} else if (hasExcessAtStartOrEnd) {
|
|
829
|
-
jLength += 1;
|
|
830
|
-
}
|
|
831
|
-
const jLast = jLength - 1;
|
|
832
|
-
const lines = [];
|
|
833
|
-
let jPatchMark = 0;
|
|
834
|
-
if (hasPatch) {
|
|
835
|
-
lines.push("");
|
|
836
|
-
}
|
|
837
|
-
let aStart = 0;
|
|
838
|
-
let bStart = 0;
|
|
839
|
-
let aEnd = 0;
|
|
840
|
-
let bEnd = 0;
|
|
841
|
-
const pushCommonLine = (line) => {
|
|
842
|
-
const j = lines.length;
|
|
843
|
-
lines.push(printCommonLine(line, j === 0 || j === jLast, options));
|
|
844
|
-
aEnd += 1;
|
|
845
|
-
bEnd += 1;
|
|
846
|
-
};
|
|
847
|
-
const pushDeleteLine = (line) => {
|
|
848
|
-
const j = lines.length;
|
|
849
|
-
lines.push(printDeleteLine(line, j === 0 || j === jLast, options));
|
|
850
|
-
aEnd += 1;
|
|
851
|
-
};
|
|
852
|
-
const pushInsertLine = (line) => {
|
|
853
|
-
const j = lines.length;
|
|
854
|
-
lines.push(printInsertLine(line, j === 0 || j === jLast, options));
|
|
855
|
-
bEnd += 1;
|
|
856
|
-
};
|
|
857
|
-
i = 0;
|
|
858
|
-
while (i !== iLength) {
|
|
859
|
-
let iStart = i;
|
|
860
|
-
while (i !== iLength && diffs[i][0] === DIFF_EQUAL) {
|
|
861
|
-
i += 1;
|
|
862
|
-
}
|
|
863
|
-
if (iStart !== i) {
|
|
864
|
-
if (iStart === 0) {
|
|
865
|
-
if (i > nContextLines) {
|
|
866
|
-
iStart = i - nContextLines;
|
|
867
|
-
aStart = iStart;
|
|
868
|
-
bStart = iStart;
|
|
869
|
-
aEnd = aStart;
|
|
870
|
-
bEnd = bStart;
|
|
871
|
-
}
|
|
872
|
-
for (let iCommon = iStart; iCommon !== i; iCommon += 1) {
|
|
873
|
-
pushCommonLine(diffs[iCommon][1]);
|
|
874
|
-
}
|
|
875
|
-
} else if (i === iLength) {
|
|
876
|
-
const iEnd = i - iStart > nContextLines ? iStart + nContextLines : i;
|
|
877
|
-
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) {
|
|
878
|
-
pushCommonLine(diffs[iCommon][1]);
|
|
879
|
-
}
|
|
880
|
-
} else {
|
|
881
|
-
const nCommon = i - iStart;
|
|
882
|
-
if (nCommon > nContextLines2) {
|
|
883
|
-
const iEnd = iStart + nContextLines;
|
|
884
|
-
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) {
|
|
885
|
-
pushCommonLine(diffs[iCommon][1]);
|
|
886
|
-
}
|
|
887
|
-
lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options);
|
|
888
|
-
jPatchMark = lines.length;
|
|
889
|
-
lines.push("");
|
|
890
|
-
const nOmit = nCommon - nContextLines2;
|
|
891
|
-
aStart = aEnd + nOmit;
|
|
892
|
-
bStart = bEnd + nOmit;
|
|
893
|
-
aEnd = aStart;
|
|
894
|
-
bEnd = bStart;
|
|
895
|
-
for (let iCommon = i - nContextLines; iCommon !== i; iCommon += 1) {
|
|
896
|
-
pushCommonLine(diffs[iCommon][1]);
|
|
897
|
-
}
|
|
898
|
-
} else {
|
|
899
|
-
for (let iCommon = iStart; iCommon !== i; iCommon += 1) {
|
|
900
|
-
pushCommonLine(diffs[iCommon][1]);
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
while (i !== iLength && diffs[i][0] === DIFF_DELETE) {
|
|
906
|
-
pushDeleteLine(diffs[i][1]);
|
|
907
|
-
i += 1;
|
|
908
|
-
}
|
|
909
|
-
while (i !== iLength && diffs[i][0] === DIFF_INSERT) {
|
|
910
|
-
pushInsertLine(diffs[i][1]);
|
|
911
|
-
i += 1;
|
|
912
|
-
}
|
|
913
|
-
}
|
|
914
|
-
if (hasPatch) {
|
|
915
|
-
lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options);
|
|
916
|
-
}
|
|
917
|
-
return lines.join("\n");
|
|
918
|
-
}
|
|
919
|
-
function joinAlignedDiffsExpand(diffs, options) {
|
|
920
|
-
return diffs.map((diff$1, i, diffs$1) => {
|
|
921
|
-
const line = diff$1[1];
|
|
922
|
-
const isFirstOrLast = i === 0 || i === diffs$1.length - 1;
|
|
923
|
-
switch (diff$1[0]) {
|
|
924
|
-
case DIFF_DELETE: return printDeleteLine(line, isFirstOrLast, options);
|
|
925
|
-
case DIFF_INSERT: return printInsertLine(line, isFirstOrLast, options);
|
|
926
|
-
default: return printCommonLine(line, isFirstOrLast, options);
|
|
927
|
-
}
|
|
928
|
-
}).join("\n");
|
|
929
|
-
}
|
|
930
|
-
const noColor = (string) => string;
|
|
931
|
-
const DIFF_CONTEXT_DEFAULT = 5;
|
|
932
|
-
const DIFF_TRUNCATE_THRESHOLD_DEFAULT = 0;
|
|
933
|
-
function getDefaultOptions() {
|
|
934
|
-
return {
|
|
935
|
-
aAnnotation: "Expected",
|
|
936
|
-
aColor: u.green,
|
|
937
|
-
aIndicator: "-",
|
|
938
|
-
bAnnotation: "Received",
|
|
939
|
-
bColor: u.red,
|
|
940
|
-
bIndicator: "+",
|
|
941
|
-
changeColor: u.inverse,
|
|
942
|
-
changeLineTrailingSpaceColor: noColor,
|
|
943
|
-
commonColor: u.dim,
|
|
944
|
-
commonIndicator: " ",
|
|
945
|
-
commonLineTrailingSpaceColor: noColor,
|
|
946
|
-
compareKeys: undefined,
|
|
947
|
-
contextLines: DIFF_CONTEXT_DEFAULT,
|
|
948
|
-
emptyFirstOrLastLinePlaceholder: "",
|
|
949
|
-
expand: false,
|
|
950
|
-
includeChangeCounts: false,
|
|
951
|
-
omitAnnotationLines: false,
|
|
952
|
-
patchColor: u.yellow,
|
|
953
|
-
printBasicPrototype: false,
|
|
954
|
-
truncateThreshold: DIFF_TRUNCATE_THRESHOLD_DEFAULT,
|
|
955
|
-
truncateAnnotation: "... Diff result is truncated",
|
|
956
|
-
truncateAnnotationColor: noColor
|
|
957
|
-
};
|
|
958
|
-
}
|
|
959
|
-
function getCompareKeys(compareKeys) {
|
|
960
|
-
return compareKeys && typeof compareKeys === "function" ? compareKeys : undefined;
|
|
961
|
-
}
|
|
962
|
-
function getContextLines(contextLines) {
|
|
963
|
-
return typeof contextLines === "number" && Number.isSafeInteger(contextLines) && contextLines >= 0 ? contextLines : DIFF_CONTEXT_DEFAULT;
|
|
964
|
-
}
|
|
965
|
-
function normalizeDiffOptions(options = {}) {
|
|
966
|
-
return {
|
|
967
|
-
...getDefaultOptions(),
|
|
968
|
-
...options,
|
|
969
|
-
compareKeys: getCompareKeys(options.compareKeys),
|
|
970
|
-
contextLines: getContextLines(options.contextLines)
|
|
971
|
-
};
|
|
972
|
-
}
|
|
973
|
-
function isEmptyString(lines) {
|
|
974
|
-
return lines.length === 1 && lines[0].length === 0;
|
|
975
|
-
}
|
|
976
|
-
function countChanges(diffs) {
|
|
977
|
-
let a = 0;
|
|
978
|
-
let b = 0;
|
|
979
|
-
diffs.forEach((diff$1) => {
|
|
980
|
-
switch (diff$1[0]) {
|
|
981
|
-
case DIFF_DELETE:
|
|
982
|
-
a += 1;
|
|
983
|
-
break;
|
|
984
|
-
case DIFF_INSERT:
|
|
985
|
-
b += 1;
|
|
986
|
-
break;
|
|
987
|
-
}
|
|
988
|
-
});
|
|
989
|
-
return {
|
|
990
|
-
a,
|
|
991
|
-
b
|
|
992
|
-
};
|
|
993
|
-
}
|
|
994
|
-
function printAnnotation({ aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator, includeChangeCounts, omitAnnotationLines }, changeCounts) {
|
|
995
|
-
if (omitAnnotationLines) {
|
|
996
|
-
return "";
|
|
997
|
-
}
|
|
998
|
-
let aRest = "";
|
|
999
|
-
let bRest = "";
|
|
1000
|
-
if (includeChangeCounts) {
|
|
1001
|
-
const aCount = String(changeCounts.a);
|
|
1002
|
-
const bCount = String(changeCounts.b);
|
|
1003
|
-
const baAnnotationLengthDiff = bAnnotation.length - aAnnotation.length;
|
|
1004
|
-
const aAnnotationPadding = " ".repeat(Math.max(0, baAnnotationLengthDiff));
|
|
1005
|
-
const bAnnotationPadding = " ".repeat(Math.max(0, -baAnnotationLengthDiff));
|
|
1006
|
-
const baCountLengthDiff = bCount.length - aCount.length;
|
|
1007
|
-
const aCountPadding = " ".repeat(Math.max(0, baCountLengthDiff));
|
|
1008
|
-
const bCountPadding = " ".repeat(Math.max(0, -baCountLengthDiff));
|
|
1009
|
-
aRest = `${aAnnotationPadding} ${aIndicator} ${aCountPadding}${aCount}`;
|
|
1010
|
-
bRest = `${bAnnotationPadding} ${bIndicator} ${bCountPadding}${bCount}`;
|
|
1011
|
-
}
|
|
1012
|
-
const a = `${aIndicator} ${aAnnotation}${aRest}`;
|
|
1013
|
-
const b = `${bIndicator} ${bAnnotation}${bRest}`;
|
|
1014
|
-
return `${aColor(a)}\n${bColor(b)}\n\n`;
|
|
1015
|
-
}
|
|
1016
|
-
function printDiffLines(diffs, truncated, options) {
|
|
1017
|
-
return printAnnotation(options, countChanges(diffs)) + (options.expand ? joinAlignedDiffsExpand(diffs, options) : joinAlignedDiffsNoExpand(diffs, options)) + (truncated ? options.truncateAnnotationColor(`\n${options.truncateAnnotation}`) : "");
|
|
1018
|
-
}
|
|
1019
|
-
function diffLinesUnified(aLines, bLines, options) {
|
|
1020
|
-
const normalizedOptions = normalizeDiffOptions(options);
|
|
1021
|
-
const [diffs, truncated] = diffLinesRaw(isEmptyString(aLines) ? [] : aLines, isEmptyString(bLines) ? [] : bLines, normalizedOptions);
|
|
1022
|
-
return printDiffLines(diffs, truncated, normalizedOptions);
|
|
1023
|
-
}
|
|
1024
|
-
function diffLinesUnified2(aLinesDisplay, bLinesDisplay, aLinesCompare, bLinesCompare, options) {
|
|
1025
|
-
if (isEmptyString(aLinesDisplay) && isEmptyString(aLinesCompare)) {
|
|
1026
|
-
aLinesDisplay = [];
|
|
1027
|
-
aLinesCompare = [];
|
|
1028
|
-
}
|
|
1029
|
-
if (isEmptyString(bLinesDisplay) && isEmptyString(bLinesCompare)) {
|
|
1030
|
-
bLinesDisplay = [];
|
|
1031
|
-
bLinesCompare = [];
|
|
1032
|
-
}
|
|
1033
|
-
if (aLinesDisplay.length !== aLinesCompare.length || bLinesDisplay.length !== bLinesCompare.length) {
|
|
1034
|
-
return diffLinesUnified(aLinesDisplay, bLinesDisplay, options);
|
|
1035
|
-
}
|
|
1036
|
-
const [diffs, truncated] = diffLinesRaw(aLinesCompare, bLinesCompare, options);
|
|
1037
|
-
let aIndex = 0;
|
|
1038
|
-
let bIndex = 0;
|
|
1039
|
-
diffs.forEach((diff$1) => {
|
|
1040
|
-
switch (diff$1[0]) {
|
|
1041
|
-
case DIFF_DELETE:
|
|
1042
|
-
diff$1[1] = aLinesDisplay[aIndex];
|
|
1043
|
-
aIndex += 1;
|
|
1044
|
-
break;
|
|
1045
|
-
case DIFF_INSERT:
|
|
1046
|
-
diff$1[1] = bLinesDisplay[bIndex];
|
|
1047
|
-
bIndex += 1;
|
|
1048
|
-
break;
|
|
1049
|
-
default:
|
|
1050
|
-
diff$1[1] = bLinesDisplay[bIndex];
|
|
1051
|
-
aIndex += 1;
|
|
1052
|
-
bIndex += 1;
|
|
1053
|
-
}
|
|
1054
|
-
});
|
|
1055
|
-
return printDiffLines(diffs, truncated, normalizeDiffOptions(options));
|
|
1056
|
-
}
|
|
1057
|
-
function diffLinesRaw(aLines, bLines, options) {
|
|
1058
|
-
const truncate = (options === null || options === void 0 ? void 0 : options.truncateThreshold) ?? false;
|
|
1059
|
-
const truncateThreshold = Math.max(Math.floor((options === null || options === void 0 ? void 0 : options.truncateThreshold) ?? 0), 0);
|
|
1060
|
-
const aLength = truncate ? Math.min(aLines.length, truncateThreshold) : aLines.length;
|
|
1061
|
-
const bLength = truncate ? Math.min(bLines.length, truncateThreshold) : bLines.length;
|
|
1062
|
-
const truncated = aLength !== aLines.length || bLength !== bLines.length;
|
|
1063
|
-
const isCommon = (aIndex$1, bIndex$1) => aLines[aIndex$1] === bLines[bIndex$1];
|
|
1064
|
-
const diffs = [];
|
|
1065
|
-
let aIndex = 0;
|
|
1066
|
-
let bIndex = 0;
|
|
1067
|
-
const foundSubsequence = (nCommon, aCommon, bCommon) => {
|
|
1068
|
-
for (; aIndex !== aCommon; aIndex += 1) {
|
|
1069
|
-
diffs.push(new Diff(DIFF_DELETE, aLines[aIndex]));
|
|
1070
|
-
}
|
|
1071
|
-
for (; bIndex !== bCommon; bIndex += 1) {
|
|
1072
|
-
diffs.push(new Diff(DIFF_INSERT, bLines[bIndex]));
|
|
1073
|
-
}
|
|
1074
|
-
for (; nCommon !== 0; nCommon -= 1, aIndex += 1, bIndex += 1) {
|
|
1075
|
-
diffs.push(new Diff(DIFF_EQUAL, bLines[bIndex]));
|
|
1076
|
-
}
|
|
1077
|
-
};
|
|
1078
|
-
diffSequences(aLength, bLength, isCommon, foundSubsequence);
|
|
1079
|
-
for (; aIndex !== aLength; aIndex += 1) {
|
|
1080
|
-
diffs.push(new Diff(DIFF_DELETE, aLines[aIndex]));
|
|
1081
|
-
}
|
|
1082
|
-
for (; bIndex !== bLength; bIndex += 1) {
|
|
1083
|
-
diffs.push(new Diff(DIFF_INSERT, bLines[bIndex]));
|
|
1084
|
-
}
|
|
1085
|
-
return [diffs, truncated];
|
|
1086
|
-
}
|
|
1087
|
-
function getType$1(value) {
|
|
1088
|
-
if (value === undefined) {
|
|
1089
|
-
return "undefined";
|
|
1090
|
-
} else if (value === null) {
|
|
1091
|
-
return "null";
|
|
1092
|
-
} else if (Array.isArray(value)) {
|
|
1093
|
-
return "array";
|
|
1094
|
-
} else if (typeof value === "boolean") {
|
|
1095
|
-
return "boolean";
|
|
1096
|
-
} else if (typeof value === "function") {
|
|
1097
|
-
return "function";
|
|
1098
|
-
} else if (typeof value === "number") {
|
|
1099
|
-
return "number";
|
|
1100
|
-
} else if (typeof value === "string") {
|
|
1101
|
-
return "string";
|
|
1102
|
-
} else if (typeof value === "bigint") {
|
|
1103
|
-
return "bigint";
|
|
1104
|
-
} else if (typeof value === "object") {
|
|
1105
|
-
if (value != null) {
|
|
1106
|
-
if (value.constructor === RegExp) {
|
|
1107
|
-
return "regexp";
|
|
1108
|
-
} else if (value.constructor === Map) {
|
|
1109
|
-
return "map";
|
|
1110
|
-
} else if (value.constructor === Set) {
|
|
1111
|
-
return "set";
|
|
1112
|
-
} else if (value.constructor === Date) {
|
|
1113
|
-
return "date";
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
return "object";
|
|
1117
|
-
} else if (typeof value === "symbol") {
|
|
1118
|
-
return "symbol";
|
|
1119
|
-
}
|
|
1120
|
-
throw new Error(`value of unknown type: ${value}`);
|
|
1121
|
-
}
|
|
1122
|
-
function getNewLineSymbol(string) {
|
|
1123
|
-
return string.includes("\r\n") ? "\r\n" : "\n";
|
|
1124
|
-
}
|
|
1125
|
-
function diffStrings(a, b, options) {
|
|
1126
|
-
const truncate = (options === null || options === void 0 ? void 0 : options.truncateThreshold) ?? false;
|
|
1127
|
-
const truncateThreshold = Math.max(Math.floor((options === null || options === void 0 ? void 0 : options.truncateThreshold) ?? 0), 0);
|
|
1128
|
-
let aLength = a.length;
|
|
1129
|
-
let bLength = b.length;
|
|
1130
|
-
if (truncate) {
|
|
1131
|
-
const aMultipleLines = a.includes("\n");
|
|
1132
|
-
const bMultipleLines = b.includes("\n");
|
|
1133
|
-
const aNewLineSymbol = getNewLineSymbol(a);
|
|
1134
|
-
const bNewLineSymbol = getNewLineSymbol(b);
|
|
1135
|
-
const _a = aMultipleLines ? `${a.split(aNewLineSymbol, truncateThreshold).join(aNewLineSymbol)}\n` : a;
|
|
1136
|
-
const _b = bMultipleLines ? `${b.split(bNewLineSymbol, truncateThreshold).join(bNewLineSymbol)}\n` : b;
|
|
1137
|
-
aLength = _a.length;
|
|
1138
|
-
bLength = _b.length;
|
|
1139
|
-
}
|
|
1140
|
-
const truncated = aLength !== a.length || bLength !== b.length;
|
|
1141
|
-
const isCommon = (aIndex$1, bIndex$1) => a[aIndex$1] === b[bIndex$1];
|
|
1142
|
-
let aIndex = 0;
|
|
1143
|
-
let bIndex = 0;
|
|
1144
|
-
const diffs = [];
|
|
1145
|
-
const foundSubsequence = (nCommon, aCommon, bCommon) => {
|
|
1146
|
-
if (aIndex !== aCommon) {
|
|
1147
|
-
diffs.push(new Diff(DIFF_DELETE, a.slice(aIndex, aCommon)));
|
|
1148
|
-
}
|
|
1149
|
-
if (bIndex !== bCommon) {
|
|
1150
|
-
diffs.push(new Diff(DIFF_INSERT, b.slice(bIndex, bCommon)));
|
|
1151
|
-
}
|
|
1152
|
-
aIndex = aCommon + nCommon;
|
|
1153
|
-
bIndex = bCommon + nCommon;
|
|
1154
|
-
diffs.push(new Diff(DIFF_EQUAL, b.slice(bCommon, bIndex)));
|
|
1155
|
-
};
|
|
1156
|
-
diffSequences(aLength, bLength, isCommon, foundSubsequence);
|
|
1157
|
-
if (aIndex !== aLength) {
|
|
1158
|
-
diffs.push(new Diff(DIFF_DELETE, a.slice(aIndex)));
|
|
1159
|
-
}
|
|
1160
|
-
if (bIndex !== bLength) {
|
|
1161
|
-
diffs.push(new Diff(DIFF_INSERT, b.slice(bIndex)));
|
|
1162
|
-
}
|
|
1163
|
-
return [diffs, truncated];
|
|
1164
|
-
}
|
|
1165
|
-
function concatenateRelevantDiffs(op, diffs, changeColor) {
|
|
1166
|
-
return diffs.reduce((reduced, diff$1) => reduced + (diff$1[0] === DIFF_EQUAL ? diff$1[1] : diff$1[0] === op && diff$1[1].length !== 0 ? changeColor(diff$1[1]) : ""), "");
|
|
1167
|
-
}
|
|
1168
|
-
var ChangeBuffer = class {
|
|
1169
|
-
op;
|
|
1170
|
-
line;
|
|
1171
|
-
lines;
|
|
1172
|
-
changeColor;
|
|
1173
|
-
constructor(op, changeColor) {
|
|
1174
|
-
this.op = op;
|
|
1175
|
-
this.line = [];
|
|
1176
|
-
this.lines = [];
|
|
1177
|
-
this.changeColor = changeColor;
|
|
1178
|
-
}
|
|
1179
|
-
pushSubstring(substring) {
|
|
1180
|
-
this.pushDiff(new Diff(this.op, substring));
|
|
1181
|
-
}
|
|
1182
|
-
pushLine() {
|
|
1183
|
-
this.lines.push(this.line.length !== 1 ? new Diff(this.op, concatenateRelevantDiffs(this.op, this.line, this.changeColor)) : this.line[0][0] === this.op ? this.line[0] : new Diff(this.op, this.line[0][1]));
|
|
1184
|
-
this.line.length = 0;
|
|
1185
|
-
}
|
|
1186
|
-
isLineEmpty() {
|
|
1187
|
-
return this.line.length === 0;
|
|
1188
|
-
}
|
|
1189
|
-
pushDiff(diff$1) {
|
|
1190
|
-
this.line.push(diff$1);
|
|
1191
|
-
}
|
|
1192
|
-
align(diff$1) {
|
|
1193
|
-
const string = diff$1[1];
|
|
1194
|
-
if (string.includes("\n")) {
|
|
1195
|
-
const substrings = string.split("\n");
|
|
1196
|
-
const iLast = substrings.length - 1;
|
|
1197
|
-
substrings.forEach((substring, i) => {
|
|
1198
|
-
if (i < iLast) {
|
|
1199
|
-
this.pushSubstring(substring);
|
|
1200
|
-
this.pushLine();
|
|
1201
|
-
} else if (substring.length !== 0) {
|
|
1202
|
-
this.pushSubstring(substring);
|
|
1203
|
-
}
|
|
1204
|
-
});
|
|
1205
|
-
} else {
|
|
1206
|
-
this.pushDiff(diff$1);
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
moveLinesTo(lines) {
|
|
1210
|
-
if (!this.isLineEmpty()) {
|
|
1211
|
-
this.pushLine();
|
|
1212
|
-
}
|
|
1213
|
-
lines.push(...this.lines);
|
|
1214
|
-
this.lines.length = 0;
|
|
1215
|
-
}
|
|
1216
|
-
};
|
|
1217
|
-
var CommonBuffer = class {
|
|
1218
|
-
deleteBuffer;
|
|
1219
|
-
insertBuffer;
|
|
1220
|
-
lines;
|
|
1221
|
-
constructor(deleteBuffer, insertBuffer) {
|
|
1222
|
-
this.deleteBuffer = deleteBuffer;
|
|
1223
|
-
this.insertBuffer = insertBuffer;
|
|
1224
|
-
this.lines = [];
|
|
1225
|
-
}
|
|
1226
|
-
pushDiffCommonLine(diff$1) {
|
|
1227
|
-
this.lines.push(diff$1);
|
|
1228
|
-
}
|
|
1229
|
-
pushDiffChangeLines(diff$1) {
|
|
1230
|
-
const isDiffEmpty = diff$1[1].length === 0;
|
|
1231
|
-
if (!isDiffEmpty || this.deleteBuffer.isLineEmpty()) {
|
|
1232
|
-
this.deleteBuffer.pushDiff(diff$1);
|
|
1233
|
-
}
|
|
1234
|
-
if (!isDiffEmpty || this.insertBuffer.isLineEmpty()) {
|
|
1235
|
-
this.insertBuffer.pushDiff(diff$1);
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
flushChangeLines() {
|
|
1239
|
-
this.deleteBuffer.moveLinesTo(this.lines);
|
|
1240
|
-
this.insertBuffer.moveLinesTo(this.lines);
|
|
1241
|
-
}
|
|
1242
|
-
align(diff$1) {
|
|
1243
|
-
const op = diff$1[0];
|
|
1244
|
-
const string = diff$1[1];
|
|
1245
|
-
if (string.includes("\n")) {
|
|
1246
|
-
const substrings = string.split("\n");
|
|
1247
|
-
const iLast = substrings.length - 1;
|
|
1248
|
-
substrings.forEach((substring, i) => {
|
|
1249
|
-
if (i === 0) {
|
|
1250
|
-
const subdiff = new Diff(op, substring);
|
|
1251
|
-
if (this.deleteBuffer.isLineEmpty() && this.insertBuffer.isLineEmpty()) {
|
|
1252
|
-
this.flushChangeLines();
|
|
1253
|
-
this.pushDiffCommonLine(subdiff);
|
|
1254
|
-
} else {
|
|
1255
|
-
this.pushDiffChangeLines(subdiff);
|
|
1256
|
-
this.flushChangeLines();
|
|
1257
|
-
}
|
|
1258
|
-
} else if (i < iLast) {
|
|
1259
|
-
this.pushDiffCommonLine(new Diff(op, substring));
|
|
1260
|
-
} else if (substring.length !== 0) {
|
|
1261
|
-
this.pushDiffChangeLines(new Diff(op, substring));
|
|
1262
|
-
}
|
|
1263
|
-
});
|
|
1264
|
-
} else {
|
|
1265
|
-
this.pushDiffChangeLines(diff$1);
|
|
1266
|
-
}
|
|
1267
|
-
}
|
|
1268
|
-
getLines() {
|
|
1269
|
-
this.flushChangeLines();
|
|
1270
|
-
return this.lines;
|
|
1271
|
-
}
|
|
1272
|
-
};
|
|
1273
|
-
function getAlignedDiffs(diffs, changeColor) {
|
|
1274
|
-
const deleteBuffer = new ChangeBuffer(DIFF_DELETE, changeColor);
|
|
1275
|
-
const insertBuffer = new ChangeBuffer(DIFF_INSERT, changeColor);
|
|
1276
|
-
const commonBuffer = new CommonBuffer(deleteBuffer, insertBuffer);
|
|
1277
|
-
diffs.forEach((diff$1) => {
|
|
1278
|
-
switch (diff$1[0]) {
|
|
1279
|
-
case DIFF_DELETE:
|
|
1280
|
-
deleteBuffer.align(diff$1);
|
|
1281
|
-
break;
|
|
1282
|
-
case DIFF_INSERT:
|
|
1283
|
-
insertBuffer.align(diff$1);
|
|
1284
|
-
break;
|
|
1285
|
-
default: commonBuffer.align(diff$1);
|
|
1286
|
-
}
|
|
1287
|
-
});
|
|
1288
|
-
return commonBuffer.getLines();
|
|
1289
|
-
}
|
|
1290
|
-
function hasCommonDiff(diffs, isMultiline) {
|
|
1291
|
-
if (isMultiline) {
|
|
1292
|
-
const iLast = diffs.length - 1;
|
|
1293
|
-
return diffs.some((diff$1, i) => diff$1[0] === DIFF_EQUAL && (i !== iLast || diff$1[1] !== "\n"));
|
|
1294
|
-
}
|
|
1295
|
-
return diffs.some((diff$1) => diff$1[0] === DIFF_EQUAL);
|
|
1296
|
-
}
|
|
1297
|
-
function diffStringsUnified(a, b, options) {
|
|
1298
|
-
if (a !== b && a.length !== 0 && b.length !== 0) {
|
|
1299
|
-
const isMultiline = a.includes("\n") || b.includes("\n");
|
|
1300
|
-
const [diffs, truncated] = diffStringsRaw(isMultiline ? `${a}\n` : a, isMultiline ? `${b}\n` : b, true, options);
|
|
1301
|
-
if (hasCommonDiff(diffs, isMultiline)) {
|
|
1302
|
-
const optionsNormalized = normalizeDiffOptions(options);
|
|
1303
|
-
const lines = getAlignedDiffs(diffs, optionsNormalized.changeColor);
|
|
1304
|
-
return printDiffLines(lines, truncated, optionsNormalized);
|
|
1305
|
-
}
|
|
1306
|
-
}
|
|
1307
|
-
return diffLinesUnified(a.split("\n"), b.split("\n"), options);
|
|
1308
|
-
}
|
|
1309
|
-
function diffStringsRaw(a, b, cleanup, options) {
|
|
1310
|
-
const [diffs, truncated] = diffStrings(a, b, options);
|
|
1311
|
-
if (cleanup) {
|
|
1312
|
-
diff_cleanupSemantic(diffs);
|
|
1313
|
-
}
|
|
1314
|
-
return [diffs, truncated];
|
|
1315
|
-
}
|
|
1316
|
-
function getCommonMessage(message, options) {
|
|
1317
|
-
const { commonColor } = normalizeDiffOptions(options);
|
|
1318
|
-
return commonColor(message);
|
|
1319
|
-
}
|
|
1320
|
-
const { AsymmetricMatcher, DOMCollection, DOMElement, Immutable, ReactElement, ReactTestComponent } = plugins;
|
|
1321
|
-
const PLUGINS = [
|
|
1322
|
-
ReactTestComponent,
|
|
1323
|
-
ReactElement,
|
|
1324
|
-
DOMElement,
|
|
1325
|
-
DOMCollection,
|
|
1326
|
-
Immutable,
|
|
1327
|
-
AsymmetricMatcher,
|
|
1328
|
-
plugins.Error
|
|
1329
|
-
];
|
|
1330
|
-
const FORMAT_OPTIONS = {
|
|
1331
|
-
maxDepth: 20,
|
|
1332
|
-
plugins: PLUGINS
|
|
1333
|
-
};
|
|
1334
|
-
const FALLBACK_FORMAT_OPTIONS = {
|
|
1335
|
-
callToJSON: false,
|
|
1336
|
-
maxDepth: 8,
|
|
1337
|
-
plugins: PLUGINS
|
|
1338
|
-
};
|
|
1339
|
-
/**
|
|
1340
|
-
* @param a Expected value
|
|
1341
|
-
* @param b Received value
|
|
1342
|
-
* @param options Diff options
|
|
1343
|
-
* @returns {string | null} a string diff
|
|
1344
|
-
*/
|
|
1345
|
-
function diff(a, b, options) {
|
|
1346
|
-
if (Object.is(a, b)) {
|
|
1347
|
-
return "";
|
|
1348
|
-
}
|
|
1349
|
-
const aType = getType$1(a);
|
|
1350
|
-
let expectedType = aType;
|
|
1351
|
-
let omitDifference = false;
|
|
1352
|
-
if (aType === "object" && typeof a.asymmetricMatch === "function") {
|
|
1353
|
-
if (a.$$typeof !== Symbol.for("jest.asymmetricMatcher")) {
|
|
1354
|
-
return undefined;
|
|
1355
|
-
}
|
|
1356
|
-
if (typeof a.getExpectedType !== "function") {
|
|
1357
|
-
return undefined;
|
|
1358
|
-
}
|
|
1359
|
-
expectedType = a.getExpectedType();
|
|
1360
|
-
omitDifference = expectedType === "string";
|
|
1361
|
-
}
|
|
1362
|
-
if (expectedType !== getType$1(b)) {
|
|
1363
|
-
const { aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator } = normalizeDiffOptions(options);
|
|
1364
|
-
const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
|
|
1365
|
-
let aDisplay = format(a, formatOptions);
|
|
1366
|
-
let bDisplay = format(b, formatOptions);
|
|
1367
|
-
const MAX_LENGTH = 1e5;
|
|
1368
|
-
function truncate(s) {
|
|
1369
|
-
return s.length <= MAX_LENGTH ? s : `${s.slice(0, MAX_LENGTH)}...`;
|
|
1370
|
-
}
|
|
1371
|
-
aDisplay = truncate(aDisplay);
|
|
1372
|
-
bDisplay = truncate(bDisplay);
|
|
1373
|
-
const aDiff = `${aColor(`${aIndicator} ${aAnnotation}:`)} \n${aDisplay}`;
|
|
1374
|
-
const bDiff = `${bColor(`${bIndicator} ${bAnnotation}:`)} \n${bDisplay}`;
|
|
1375
|
-
return `${aDiff}\n\n${bDiff}`;
|
|
1376
|
-
}
|
|
1377
|
-
if (omitDifference) {
|
|
1378
|
-
return undefined;
|
|
1379
|
-
}
|
|
1380
|
-
switch (aType) {
|
|
1381
|
-
case "string": return diffLinesUnified(a.split("\n"), b.split("\n"), options);
|
|
1382
|
-
case "boolean":
|
|
1383
|
-
case "number": return comparePrimitive(a, b, options);
|
|
1384
|
-
case "map": return compareObjects(sortMap(a), sortMap(b), options);
|
|
1385
|
-
case "set": return compareObjects(sortSet(a), sortSet(b), options);
|
|
1386
|
-
default: return compareObjects(a, b, options);
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
function comparePrimitive(a, b, options) {
|
|
1390
|
-
const aFormat = format(a, FORMAT_OPTIONS);
|
|
1391
|
-
const bFormat = format(b, FORMAT_OPTIONS);
|
|
1392
|
-
return aFormat === bFormat ? "" : diffLinesUnified(aFormat.split("\n"), bFormat.split("\n"), options);
|
|
1393
|
-
}
|
|
1394
|
-
function sortMap(map) {
|
|
1395
|
-
return new Map(Array.from(map.entries()).sort());
|
|
1396
|
-
}
|
|
1397
|
-
function sortSet(set) {
|
|
1398
|
-
return new Set(Array.from(set.values()).sort());
|
|
1399
|
-
}
|
|
1400
|
-
function compareObjects(a, b, options) {
|
|
1401
|
-
let difference;
|
|
1402
|
-
let hasThrown = false;
|
|
1403
|
-
try {
|
|
1404
|
-
const formatOptions = getFormatOptions(FORMAT_OPTIONS, options);
|
|
1405
|
-
difference = getObjectsDifference(a, b, formatOptions, options);
|
|
1406
|
-
} catch {
|
|
1407
|
-
hasThrown = true;
|
|
1408
|
-
}
|
|
1409
|
-
const noDiffMessage = getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
1410
|
-
if (difference === undefined || difference === noDiffMessage) {
|
|
1411
|
-
const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
|
|
1412
|
-
difference = getObjectsDifference(a, b, formatOptions, options);
|
|
1413
|
-
if (difference !== noDiffMessage && !hasThrown) {
|
|
1414
|
-
difference = `${getCommonMessage(SIMILAR_MESSAGE, options)}\n\n${difference}`;
|
|
1415
|
-
}
|
|
1416
|
-
}
|
|
1417
|
-
return difference;
|
|
1418
|
-
}
|
|
1419
|
-
function getFormatOptions(formatOptions, options) {
|
|
1420
|
-
const { compareKeys, printBasicPrototype, maxDepth } = normalizeDiffOptions(options);
|
|
1421
|
-
return {
|
|
1422
|
-
...formatOptions,
|
|
1423
|
-
compareKeys,
|
|
1424
|
-
printBasicPrototype,
|
|
1425
|
-
maxDepth: maxDepth ?? formatOptions.maxDepth
|
|
1426
|
-
};
|
|
1427
|
-
}
|
|
1428
|
-
function getObjectsDifference(a, b, formatOptions, options) {
|
|
1429
|
-
const formatOptionsZeroIndent = {
|
|
1430
|
-
...formatOptions,
|
|
1431
|
-
indent: 0
|
|
1432
|
-
};
|
|
1433
|
-
const aCompare = format(a, formatOptionsZeroIndent);
|
|
1434
|
-
const bCompare = format(b, formatOptionsZeroIndent);
|
|
1435
|
-
if (aCompare === bCompare) {
|
|
1436
|
-
return getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
1437
|
-
} else {
|
|
1438
|
-
const aDisplay = format(a, formatOptions);
|
|
1439
|
-
const bDisplay = format(b, formatOptions);
|
|
1440
|
-
return diffLinesUnified2(aDisplay.split("\n"), bDisplay.split("\n"), aCompare.split("\n"), bCompare.split("\n"), options);
|
|
1441
|
-
}
|
|
1442
|
-
}
|
|
1443
|
-
const MAX_DIFF_STRING_LENGTH = 2e4;
|
|
1444
|
-
function isAsymmetricMatcher(data) {
|
|
1445
|
-
const type = getType(data);
|
|
1446
|
-
return type === "Object" && typeof data.asymmetricMatch === "function";
|
|
1447
|
-
}
|
|
1448
|
-
function isReplaceable(obj1, obj2) {
|
|
1449
|
-
const obj1Type = getType(obj1);
|
|
1450
|
-
const obj2Type = getType(obj2);
|
|
1451
|
-
return obj1Type === obj2Type && (obj1Type === "Object" || obj1Type === "Array");
|
|
1452
|
-
}
|
|
1453
|
-
function printDiffOrStringify(received, expected, options) {
|
|
1454
|
-
const { aAnnotation, bAnnotation } = normalizeDiffOptions(options);
|
|
1455
|
-
if (typeof expected === "string" && typeof received === "string" && expected.length > 0 && received.length > 0 && expected.length <= MAX_DIFF_STRING_LENGTH && received.length <= MAX_DIFF_STRING_LENGTH && expected !== received) {
|
|
1456
|
-
if (expected.includes("\n") || received.includes("\n")) {
|
|
1457
|
-
return diffStringsUnified(expected, received, options);
|
|
1458
|
-
}
|
|
1459
|
-
const [diffs] = diffStringsRaw(expected, received, true);
|
|
1460
|
-
const hasCommonDiff$1 = diffs.some((diff$1) => diff$1[0] === DIFF_EQUAL);
|
|
1461
|
-
const printLabel = getLabelPrinter(aAnnotation, bAnnotation);
|
|
1462
|
-
const expectedLine = printLabel(aAnnotation) + printExpected(getCommonAndChangedSubstrings(diffs, DIFF_DELETE, hasCommonDiff$1));
|
|
1463
|
-
const receivedLine = printLabel(bAnnotation) + printReceived(getCommonAndChangedSubstrings(diffs, DIFF_INSERT, hasCommonDiff$1));
|
|
1464
|
-
return `${expectedLine}\n${receivedLine}`;
|
|
1465
|
-
}
|
|
1466
|
-
const clonedExpected = deepClone(expected, { forceWritable: true });
|
|
1467
|
-
const clonedReceived = deepClone(received, { forceWritable: true });
|
|
1468
|
-
const { replacedExpected, replacedActual } = replaceAsymmetricMatcher(clonedReceived, clonedExpected);
|
|
1469
|
-
const difference = diff(replacedExpected, replacedActual, options);
|
|
1470
|
-
return difference;
|
|
1471
|
-
}
|
|
1472
|
-
function replaceAsymmetricMatcher(actual, expected, actualReplaced = new WeakSet(), expectedReplaced = new WeakSet()) {
|
|
1473
|
-
if (actual instanceof Error && expected instanceof Error && typeof actual.cause !== "undefined" && typeof expected.cause === "undefined") {
|
|
1474
|
-
delete actual.cause;
|
|
1475
|
-
return {
|
|
1476
|
-
replacedActual: actual,
|
|
1477
|
-
replacedExpected: expected
|
|
1478
|
-
};
|
|
1479
|
-
}
|
|
1480
|
-
if (!isReplaceable(actual, expected)) {
|
|
1481
|
-
return {
|
|
1482
|
-
replacedActual: actual,
|
|
1483
|
-
replacedExpected: expected
|
|
1484
|
-
};
|
|
1485
|
-
}
|
|
1486
|
-
if (actualReplaced.has(actual) || expectedReplaced.has(expected)) {
|
|
1487
|
-
return {
|
|
1488
|
-
replacedActual: actual,
|
|
1489
|
-
replacedExpected: expected
|
|
1490
|
-
};
|
|
1491
|
-
}
|
|
1492
|
-
actualReplaced.add(actual);
|
|
1493
|
-
expectedReplaced.add(expected);
|
|
1494
|
-
getOwnProperties(expected).forEach((key) => {
|
|
1495
|
-
const expectedValue = expected[key];
|
|
1496
|
-
const actualValue = actual[key];
|
|
1497
|
-
if (isAsymmetricMatcher(expectedValue)) {
|
|
1498
|
-
if (expectedValue.asymmetricMatch(actualValue)) {
|
|
1499
|
-
actual[key] = expectedValue;
|
|
1500
|
-
}
|
|
1501
|
-
} else if (isAsymmetricMatcher(actualValue)) {
|
|
1502
|
-
if (actualValue.asymmetricMatch(expectedValue)) {
|
|
1503
|
-
expected[key] = actualValue;
|
|
1504
|
-
}
|
|
1505
|
-
} else if (isReplaceable(actualValue, expectedValue)) {
|
|
1506
|
-
const replaced = replaceAsymmetricMatcher(actualValue, expectedValue, actualReplaced, expectedReplaced);
|
|
1507
|
-
actual[key] = replaced.replacedActual;
|
|
1508
|
-
expected[key] = replaced.replacedExpected;
|
|
1509
|
-
}
|
|
1510
|
-
});
|
|
1511
|
-
return {
|
|
1512
|
-
replacedActual: actual,
|
|
1513
|
-
replacedExpected: expected
|
|
1514
|
-
};
|
|
1515
|
-
}
|
|
1516
|
-
function getLabelPrinter(...strings) {
|
|
1517
|
-
const maxLength = strings.reduce((max, string) => string.length > max ? string.length : max, 0);
|
|
1518
|
-
return (string) => `${string}: ${" ".repeat(maxLength - string.length)}`;
|
|
1519
|
-
}
|
|
1520
|
-
const SPACE_SYMBOL = "·";
|
|
1521
|
-
function replaceTrailingSpaces(text) {
|
|
1522
|
-
return text.replace(/\s+$/gm, (spaces) => SPACE_SYMBOL.repeat(spaces.length));
|
|
1523
|
-
}
|
|
1524
|
-
function printReceived(object) {
|
|
1525
|
-
return u.red(replaceTrailingSpaces(stringify(object)));
|
|
1526
|
-
}
|
|
1527
|
-
function printExpected(value) {
|
|
1528
|
-
return u.green(replaceTrailingSpaces(stringify(value)));
|
|
1529
|
-
}
|
|
1530
|
-
function getCommonAndChangedSubstrings(diffs, op, hasCommonDiff$1) {
|
|
1531
|
-
return diffs.reduce((reduced, diff$1) => reduced + (diff$1[0] === DIFF_EQUAL ? diff$1[1] : diff$1[0] === op ? hasCommonDiff$1 ? u.inverse(diff$1[1]) : diff$1[1] : ""), "");
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
//#endregion
|
|
1535
|
-
export { diff, printDiffOrStringify };
|