alepha 0.13.6 → 0.13.8
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/README.md +5 -2
- package/assets/swagger-ui/swagger-ui-bundle.js +1 -1
- package/assets/swagger-ui/swagger-ui-standalone-preset.js +1 -1
- package/assets/swagger-ui/swagger-ui.css +1 -1
- package/dist/api/audits/index.browser.js +116 -0
- package/dist/api/audits/index.browser.js.map +1 -0
- package/dist/api/audits/index.d.ts +1194 -0
- package/dist/api/audits/index.js +674 -0
- package/dist/api/audits/index.js.map +1 -0
- package/dist/{api-files → api/files}/index.browser.js +5 -5
- package/dist/api/files/index.browser.js.map +1 -0
- package/dist/{api-files → api/files}/index.d.ts +16 -9
- package/dist/{api-files → api/files}/index.js +10 -10
- package/dist/api/files/index.js.map +1 -0
- package/dist/{api-jobs → api/jobs}/index.browser.js +5 -5
- package/dist/api/jobs/index.browser.js.map +1 -0
- package/dist/{api-jobs → api/jobs}/index.d.ts +35 -35
- package/dist/{api-jobs → api/jobs}/index.js +9 -9
- package/dist/api/jobs/index.js.map +1 -0
- package/dist/{api-notifications → api/notifications}/index.browser.js +11 -11
- package/dist/api/notifications/index.browser.js.map +1 -0
- package/dist/api/notifications/index.d.ts +327 -0
- package/dist/{api-notifications → api/notifications}/index.js +11 -11
- package/dist/api/notifications/index.js.map +1 -0
- package/dist/api/parameters/index.browser.js +60 -0
- package/dist/api/parameters/index.browser.js.map +1 -0
- package/dist/api/parameters/index.d.ts +761 -0
- package/dist/api/parameters/index.js +877 -0
- package/dist/api/parameters/index.js.map +1 -0
- package/dist/{api-users → api/users}/index.browser.js +6 -6
- package/dist/api/users/index.browser.js.map +1 -0
- package/dist/{api-users → api/users}/index.d.ts +259 -247
- package/dist/{api-users → api/users}/index.js +125 -112
- package/dist/api/users/index.js.map +1 -0
- package/dist/{api-verifications → api/verifications}/index.browser.js +5 -5
- package/dist/api/verifications/index.browser.js.map +1 -0
- package/dist/api/verifications/index.d.ts +248 -0
- package/dist/{api-verifications → api/verifications}/index.js +13 -12
- package/dist/api/verifications/index.js.map +1 -0
- package/dist/bin/index.js +1 -0
- package/dist/bin/index.js.map +1 -1
- package/dist/cache/{index.d.ts → core/index.d.ts} +4 -4
- package/dist/cache/{index.js → core/index.js} +5 -5
- package/dist/cache/core/index.js.map +1 -0
- package/dist/{cache-redis → cache/redis}/index.d.ts +2 -2
- package/dist/{cache-redis → cache/redis}/index.js +2 -2
- package/dist/cache/redis/index.js.map +1 -0
- package/dist/cli/index.d.ts +71 -9
- package/dist/cli/index.js +280 -79
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +63 -2
- package/dist/command/index.js +30 -3
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js +241 -61
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts +170 -90
- package/dist/core/index.js +264 -67
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +248 -65
- package/dist/core/index.native.js.map +1 -1
- package/dist/email/index.js +15 -10554
- package/dist/email/index.js.map +1 -1
- package/dist/lock/{index.d.ts → core/index.d.ts} +5 -5
- package/dist/lock/{index.js → core/index.js} +5 -5
- package/dist/lock/core/index.js.map +1 -0
- package/dist/{lock-redis → lock/redis}/index.d.ts +2 -2
- package/dist/{lock-redis → lock/redis}/index.js +2 -2
- package/dist/lock/redis/index.js.map +1 -0
- package/dist/logger/index.d.ts +4 -4
- package/dist/logger/index.js +77 -72
- package/dist/logger/index.js.map +1 -1
- package/dist/orm/index.d.ts +5 -1
- package/dist/orm/index.js +24 -7
- package/dist/orm/index.js.map +1 -1
- package/dist/queue/core/index.d.ts +548 -0
- package/dist/queue/core/index.js +391 -0
- package/dist/queue/core/index.js.map +1 -0
- package/dist/queue/redis/index.d.ts +28 -0
- package/dist/queue/redis/index.js +43 -0
- package/dist/queue/redis/index.js.map +1 -0
- package/dist/scheduler/index.d.ts +7 -7
- package/dist/scheduler/index.js +1 -393
- package/dist/scheduler/index.js.map +1 -1
- package/dist/security/index.d.ts +1 -1
- package/dist/security/index.js +2 -1413
- package/dist/security/index.js.map +1 -1
- package/dist/{server-auth → server/auth}/index.browser.js +6 -6
- package/dist/server/auth/index.browser.js.map +1 -0
- package/dist/{server-auth → server/auth}/index.d.ts +175 -164
- package/dist/server/auth/index.js +742 -0
- package/dist/server/auth/index.js.map +1 -0
- package/dist/{server-cache → server/cache}/index.d.ts +2 -2
- package/dist/{server-cache → server/cache}/index.js +2 -2
- package/dist/server/cache/index.js.map +1 -0
- package/dist/{server-compress → server/compress}/index.d.ts +2 -2
- package/dist/{server-compress → server/compress}/index.js +2 -2
- package/dist/server/compress/index.js.map +1 -0
- package/dist/{server-cookies → server/cookies}/index.browser.js +3 -3
- package/dist/server/cookies/index.browser.js.map +1 -0
- package/dist/{server-cookies → server/cookies}/index.d.ts +4 -4
- package/dist/{server-cookies → server/cookies}/index.js +9 -5
- package/dist/server/cookies/index.js.map +1 -0
- package/dist/server/{index.browser.js → core/index.browser.js} +14 -14
- package/dist/server/core/index.browser.js.map +1 -0
- package/dist/server/{index.d.ts → core/index.d.ts} +46 -37
- package/dist/server/{index.js → core/index.js} +47 -33
- package/dist/server/core/index.js.map +1 -0
- package/dist/{server-cors → server/cors}/index.d.ts +3 -3
- package/dist/{server-cors → server/cors}/index.js +3 -3
- package/dist/server/cors/index.js.map +1 -0
- package/dist/{server-health → server/health}/index.d.ts +3 -3
- package/dist/{server-health → server/health}/index.js +3 -3
- package/dist/server/health/index.js.map +1 -0
- package/dist/{server-helmet → server/helmet}/index.d.ts +2 -2
- package/dist/{server-helmet → server/helmet}/index.js +2 -2
- package/dist/server/helmet/index.js.map +1 -0
- package/dist/{server-links → server/links}/index.browser.js +5 -5
- package/dist/server/links/index.browser.js.map +1 -0
- package/dist/{server-links → server/links}/index.d.ts +40 -40
- package/dist/{server-links → server/links}/index.js +7 -7
- package/dist/server/links/index.js.map +1 -0
- package/dist/{server-metrics → server/metrics}/index.d.ts +2 -2
- package/dist/server/metrics/index.js +74 -0
- package/dist/server/metrics/index.js.map +1 -0
- package/dist/{server-multipart → server/multipart}/index.d.ts +2 -2
- package/dist/{server-multipart → server/multipart}/index.js +2 -2
- package/dist/server/multipart/index.js.map +1 -0
- package/dist/{server-proxy → server/proxy}/index.d.ts +3 -3
- package/dist/{server-proxy → server/proxy}/index.js +3 -3
- package/dist/server/proxy/index.js.map +1 -0
- package/dist/{server-rate-limit → server/rate-limit}/index.d.ts +4 -4
- package/dist/{server-rate-limit → server/rate-limit}/index.js +4 -4
- package/dist/server/rate-limit/index.js.map +1 -0
- package/dist/{server-security → server/security}/index.browser.js +1 -1
- package/dist/server/security/index.browser.js.map +1 -0
- package/dist/{server-security → server/security}/index.d.ts +4 -4
- package/dist/{server-security → server/security}/index.js +4 -4
- package/dist/server/security/index.js.map +1 -0
- package/dist/{server-static → server/static}/index.d.ts +3 -3
- package/dist/{server-static → server/static}/index.js +3 -3
- package/dist/server/static/index.js.map +1 -0
- package/dist/{server-swagger → server/swagger}/index.d.ts +3 -3
- package/dist/{server-swagger → server/swagger}/index.js +4 -4
- package/dist/server/swagger/index.js.map +1 -0
- package/dist/thread/index.js +2 -2
- package/dist/thread/index.js.map +1 -1
- package/dist/topic/{index.d.ts → core/index.d.ts} +6 -6
- package/dist/topic/{index.js → core/index.js} +6 -6
- package/dist/topic/core/index.js.map +1 -0
- package/dist/{topic-redis → topic/redis}/index.d.ts +2 -2
- package/dist/{topic-redis → topic/redis}/index.js +2 -2
- package/dist/topic/redis/index.js.map +1 -0
- package/dist/vite/index.d.ts +13 -2
- package/dist/vite/index.js +114 -50
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.browser.js +3 -3
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.js +4 -4
- package/dist/websocket/index.js.map +1 -1
- package/package.json +160 -156
- package/src/api/audits/controllers/AuditController.ts +186 -0
- package/src/api/audits/entities/audits.ts +132 -0
- package/src/api/audits/index.browser.ts +18 -0
- package/src/api/audits/index.ts +58 -0
- package/src/api/audits/primitives/$audit.ts +159 -0
- package/src/api/audits/schemas/auditQuerySchema.ts +23 -0
- package/src/api/audits/schemas/auditResourceSchema.ts +9 -0
- package/src/api/audits/schemas/createAuditSchema.ts +27 -0
- package/src/api/audits/services/AuditService.ts +412 -0
- package/src/{api-files → api/files}/index.ts +1 -0
- package/src/api/parameters/controllers/ConfigController.ts +324 -0
- package/src/api/parameters/entities/parameters.ts +113 -0
- package/src/api/parameters/index.ts +60 -0
- package/src/api/parameters/primitives/$config.ts +351 -0
- package/src/api/parameters/schedulers/ConfigActivationScheduler.ts +30 -0
- package/src/api/parameters/services/ConfigStore.ts +491 -0
- package/src/{api-users → api/users}/atoms/realmAuthSettingsAtom.ts +19 -0
- package/src/{api-users → api/users}/controllers/UserRealmController.ts +0 -2
- package/src/{api-users → api/users}/index.ts +2 -0
- package/src/{api-users → api/users}/primitives/$userRealm.ts +18 -3
- package/src/{api-users → api/users}/providers/UserRealmProvider.ts +12 -10
- package/src/{api-users → api/users}/services/RegistrationService.ts +2 -1
- package/src/{api-users → api/users}/services/SessionService.ts +4 -0
- package/src/{api-users → api/users}/services/UserService.ts +3 -0
- package/src/{api-verifications → api/verifications}/index.ts +9 -1
- package/src/bin/index.ts +1 -0
- package/src/cli/apps/AlephaPackageBuilderCli.ts +73 -48
- package/src/cli/assets/appRouterTs.ts +1 -1
- package/src/cli/assets/biomeJson.ts +2 -2
- package/src/cli/assets/dummySpecTs.ts +7 -0
- package/src/cli/assets/editorconfig.ts +13 -0
- package/src/cli/assets/indexHtml.ts +1 -1
- package/src/cli/assets/mainBrowserTs.ts +1 -1
- package/src/cli/assets/mainTs.ts +14 -0
- package/src/cli/assets/viteConfigTs.ts +1 -1
- package/src/cli/commands/BiomeCommands.ts +2 -0
- package/src/cli/commands/CoreCommands.ts +38 -15
- package/src/cli/commands/VerifyCommands.ts +6 -2
- package/src/cli/commands/ViteCommands.ts +28 -18
- package/src/cli/services/AlephaCliUtils.ts +243 -37
- package/src/command/helpers/Asker.ts +0 -1
- package/src/command/primitives/$command.ts +67 -0
- package/src/command/providers/CliProvider.ts +39 -8
- package/src/core/Alepha.ts +40 -30
- package/src/core/helpers/jsonSchemaToTypeBox.ts +307 -0
- package/src/core/index.shared.ts +1 -0
- package/src/core/index.ts +30 -3
- package/src/core/providers/EventManager.ts +1 -1
- package/src/core/providers/SchemaValidator.ts +1 -1
- package/src/core/providers/StateManager.ts +23 -12
- package/src/core/providers/TypeProvider.ts +26 -34
- package/src/logger/index.ts +8 -6
- package/src/logger/primitives/$logger.ts +1 -1
- package/src/logger/providers/{SimpleFormatterProvider.ts → PrettyFormatterProvider.ts} +10 -1
- package/src/orm/index.ts +6 -0
- package/src/orm/services/PgRelationManager.ts +2 -2
- package/src/orm/services/PostgresModelBuilder.ts +11 -7
- package/src/orm/services/Repository.ts +16 -7
- package/src/orm/services/SqliteModelBuilder.ts +10 -0
- package/src/queue/{index.ts → core/index.ts} +2 -3
- package/src/queue/{primitives → core/primitives}/$queue.ts +17 -162
- package/src/queue/core/providers/MemoryQueueProvider.ts +19 -0
- package/src/queue/core/providers/QueueProvider.ts +23 -0
- package/src/queue/core/providers/WorkerProvider.ts +244 -0
- package/src/queue/redis/providers/RedisQueueProvider.ts +31 -0
- package/src/{server-auth → server/auth}/primitives/$auth.ts +7 -0
- package/src/{server-auth → server/auth}/providers/ServerAuthProvider.ts +51 -8
- package/src/{server-cookies → server/cookies}/index.ts +2 -1
- package/src/server/{index.ts → core/index.ts} +7 -0
- package/src/server/{primitives → core/primitives}/$action.ts +10 -1
- package/src/server/{providers → core/providers}/ServerBodyParserProvider.ts +11 -5
- package/src/server/{providers → core/providers}/ServerRouterProvider.ts +13 -7
- package/src/{server-rate-limit → server/rate-limit}/index.ts +1 -1
- package/src/{server-swagger → server/swagger}/providers/ServerSwaggerProvider.ts +1 -0
- package/src/thread/primitives/$thread.ts +2 -2
- package/src/vite/index.ts +0 -2
- package/src/vite/tasks/buildServer.ts +3 -4
- package/src/vite/tasks/copyAssets.ts +32 -8
- package/src/vite/tasks/generateCloudflare.ts +35 -19
- package/src/vite/tasks/generateDocker.ts +18 -4
- package/src/vite/tasks/generateSitemap.ts +5 -7
- package/src/vite/tasks/generateVercel.ts +76 -41
- package/src/vite/tasks/runAlepha.ts +16 -1
- package/src/websocket/providers/NodeWebSocketServerProvider.ts +3 -11
- package/src/websocket/services/WebSocketClient.ts +3 -3
- package/dist/api-files/index.browser.js.map +0 -1
- package/dist/api-files/index.js.map +0 -1
- package/dist/api-jobs/index.browser.js.map +0 -1
- package/dist/api-jobs/index.js.map +0 -1
- package/dist/api-notifications/index.browser.js.map +0 -1
- package/dist/api-notifications/index.d.ts +0 -327
- package/dist/api-notifications/index.js.map +0 -1
- package/dist/api-parameters/index.browser.js +0 -29
- package/dist/api-parameters/index.browser.js.map +0 -1
- package/dist/api-parameters/index.d.ts +0 -83
- package/dist/api-parameters/index.js +0 -63
- package/dist/api-parameters/index.js.map +0 -1
- package/dist/api-users/index.browser.js.map +0 -1
- package/dist/api-users/index.js.map +0 -1
- package/dist/api-verifications/index.browser.js.map +0 -1
- package/dist/api-verifications/index.d.ts +0 -229
- package/dist/api-verifications/index.js.map +0 -1
- package/dist/cache/index.js.map +0 -1
- package/dist/cache-redis/index.js.map +0 -1
- package/dist/cli/dist-BlfFtOk2.js +0 -2770
- package/dist/cli/dist-BlfFtOk2.js.map +0 -1
- package/dist/lock/index.js.map +0 -1
- package/dist/lock-redis/index.js.map +0 -1
- package/dist/queue/index.d.ts +0 -1265
- package/dist/queue/index.js +0 -1037
- package/dist/queue/index.js.map +0 -1
- package/dist/queue-redis/index.d.ts +0 -82
- package/dist/queue-redis/index.js +0 -872
- package/dist/queue-redis/index.js.map +0 -1
- package/dist/server/index.browser.js.map +0 -1
- package/dist/server/index.js.map +0 -1
- package/dist/server-auth/index.browser.js.map +0 -1
- package/dist/server-auth/index.js +0 -1943
- package/dist/server-auth/index.js.map +0 -1
- package/dist/server-cache/index.js.map +0 -1
- package/dist/server-compress/index.js.map +0 -1
- package/dist/server-cookies/index.browser.js.map +0 -1
- package/dist/server-cookies/index.js.map +0 -1
- package/dist/server-cors/index.js.map +0 -1
- package/dist/server-health/index.js.map +0 -1
- package/dist/server-helmet/index.js.map +0 -1
- package/dist/server-links/index.browser.js.map +0 -1
- package/dist/server-links/index.js.map +0 -1
- package/dist/server-metrics/index.js +0 -4532
- package/dist/server-metrics/index.js.map +0 -1
- package/dist/server-multipart/index.js.map +0 -1
- package/dist/server-proxy/index.js.map +0 -1
- package/dist/server-rate-limit/index.js.map +0 -1
- package/dist/server-security/index.browser.js.map +0 -1
- package/dist/server-security/index.js.map +0 -1
- package/dist/server-static/index.js.map +0 -1
- package/dist/server-swagger/index.js.map +0 -1
- package/dist/topic/index.js.map +0 -1
- package/dist/topic-redis/index.js.map +0 -1
- package/src/api-parameters/controllers/ParameterController.ts +0 -45
- package/src/api-parameters/entities/parameters.ts +0 -30
- package/src/api-parameters/index.ts +0 -21
- package/src/api-parameters/primitives/$config.ts +0 -79
- package/src/api-parameters/services/ParameterStore.ts +0 -23
- package/src/queue/interfaces/QueueJob.ts +0 -459
- package/src/queue/providers/MemoryQueueProvider.ts +0 -850
- package/src/queue/providers/QueueProvider.ts +0 -319
- package/src/queue/providers/WorkerProvider.ts +0 -344
- package/src/queue-redis/providers/RedisQueueProvider.ts +0 -1209
- /package/src/{api-files → api/files}/controllers/FileController.ts +0 -0
- /package/src/{api-files → api/files}/controllers/StorageStatsController.ts +0 -0
- /package/src/{api-files → api/files}/entities/files.ts +0 -0
- /package/src/{api-files → api/files}/index.browser.ts +0 -0
- /package/src/{api-files → api/files}/jobs/FileJobs.ts +0 -0
- /package/src/{api-files → api/files}/schemas/fileQuerySchema.ts +0 -0
- /package/src/{api-files → api/files}/schemas/fileResourceSchema.ts +0 -0
- /package/src/{api-files → api/files}/schemas/storageStatsSchema.ts +0 -0
- /package/src/{api-files → api/files}/services/FileService.ts +0 -0
- /package/src/{api-jobs → api/jobs}/controllers/JobController.ts +0 -0
- /package/src/{api-jobs → api/jobs}/entities/jobExecutions.ts +0 -0
- /package/src/{api-jobs → api/jobs}/index.browser.ts +0 -0
- /package/src/{api-jobs → api/jobs}/index.ts +0 -0
- /package/src/{api-jobs → api/jobs}/primitives/$job.ts +0 -0
- /package/src/{api-jobs → api/jobs}/providers/JobProvider.ts +0 -0
- /package/src/{api-jobs → api/jobs}/schemas/jobExecutionQuerySchema.ts +0 -0
- /package/src/{api-jobs → api/jobs}/schemas/jobExecutionResourceSchema.ts +0 -0
- /package/src/{api-jobs → api/jobs}/schemas/triggerJobSchema.ts +0 -0
- /package/src/{api-jobs → api/jobs}/services/JobService.ts +0 -0
- /package/src/{api-notifications → api/notifications}/controllers/NotificationController.ts +0 -0
- /package/src/{api-notifications → api/notifications}/entities/notifications.ts +0 -0
- /package/src/{api-notifications → api/notifications}/index.browser.ts +0 -0
- /package/src/{api-notifications → api/notifications}/index.ts +0 -0
- /package/src/{api-notifications → api/notifications}/jobs/NotificationJobs.ts +0 -0
- /package/src/{api-notifications → api/notifications}/primitives/$notification.ts +0 -0
- /package/src/{api-notifications → api/notifications}/queues/NotificationQueues.ts +0 -0
- /package/src/{api-notifications → api/notifications}/schemas/notificationContactPreferencesSchema.ts +0 -0
- /package/src/{api-notifications → api/notifications}/schemas/notificationContactSchema.ts +0 -0
- /package/src/{api-notifications → api/notifications}/schemas/notificationCreateSchema.ts +0 -0
- /package/src/{api-notifications → api/notifications}/schemas/notificationQuerySchema.ts +0 -0
- /package/src/{api-notifications → api/notifications}/services/NotificationSenderService.ts +0 -0
- /package/src/{api-notifications → api/notifications}/services/NotificationService.ts +0 -0
- /package/src/{api-parameters → api/parameters}/index.browser.ts +0 -0
- /package/src/{api-users → api/users}/controllers/IdentityController.ts +0 -0
- /package/src/{api-users → api/users}/controllers/SessionController.ts +0 -0
- /package/src/{api-users → api/users}/controllers/UserController.ts +0 -0
- /package/src/{api-users → api/users}/entities/identities.ts +0 -0
- /package/src/{api-users → api/users}/entities/sessions.ts +0 -0
- /package/src/{api-users → api/users}/entities/users.ts +0 -0
- /package/src/{api-users → api/users}/index.browser.ts +0 -0
- /package/src/{api-users → api/users}/notifications/UserNotifications.ts +0 -0
- /package/src/{api-users → api/users}/schemas/completePasswordResetRequestSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/completeRegistrationRequestSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/createUserSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/identityQuerySchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/identityResourceSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/loginSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/passwordResetIntentResponseSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/registerQuerySchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/registerRequestSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/registerResponseSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/registerSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/registrationIntentResponseSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/resetPasswordSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/sessionQuerySchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/sessionResourceSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/updateUserSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/userQuerySchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/userRealmConfigSchema.ts +0 -0
- /package/src/{api-users → api/users}/schemas/userResourceSchema.ts +0 -0
- /package/src/{api-users → api/users}/services/CredentialService.ts +0 -0
- /package/src/{api-users → api/users}/services/IdentityService.ts +0 -0
- /package/src/{api-users → api/users}/services/SessionCrudService.ts +0 -0
- /package/src/{api-verifications → api/verifications}/controllers/VerificationController.ts +0 -0
- /package/src/{api-verifications → api/verifications}/entities/verifications.ts +0 -0
- /package/src/{api-verifications → api/verifications}/index.browser.ts +0 -0
- /package/src/{api-verifications → api/verifications}/jobs/VerificationJobs.ts +0 -0
- /package/src/{api-verifications → api/verifications}/parameters/VerificationParameters.ts +0 -0
- /package/src/{api-verifications → api/verifications}/schemas/requestVerificationCodeResponseSchema.ts +0 -0
- /package/src/{api-verifications → api/verifications}/schemas/validateVerificationCodeResponseSchema.ts +0 -0
- /package/src/{api-verifications → api/verifications}/schemas/verificationSettingsSchema.ts +0 -0
- /package/src/{api-verifications → api/verifications}/schemas/verificationTypeEnumSchema.ts +0 -0
- /package/src/{api-verifications → api/verifications}/services/VerificationService.ts +0 -0
- /package/src/cache/{errors → core/errors}/CacheError.ts +0 -0
- /package/src/cache/{index.ts → core/index.ts} +0 -0
- /package/src/cache/{primitives → core/primitives}/$cache.ts +0 -0
- /package/src/cache/{providers → core/providers}/CacheProvider.ts +0 -0
- /package/src/cache/{providers → core/providers}/MemoryCacheProvider.ts +0 -0
- /package/src/{cache-redis → cache/redis}/index.ts +0 -0
- /package/src/{cache-redis → cache/redis}/providers/RedisCacheProvider.ts +0 -0
- /package/src/lock/{index.ts → core/index.ts} +0 -0
- /package/src/lock/{primitives → core/primitives}/$lock.ts +0 -0
- /package/src/lock/{providers → core/providers}/LockProvider.ts +0 -0
- /package/src/lock/{providers → core/providers}/LockTopicProvider.ts +0 -0
- /package/src/lock/{providers → core/providers}/MemoryLockProvider.ts +0 -0
- /package/src/{lock-redis → lock/redis}/index.ts +0 -0
- /package/src/{lock-redis → lock/redis}/providers/RedisLockProvider.ts +0 -0
- /package/src/queue/{primitives → core/primitives}/$consumer.ts +0 -0
- /package/src/{queue-redis → queue/redis}/index.ts +0 -0
- /package/src/{server-auth → server/auth}/constants/routes.ts +0 -0
- /package/src/{server-auth → server/auth}/index.browser.ts +0 -0
- /package/src/{server-auth → server/auth}/index.shared.ts +0 -0
- /package/src/{server-auth → server/auth}/index.ts +0 -0
- /package/src/{server-auth → server/auth}/primitives/$authApple.ts +0 -0
- /package/src/{server-auth → server/auth}/primitives/$authCredentials.ts +0 -0
- /package/src/{server-auth → server/auth}/primitives/$authGithub.ts +0 -0
- /package/src/{server-auth → server/auth}/primitives/$authGoogle.ts +0 -0
- /package/src/{server-auth → server/auth}/schemas/authenticationProviderSchema.ts +0 -0
- /package/src/{server-auth → server/auth}/schemas/tokenResponseSchema.ts +0 -0
- /package/src/{server-auth → server/auth}/schemas/tokensSchema.ts +0 -0
- /package/src/{server-auth → server/auth}/schemas/userinfoResponseSchema.ts +0 -0
- /package/src/{server-cache → server/cache}/index.ts +0 -0
- /package/src/{server-cache → server/cache}/providers/ServerCacheProvider.ts +0 -0
- /package/src/{server-compress → server/compress}/index.ts +0 -0
- /package/src/{server-compress → server/compress}/providers/ServerCompressProvider.ts +0 -0
- /package/src/{server-cookies → server/cookies}/index.browser.ts +0 -0
- /package/src/{server-cookies → server/cookies}/primitives/$cookie.browser.ts +0 -0
- /package/src/{server-cookies → server/cookies}/primitives/$cookie.ts +0 -0
- /package/src/{server-cookies → server/cookies}/providers/ServerCookiesProvider.ts +0 -0
- /package/src/{server-cookies → server/cookies}/services/CookieParser.ts +0 -0
- /package/src/server/{constants → core/constants}/routeMethods.ts +0 -0
- /package/src/server/{errors → core/errors}/BadRequestError.ts +0 -0
- /package/src/server/{errors → core/errors}/ConflictError.ts +0 -0
- /package/src/server/{errors → core/errors}/ForbiddenError.ts +0 -0
- /package/src/server/{errors → core/errors}/HttpError.ts +0 -0
- /package/src/server/{errors → core/errors}/NotFoundError.ts +0 -0
- /package/src/server/{errors → core/errors}/UnauthorizedError.ts +0 -0
- /package/src/server/{errors → core/errors}/ValidationError.ts +0 -0
- /package/src/server/{helpers → core/helpers}/ServerReply.ts +0 -0
- /package/src/server/{helpers → core/helpers}/isMultipart.ts +0 -0
- /package/src/server/{index.browser.ts → core/index.browser.ts} +0 -0
- /package/src/server/{index.shared.ts → core/index.shared.ts} +0 -0
- /package/src/server/{interfaces → core/interfaces}/ServerRequest.ts +0 -0
- /package/src/server/{primitives → core/primitives}/$route.ts +0 -0
- /package/src/server/{providers → core/providers}/BunHttpServerProvider.ts +0 -0
- /package/src/server/{providers → core/providers}/NodeHttpServerProvider.ts +0 -0
- /package/src/server/{providers → core/providers}/ServerLoggerProvider.ts +0 -0
- /package/src/server/{providers → core/providers}/ServerNotReadyProvider.ts +0 -0
- /package/src/server/{providers → core/providers}/ServerProvider.ts +0 -0
- /package/src/server/{providers → core/providers}/ServerTimingProvider.ts +0 -0
- /package/src/server/{schemas → core/schemas}/errorSchema.ts +0 -0
- /package/src/server/{schemas → core/schemas}/okSchema.ts +0 -0
- /package/src/server/{services → core/services}/HttpClient.ts +0 -0
- /package/src/server/{services → core/services}/ServerRequestParser.ts +0 -0
- /package/src/server/{services → core/services}/UserAgentParser.ts +0 -0
- /package/src/{server-cors → server/cors}/index.ts +0 -0
- /package/src/{server-cors → server/cors}/primitives/$cors.ts +0 -0
- /package/src/{server-cors → server/cors}/providers/ServerCorsProvider.ts +0 -0
- /package/src/{server-health → server/health}/index.ts +0 -0
- /package/src/{server-health → server/health}/providers/ServerHealthProvider.ts +0 -0
- /package/src/{server-health → server/health}/schemas/healthSchema.ts +0 -0
- /package/src/{server-helmet → server/helmet}/index.ts +0 -0
- /package/src/{server-helmet → server/helmet}/providers/ServerHelmetProvider.ts +0 -0
- /package/src/{server-links → server/links}/index.browser.ts +0 -0
- /package/src/{server-links → server/links}/index.ts +0 -0
- /package/src/{server-links → server/links}/primitives/$client.ts +0 -0
- /package/src/{server-links → server/links}/primitives/$remote.ts +0 -0
- /package/src/{server-links → server/links}/providers/LinkProvider.ts +0 -0
- /package/src/{server-links → server/links}/providers/RemotePrimitiveProvider.ts +0 -0
- /package/src/{server-links → server/links}/providers/ServerLinksProvider.ts +0 -0
- /package/src/{server-links → server/links}/schemas/apiLinksResponseSchema.ts +0 -0
- /package/src/{server-metrics → server/metrics}/index.ts +0 -0
- /package/src/{server-metrics → server/metrics}/providers/ServerMetricsProvider.ts +0 -0
- /package/src/{server-multipart → server/multipart}/index.ts +0 -0
- /package/src/{server-multipart → server/multipart}/providers/ServerMultipartProvider.ts +0 -0
- /package/src/{server-proxy → server/proxy}/index.ts +0 -0
- /package/src/{server-proxy → server/proxy}/primitives/$proxy.ts +0 -0
- /package/src/{server-proxy → server/proxy}/providers/ServerProxyProvider.ts +0 -0
- /package/src/{server-rate-limit → server/rate-limit}/primitives/$rateLimit.ts +0 -0
- /package/src/{server-rate-limit → server/rate-limit}/providers/ServerRateLimitProvider.ts +0 -0
- /package/src/{server-security → server/security}/index.browser.ts +0 -0
- /package/src/{server-security → server/security}/index.ts +0 -0
- /package/src/{server-security → server/security}/primitives/$basicAuth.ts +0 -0
- /package/src/{server-security → server/security}/providers/ServerBasicAuthProvider.ts +0 -0
- /package/src/{server-security → server/security}/providers/ServerSecurityProvider.ts +0 -0
- /package/src/{server-static → server/static}/index.ts +0 -0
- /package/src/{server-static → server/static}/primitives/$serve.ts +0 -0
- /package/src/{server-static → server/static}/providers/ServerStaticProvider.ts +0 -0
- /package/src/{server-swagger → server/swagger}/index.ts +0 -0
- /package/src/{server-swagger → server/swagger}/primitives/$swagger.ts +0 -0
- /package/src/topic/{errors → core/errors}/TopicTimeoutError.ts +0 -0
- /package/src/topic/{index.ts → core/index.ts} +0 -0
- /package/src/topic/{primitives → core/primitives}/$subscriber.ts +0 -0
- /package/src/topic/{primitives → core/primitives}/$topic.ts +0 -0
- /package/src/topic/{providers → core/providers}/MemoryTopicProvider.ts +0 -0
- /package/src/topic/{providers → core/providers}/TopicProvider.ts +0 -0
- /package/src/{topic-redis → topic/redis}/index.ts +0 -0
- /package/src/{topic-redis → topic/redis}/providers/RedisTopicProvider.ts +0 -0
|
@@ -1,2770 +0,0 @@
|
|
|
1
|
-
import "vite/module-runner";
|
|
2
|
-
|
|
3
|
-
//#region rolldown:runtime
|
|
4
|
-
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region ../../../../node_modules/tinyrainbow/dist/index.js
|
|
8
|
-
var d = {
|
|
9
|
-
reset: [0, 0],
|
|
10
|
-
bold: [
|
|
11
|
-
1,
|
|
12
|
-
22,
|
|
13
|
-
"\x1B[22m\x1B[1m"
|
|
14
|
-
],
|
|
15
|
-
dim: [
|
|
16
|
-
2,
|
|
17
|
-
22,
|
|
18
|
-
"\x1B[22m\x1B[2m"
|
|
19
|
-
],
|
|
20
|
-
italic: [3, 23],
|
|
21
|
-
underline: [4, 24],
|
|
22
|
-
inverse: [7, 27],
|
|
23
|
-
hidden: [8, 28],
|
|
24
|
-
strikethrough: [9, 29],
|
|
25
|
-
black: [30, 39],
|
|
26
|
-
red: [31, 39],
|
|
27
|
-
green: [32, 39],
|
|
28
|
-
yellow: [33, 39],
|
|
29
|
-
blue: [34, 39],
|
|
30
|
-
magenta: [35, 39],
|
|
31
|
-
cyan: [36, 39],
|
|
32
|
-
white: [37, 39],
|
|
33
|
-
gray: [90, 39],
|
|
34
|
-
bgBlack: [40, 49],
|
|
35
|
-
bgRed: [41, 49],
|
|
36
|
-
bgGreen: [42, 49],
|
|
37
|
-
bgYellow: [43, 49],
|
|
38
|
-
bgBlue: [44, 49],
|
|
39
|
-
bgMagenta: [45, 49],
|
|
40
|
-
bgCyan: [46, 49],
|
|
41
|
-
bgWhite: [47, 49],
|
|
42
|
-
blackBright: [90, 39],
|
|
43
|
-
redBright: [91, 39],
|
|
44
|
-
greenBright: [92, 39],
|
|
45
|
-
yellowBright: [93, 39],
|
|
46
|
-
blueBright: [94, 39],
|
|
47
|
-
magentaBright: [95, 39],
|
|
48
|
-
cyanBright: [96, 39],
|
|
49
|
-
whiteBright: [97, 39],
|
|
50
|
-
bgBlackBright: [100, 49],
|
|
51
|
-
bgRedBright: [101, 49],
|
|
52
|
-
bgGreenBright: [102, 49],
|
|
53
|
-
bgYellowBright: [103, 49],
|
|
54
|
-
bgBlueBright: [104, 49],
|
|
55
|
-
bgMagentaBright: [105, 49],
|
|
56
|
-
bgCyanBright: [106, 49],
|
|
57
|
-
bgWhiteBright: [107, 49]
|
|
58
|
-
};
|
|
59
|
-
function g(e) {
|
|
60
|
-
return String(e);
|
|
61
|
-
}
|
|
62
|
-
g.open = "";
|
|
63
|
-
g.close = "";
|
|
64
|
-
function h() {
|
|
65
|
-
let e = typeof process != "undefined" ? process : void 0, n = (e == null ? void 0 : e.env) || {}, a = n.FORCE_TTY !== "false", i = (e == null ? void 0 : e.argv) || [];
|
|
66
|
-
return !("NO_COLOR" in n || i.includes("--no-color")) && ("FORCE_COLOR" in n || i.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || a && n.TERM !== "dumb" || "CI" in n) || typeof window != "undefined" && !!window.chrome;
|
|
67
|
-
}
|
|
68
|
-
function f() {
|
|
69
|
-
let e = h(), n = (r, t, u, o) => {
|
|
70
|
-
let l = "", s = 0;
|
|
71
|
-
do
|
|
72
|
-
l += r.substring(s, o) + u, s = o + t.length, o = r.indexOf(t, s);
|
|
73
|
-
while (~o);
|
|
74
|
-
return l + r.substring(s);
|
|
75
|
-
}, a = (r, t, u = r) => {
|
|
76
|
-
let o = (l) => {
|
|
77
|
-
let s = String(l), b = s.indexOf(t, r.length);
|
|
78
|
-
return ~b ? r + n(s, t, u, b) + t : r + s + t;
|
|
79
|
-
};
|
|
80
|
-
return o.open = r, o.close = t, o;
|
|
81
|
-
}, i = { isColorSupported: e }, c = (r) => `\x1B[${r}m`;
|
|
82
|
-
for (let r in d) {
|
|
83
|
-
let t = d[r];
|
|
84
|
-
i[r] = e ? a(c(t[0]), c(t[1]), t[2]) : g;
|
|
85
|
-
}
|
|
86
|
-
return i;
|
|
87
|
-
}
|
|
88
|
-
var C = f();
|
|
89
|
-
|
|
90
|
-
//#endregion
|
|
91
|
-
//#region ../../../../node_modules/@vitest/pretty-format/dist/index.js
|
|
92
|
-
function _mergeNamespaces(n, m) {
|
|
93
|
-
m.forEach(function(e) {
|
|
94
|
-
e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
|
|
95
|
-
if (k !== "default" && !(k in n)) {
|
|
96
|
-
var d$1 = Object.getOwnPropertyDescriptor(e, k);
|
|
97
|
-
Object.defineProperty(n, k, d$1.get ? d$1 : {
|
|
98
|
-
enumerable: true,
|
|
99
|
-
get: function() {
|
|
100
|
-
return e[k];
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
return Object.freeze(n);
|
|
107
|
-
}
|
|
108
|
-
function getKeysOfEnumerableProperties(object, compareKeys) {
|
|
109
|
-
const rawKeys = Object.keys(object);
|
|
110
|
-
const keys = compareKeys === null ? rawKeys : rawKeys.sort(compareKeys);
|
|
111
|
-
if (Object.getOwnPropertySymbols) {
|
|
112
|
-
for (const symbol of Object.getOwnPropertySymbols(object)) if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) keys.push(symbol);
|
|
113
|
-
}
|
|
114
|
-
return keys;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Return entries (for example, of a map)
|
|
118
|
-
* with spacing, indentation, and comma
|
|
119
|
-
* without surrounding punctuation (for example, braces)
|
|
120
|
-
*/
|
|
121
|
-
function printIteratorEntries(iterator, config, indentation, depth, refs, printer, separator = ": ") {
|
|
122
|
-
let result = "";
|
|
123
|
-
let width = 0;
|
|
124
|
-
let current = iterator.next();
|
|
125
|
-
if (!current.done) {
|
|
126
|
-
result += config.spacingOuter;
|
|
127
|
-
const indentationNext = indentation + config.indent;
|
|
128
|
-
while (!current.done) {
|
|
129
|
-
result += indentationNext;
|
|
130
|
-
if (width++ === config.maxWidth) {
|
|
131
|
-
result += "…";
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
const name = printer(current.value[0], config, indentationNext, depth, refs);
|
|
135
|
-
const value = printer(current.value[1], config, indentationNext, depth, refs);
|
|
136
|
-
result += name + separator + value;
|
|
137
|
-
current = iterator.next();
|
|
138
|
-
if (!current.done) result += `,${config.spacingInner}`;
|
|
139
|
-
else if (!config.min) result += ",";
|
|
140
|
-
}
|
|
141
|
-
result += config.spacingOuter + indentation;
|
|
142
|
-
}
|
|
143
|
-
return result;
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Return values (for example, of a set)
|
|
147
|
-
* with spacing, indentation, and comma
|
|
148
|
-
* without surrounding punctuation (braces or brackets)
|
|
149
|
-
*/
|
|
150
|
-
function printIteratorValues(iterator, config, indentation, depth, refs, printer) {
|
|
151
|
-
let result = "";
|
|
152
|
-
let width = 0;
|
|
153
|
-
let current = iterator.next();
|
|
154
|
-
if (!current.done) {
|
|
155
|
-
result += config.spacingOuter;
|
|
156
|
-
const indentationNext = indentation + config.indent;
|
|
157
|
-
while (!current.done) {
|
|
158
|
-
result += indentationNext;
|
|
159
|
-
if (width++ === config.maxWidth) {
|
|
160
|
-
result += "…";
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
result += printer(current.value, config, indentationNext, depth, refs);
|
|
164
|
-
current = iterator.next();
|
|
165
|
-
if (!current.done) result += `,${config.spacingInner}`;
|
|
166
|
-
else if (!config.min) result += ",";
|
|
167
|
-
}
|
|
168
|
-
result += config.spacingOuter + indentation;
|
|
169
|
-
}
|
|
170
|
-
return result;
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Return items (for example, of an array)
|
|
174
|
-
* with spacing, indentation, and comma
|
|
175
|
-
* without surrounding punctuation (for example, brackets)
|
|
176
|
-
*/
|
|
177
|
-
function printListItems(list, config, indentation, depth, refs, printer) {
|
|
178
|
-
let result = "";
|
|
179
|
-
list = list instanceof ArrayBuffer ? new DataView(list) : list;
|
|
180
|
-
const isDataView = (l) => l instanceof DataView;
|
|
181
|
-
const length = isDataView(list) ? list.byteLength : list.length;
|
|
182
|
-
if (length > 0) {
|
|
183
|
-
result += config.spacingOuter;
|
|
184
|
-
const indentationNext = indentation + config.indent;
|
|
185
|
-
for (let i = 0; i < length; i++) {
|
|
186
|
-
result += indentationNext;
|
|
187
|
-
if (i === config.maxWidth) {
|
|
188
|
-
result += "…";
|
|
189
|
-
break;
|
|
190
|
-
}
|
|
191
|
-
if (isDataView(list) || i in list) result += printer(isDataView(list) ? list.getInt8(i) : list[i], config, indentationNext, depth, refs);
|
|
192
|
-
if (i < length - 1) result += `,${config.spacingInner}`;
|
|
193
|
-
else if (!config.min) result += ",";
|
|
194
|
-
}
|
|
195
|
-
result += config.spacingOuter + indentation;
|
|
196
|
-
}
|
|
197
|
-
return result;
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Return properties of an object
|
|
201
|
-
* with spacing, indentation, and comma
|
|
202
|
-
* without surrounding punctuation (for example, braces)
|
|
203
|
-
*/
|
|
204
|
-
function printObjectProperties(val, config, indentation, depth, refs, printer) {
|
|
205
|
-
let result = "";
|
|
206
|
-
const keys = getKeysOfEnumerableProperties(val, config.compareKeys);
|
|
207
|
-
if (keys.length > 0) {
|
|
208
|
-
result += config.spacingOuter;
|
|
209
|
-
const indentationNext = indentation + config.indent;
|
|
210
|
-
for (let i = 0; i < keys.length; i++) {
|
|
211
|
-
const key = keys[i];
|
|
212
|
-
const name = printer(key, config, indentationNext, depth, refs);
|
|
213
|
-
const value = printer(val[key], config, indentationNext, depth, refs);
|
|
214
|
-
result += `${indentationNext + name}: ${value}`;
|
|
215
|
-
if (i < keys.length - 1) result += `,${config.spacingInner}`;
|
|
216
|
-
else if (!config.min) result += ",";
|
|
217
|
-
}
|
|
218
|
-
result += config.spacingOuter + indentation;
|
|
219
|
-
}
|
|
220
|
-
return result;
|
|
221
|
-
}
|
|
222
|
-
const asymmetricMatcher = typeof Symbol === "function" && Symbol.for ? Symbol.for("jest.asymmetricMatcher") : 1267621;
|
|
223
|
-
const SPACE$2 = " ";
|
|
224
|
-
const serialize$5 = (val, config, indentation, depth, refs, printer) => {
|
|
225
|
-
const stringedValue = val.toString();
|
|
226
|
-
if (stringedValue === "ArrayContaining" || stringedValue === "ArrayNotContaining") {
|
|
227
|
-
if (++depth > config.maxDepth) return `[${stringedValue}]`;
|
|
228
|
-
return `${stringedValue + SPACE$2}[${printListItems(val.sample, config, indentation, depth, refs, printer)}]`;
|
|
229
|
-
}
|
|
230
|
-
if (stringedValue === "ObjectContaining" || stringedValue === "ObjectNotContaining") {
|
|
231
|
-
if (++depth > config.maxDepth) return `[${stringedValue}]`;
|
|
232
|
-
return `${stringedValue + SPACE$2}{${printObjectProperties(val.sample, config, indentation, depth, refs, printer)}}`;
|
|
233
|
-
}
|
|
234
|
-
if (stringedValue === "StringMatching" || stringedValue === "StringNotMatching") return stringedValue + SPACE$2 + printer(val.sample, config, indentation, depth, refs);
|
|
235
|
-
if (stringedValue === "StringContaining" || stringedValue === "StringNotContaining") return stringedValue + SPACE$2 + printer(val.sample, config, indentation, depth, refs);
|
|
236
|
-
if (typeof val.toAsymmetricMatcher !== "function") throw new TypeError(`Asymmetric matcher ${val.constructor.name} does not implement toAsymmetricMatcher()`);
|
|
237
|
-
return val.toAsymmetricMatcher();
|
|
238
|
-
};
|
|
239
|
-
const test$5 = (val) => val && val.$$typeof === asymmetricMatcher;
|
|
240
|
-
const plugin$5 = {
|
|
241
|
-
serialize: serialize$5,
|
|
242
|
-
test: test$5
|
|
243
|
-
};
|
|
244
|
-
const SPACE$1 = " ";
|
|
245
|
-
const OBJECT_NAMES = new Set(["DOMStringMap", "NamedNodeMap"]);
|
|
246
|
-
const ARRAY_REGEXP = /^(?:HTML\w*Collection|NodeList)$/;
|
|
247
|
-
function testName(name) {
|
|
248
|
-
return OBJECT_NAMES.has(name) || ARRAY_REGEXP.test(name);
|
|
249
|
-
}
|
|
250
|
-
const test$4 = (val) => val && val.constructor && !!val.constructor.name && testName(val.constructor.name);
|
|
251
|
-
function isNamedNodeMap(collection) {
|
|
252
|
-
return collection.constructor.name === "NamedNodeMap";
|
|
253
|
-
}
|
|
254
|
-
const serialize$4 = (collection, config, indentation, depth, refs, printer) => {
|
|
255
|
-
const name = collection.constructor.name;
|
|
256
|
-
if (++depth > config.maxDepth) return `[${name}]`;
|
|
257
|
-
return (config.min ? "" : name + SPACE$1) + (OBJECT_NAMES.has(name) ? `{${printObjectProperties(isNamedNodeMap(collection) ? [...collection].reduce((props, attribute) => {
|
|
258
|
-
props[attribute.name] = attribute.value;
|
|
259
|
-
return props;
|
|
260
|
-
}, {}) : { ...collection }, config, indentation, depth, refs, printer)}}` : `[${printListItems([...collection], config, indentation, depth, refs, printer)}]`);
|
|
261
|
-
};
|
|
262
|
-
const plugin$4 = {
|
|
263
|
-
serialize: serialize$4,
|
|
264
|
-
test: test$4
|
|
265
|
-
};
|
|
266
|
-
/**
|
|
267
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
268
|
-
*
|
|
269
|
-
* This source code is licensed under the MIT license found in the
|
|
270
|
-
* LICENSE file in the root directory of this source tree.
|
|
271
|
-
*/
|
|
272
|
-
function escapeHTML(str) {
|
|
273
|
-
return str.replaceAll("<", "<").replaceAll(">", ">");
|
|
274
|
-
}
|
|
275
|
-
function printProps(keys, props, config, indentation, depth, refs, printer) {
|
|
276
|
-
const indentationNext = indentation + config.indent;
|
|
277
|
-
const colors = config.colors;
|
|
278
|
-
return keys.map((key) => {
|
|
279
|
-
const value = props[key];
|
|
280
|
-
let printed = printer(value, config, indentationNext, depth, refs);
|
|
281
|
-
if (typeof value !== "string") {
|
|
282
|
-
if (printed.includes("\n")) printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;
|
|
283
|
-
printed = `{${printed}}`;
|
|
284
|
-
}
|
|
285
|
-
return `${config.spacingInner + indentation + colors.prop.open + key + colors.prop.close}=${colors.value.open}${printed}${colors.value.close}`;
|
|
286
|
-
}).join("");
|
|
287
|
-
}
|
|
288
|
-
function printChildren(children, config, indentation, depth, refs, printer) {
|
|
289
|
-
return children.map((child) => config.spacingOuter + indentation + (typeof child === "string" ? printText(child, config) : printer(child, config, indentation, depth, refs))).join("");
|
|
290
|
-
}
|
|
291
|
-
function printShadowRoot(children, config, indentation, depth, refs, printer) {
|
|
292
|
-
if (config.printShadowRoot === false) return "";
|
|
293
|
-
return [`${config.spacingOuter + indentation}#shadow-root`, printChildren(children, config, indentation + config.indent, depth, refs, printer)].join("");
|
|
294
|
-
}
|
|
295
|
-
function printText(text, config) {
|
|
296
|
-
const contentColor = config.colors.content;
|
|
297
|
-
return contentColor.open + escapeHTML(text) + contentColor.close;
|
|
298
|
-
}
|
|
299
|
-
function printComment(comment, config) {
|
|
300
|
-
const commentColor = config.colors.comment;
|
|
301
|
-
return `${commentColor.open}<!--${escapeHTML(comment)}-->${commentColor.close}`;
|
|
302
|
-
}
|
|
303
|
-
function printElement(type, printedProps, printedChildren, config, indentation) {
|
|
304
|
-
const tagColor = config.colors.tag;
|
|
305
|
-
return `${tagColor.open}<${type}${printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open}${printedChildren ? `>${tagColor.close}${printedChildren}${config.spacingOuter}${indentation}${tagColor.open}</${type}` : `${printedProps && !config.min ? "" : " "}/`}>${tagColor.close}`;
|
|
306
|
-
}
|
|
307
|
-
function printElementAsLeaf(type, config) {
|
|
308
|
-
const tagColor = config.colors.tag;
|
|
309
|
-
return `${tagColor.open}<${type}${tagColor.close} …${tagColor.open} />${tagColor.close}`;
|
|
310
|
-
}
|
|
311
|
-
const ELEMENT_NODE = 1;
|
|
312
|
-
const TEXT_NODE = 3;
|
|
313
|
-
const COMMENT_NODE = 8;
|
|
314
|
-
const FRAGMENT_NODE = 11;
|
|
315
|
-
const ELEMENT_REGEXP = /^(?:(?:HTML|SVG)\w*)?Element$/;
|
|
316
|
-
function testHasAttribute(val) {
|
|
317
|
-
try {
|
|
318
|
-
return typeof val.hasAttribute === "function" && val.hasAttribute("is");
|
|
319
|
-
} catch {
|
|
320
|
-
return false;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
function testNode(val) {
|
|
324
|
-
const constructorName = val.constructor.name;
|
|
325
|
-
const { nodeType, tagName } = val;
|
|
326
|
-
const isCustomElement = typeof tagName === "string" && tagName.includes("-") || testHasAttribute(val);
|
|
327
|
-
return nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement) || nodeType === TEXT_NODE && constructorName === "Text" || nodeType === COMMENT_NODE && constructorName === "Comment" || nodeType === FRAGMENT_NODE && constructorName === "DocumentFragment";
|
|
328
|
-
}
|
|
329
|
-
const test$3 = (val) => val?.constructor?.name && testNode(val);
|
|
330
|
-
function nodeIsText(node) {
|
|
331
|
-
return node.nodeType === TEXT_NODE;
|
|
332
|
-
}
|
|
333
|
-
function nodeIsComment(node) {
|
|
334
|
-
return node.nodeType === COMMENT_NODE;
|
|
335
|
-
}
|
|
336
|
-
function nodeIsFragment(node) {
|
|
337
|
-
return node.nodeType === FRAGMENT_NODE;
|
|
338
|
-
}
|
|
339
|
-
const serialize$3 = (node, config, indentation, depth, refs, printer) => {
|
|
340
|
-
if (nodeIsText(node)) return printText(node.data, config);
|
|
341
|
-
if (nodeIsComment(node)) return printComment(node.data, config);
|
|
342
|
-
const type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase();
|
|
343
|
-
if (++depth > config.maxDepth) return printElementAsLeaf(type, config);
|
|
344
|
-
return printElement(type, printProps(nodeIsFragment(node) ? [] : Array.from(node.attributes, (attr) => attr.name).sort(), nodeIsFragment(node) ? {} : [...node.attributes].reduce((props, attribute) => {
|
|
345
|
-
props[attribute.name] = attribute.value;
|
|
346
|
-
return props;
|
|
347
|
-
}, {}), config, indentation + config.indent, depth, refs, printer), (nodeIsFragment(node) || !node.shadowRoot ? "" : printShadowRoot(Array.prototype.slice.call(node.shadowRoot.children), config, indentation + config.indent, depth, refs, printer)) + printChildren(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
|
|
348
|
-
};
|
|
349
|
-
const plugin$3 = {
|
|
350
|
-
serialize: serialize$3,
|
|
351
|
-
test: test$3
|
|
352
|
-
};
|
|
353
|
-
const IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
354
|
-
const IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@";
|
|
355
|
-
const IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
|
|
356
|
-
const IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@";
|
|
357
|
-
const IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
|
|
358
|
-
const IS_RECORD_SENTINEL = "@@__IMMUTABLE_RECORD__@@";
|
|
359
|
-
const IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@";
|
|
360
|
-
const IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
|
|
361
|
-
const IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@";
|
|
362
|
-
const getImmutableName = (name) => `Immutable.${name}`;
|
|
363
|
-
const printAsLeaf = (name) => `[${name}]`;
|
|
364
|
-
const SPACE = " ";
|
|
365
|
-
const LAZY = "…";
|
|
366
|
-
function printImmutableEntries(val, config, indentation, depth, refs, printer, type) {
|
|
367
|
-
return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}{${printIteratorEntries(val.entries(), config, indentation, depth, refs, printer)}}`;
|
|
368
|
-
}
|
|
369
|
-
function getRecordEntries(val) {
|
|
370
|
-
let i = 0;
|
|
371
|
-
return { next() {
|
|
372
|
-
if (i < val._keys.length) {
|
|
373
|
-
const key = val._keys[i++];
|
|
374
|
-
return {
|
|
375
|
-
done: false,
|
|
376
|
-
value: [key, val.get(key)]
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
return {
|
|
380
|
-
done: true,
|
|
381
|
-
value: void 0
|
|
382
|
-
};
|
|
383
|
-
} };
|
|
384
|
-
}
|
|
385
|
-
function printImmutableRecord(val, config, indentation, depth, refs, printer) {
|
|
386
|
-
const name = getImmutableName(val._name || "Record");
|
|
387
|
-
return ++depth > config.maxDepth ? printAsLeaf(name) : `${name + SPACE}{${printIteratorEntries(getRecordEntries(val), config, indentation, depth, refs, printer)}}`;
|
|
388
|
-
}
|
|
389
|
-
function printImmutableSeq(val, config, indentation, depth, refs, printer) {
|
|
390
|
-
const name = getImmutableName("Seq");
|
|
391
|
-
if (++depth > config.maxDepth) return printAsLeaf(name);
|
|
392
|
-
if (val[IS_KEYED_SENTINEL]) return `${name + SPACE}{${val._iter || val._object ? printIteratorEntries(val.entries(), config, indentation, depth, refs, printer) : LAZY}}`;
|
|
393
|
-
return `${name + SPACE}[${val._iter || val._array || val._collection || val._iterable ? printIteratorValues(val.values(), config, indentation, depth, refs, printer) : LAZY}]`;
|
|
394
|
-
}
|
|
395
|
-
function printImmutableValues(val, config, indentation, depth, refs, printer, type) {
|
|
396
|
-
return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}[${printIteratorValues(val.values(), config, indentation, depth, refs, printer)}]`;
|
|
397
|
-
}
|
|
398
|
-
const serialize$2 = (val, config, indentation, depth, refs, printer) => {
|
|
399
|
-
if (val[IS_MAP_SENTINEL]) return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedMap" : "Map");
|
|
400
|
-
if (val[IS_LIST_SENTINEL]) return printImmutableValues(val, config, indentation, depth, refs, printer, "List");
|
|
401
|
-
if (val[IS_SET_SENTINEL]) return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedSet" : "Set");
|
|
402
|
-
if (val[IS_STACK_SENTINEL]) return printImmutableValues(val, config, indentation, depth, refs, printer, "Stack");
|
|
403
|
-
if (val[IS_SEQ_SENTINEL]) return printImmutableSeq(val, config, indentation, depth, refs, printer);
|
|
404
|
-
return printImmutableRecord(val, config, indentation, depth, refs, printer);
|
|
405
|
-
};
|
|
406
|
-
const test$2 = (val) => val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
|
|
407
|
-
const plugin$2 = {
|
|
408
|
-
serialize: serialize$2,
|
|
409
|
-
test: test$2
|
|
410
|
-
};
|
|
411
|
-
function getDefaultExportFromCjs(x) {
|
|
412
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
413
|
-
}
|
|
414
|
-
var reactIs$1 = { exports: {} };
|
|
415
|
-
var reactIs_production = {};
|
|
416
|
-
/**
|
|
417
|
-
* @license React
|
|
418
|
-
* react-is.production.js
|
|
419
|
-
*
|
|
420
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
421
|
-
*
|
|
422
|
-
* This source code is licensed under the MIT license found in the
|
|
423
|
-
* LICENSE file in the root directory of this source tree.
|
|
424
|
-
*/
|
|
425
|
-
var hasRequiredReactIs_production;
|
|
426
|
-
function requireReactIs_production() {
|
|
427
|
-
if (hasRequiredReactIs_production) return reactIs_production;
|
|
428
|
-
hasRequiredReactIs_production = 1;
|
|
429
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
430
|
-
function typeOf(object) {
|
|
431
|
-
if ("object" === typeof object && null !== object) {
|
|
432
|
-
var $$typeof = object.$$typeof;
|
|
433
|
-
switch ($$typeof) {
|
|
434
|
-
case REACT_ELEMENT_TYPE: switch (object = object.type, object) {
|
|
435
|
-
case REACT_FRAGMENT_TYPE:
|
|
436
|
-
case REACT_PROFILER_TYPE:
|
|
437
|
-
case REACT_STRICT_MODE_TYPE:
|
|
438
|
-
case REACT_SUSPENSE_TYPE:
|
|
439
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
440
|
-
case REACT_VIEW_TRANSITION_TYPE: return object;
|
|
441
|
-
default: switch (object = object && object.$$typeof, object) {
|
|
442
|
-
case REACT_CONTEXT_TYPE:
|
|
443
|
-
case REACT_FORWARD_REF_TYPE:
|
|
444
|
-
case REACT_LAZY_TYPE:
|
|
445
|
-
case REACT_MEMO_TYPE: return object;
|
|
446
|
-
case REACT_CONSUMER_TYPE: return object;
|
|
447
|
-
default: return $$typeof;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
case REACT_PORTAL_TYPE: return $$typeof;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
reactIs_production.ContextConsumer = REACT_CONSUMER_TYPE;
|
|
455
|
-
reactIs_production.ContextProvider = REACT_CONTEXT_TYPE;
|
|
456
|
-
reactIs_production.Element = REACT_ELEMENT_TYPE;
|
|
457
|
-
reactIs_production.ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
458
|
-
reactIs_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
459
|
-
reactIs_production.Lazy = REACT_LAZY_TYPE;
|
|
460
|
-
reactIs_production.Memo = REACT_MEMO_TYPE;
|
|
461
|
-
reactIs_production.Portal = REACT_PORTAL_TYPE;
|
|
462
|
-
reactIs_production.Profiler = REACT_PROFILER_TYPE;
|
|
463
|
-
reactIs_production.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
464
|
-
reactIs_production.Suspense = REACT_SUSPENSE_TYPE;
|
|
465
|
-
reactIs_production.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
466
|
-
reactIs_production.isContextConsumer = function(object) {
|
|
467
|
-
return typeOf(object) === REACT_CONSUMER_TYPE;
|
|
468
|
-
};
|
|
469
|
-
reactIs_production.isContextProvider = function(object) {
|
|
470
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
471
|
-
};
|
|
472
|
-
reactIs_production.isElement = function(object) {
|
|
473
|
-
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
474
|
-
};
|
|
475
|
-
reactIs_production.isForwardRef = function(object) {
|
|
476
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
477
|
-
};
|
|
478
|
-
reactIs_production.isFragment = function(object) {
|
|
479
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
480
|
-
};
|
|
481
|
-
reactIs_production.isLazy = function(object) {
|
|
482
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
483
|
-
};
|
|
484
|
-
reactIs_production.isMemo = function(object) {
|
|
485
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
486
|
-
};
|
|
487
|
-
reactIs_production.isPortal = function(object) {
|
|
488
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
489
|
-
};
|
|
490
|
-
reactIs_production.isProfiler = function(object) {
|
|
491
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
492
|
-
};
|
|
493
|
-
reactIs_production.isStrictMode = function(object) {
|
|
494
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
495
|
-
};
|
|
496
|
-
reactIs_production.isSuspense = function(object) {
|
|
497
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
498
|
-
};
|
|
499
|
-
reactIs_production.isSuspenseList = function(object) {
|
|
500
|
-
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
501
|
-
};
|
|
502
|
-
reactIs_production.isValidElementType = function(type) {
|
|
503
|
-
return "string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || "object" === typeof type && null !== type && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type.getModuleId) ? true : false;
|
|
504
|
-
};
|
|
505
|
-
reactIs_production.typeOf = typeOf;
|
|
506
|
-
return reactIs_production;
|
|
507
|
-
}
|
|
508
|
-
var hasRequiredReactIs$1;
|
|
509
|
-
function requireReactIs$1() {
|
|
510
|
-
if (hasRequiredReactIs$1) return reactIs$1.exports;
|
|
511
|
-
hasRequiredReactIs$1 = 1;
|
|
512
|
-
reactIs$1.exports = requireReactIs_production();
|
|
513
|
-
return reactIs$1.exports;
|
|
514
|
-
}
|
|
515
|
-
var reactIsExports$1 = requireReactIs$1();
|
|
516
|
-
var ReactIs19 = /* @__PURE__ */ _mergeNamespaces({
|
|
517
|
-
__proto__: null,
|
|
518
|
-
default: /* @__PURE__ */ getDefaultExportFromCjs(reactIsExports$1)
|
|
519
|
-
}, [reactIsExports$1]);
|
|
520
|
-
var reactIs = { exports: {} };
|
|
521
|
-
var reactIs_production_min = {};
|
|
522
|
-
/**
|
|
523
|
-
* @license React
|
|
524
|
-
* react-is.production.min.js
|
|
525
|
-
*
|
|
526
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
527
|
-
*
|
|
528
|
-
* This source code is licensed under the MIT license found in the
|
|
529
|
-
* LICENSE file in the root directory of this source tree.
|
|
530
|
-
*/
|
|
531
|
-
var hasRequiredReactIs_production_min;
|
|
532
|
-
function requireReactIs_production_min() {
|
|
533
|
-
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
534
|
-
hasRequiredReactIs_production_min = 1;
|
|
535
|
-
var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d$1 = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f$1 = Symbol.for("react.profiler"), g$1 = Symbol.for("react.provider"), h$1 = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u = Symbol.for("react.module.reference");
|
|
536
|
-
function v(a) {
|
|
537
|
-
if ("object" === typeof a && null !== a) {
|
|
538
|
-
var r = a.$$typeof;
|
|
539
|
-
switch (r) {
|
|
540
|
-
case b: switch (a = a.type, a) {
|
|
541
|
-
case d$1:
|
|
542
|
-
case f$1:
|
|
543
|
-
case e:
|
|
544
|
-
case m:
|
|
545
|
-
case n: return a;
|
|
546
|
-
default: switch (a = a && a.$$typeof, a) {
|
|
547
|
-
case k:
|
|
548
|
-
case h$1:
|
|
549
|
-
case l:
|
|
550
|
-
case q:
|
|
551
|
-
case p:
|
|
552
|
-
case g$1: return a;
|
|
553
|
-
default: return r;
|
|
554
|
-
}
|
|
555
|
-
}
|
|
556
|
-
case c: return r;
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
reactIs_production_min.ContextConsumer = h$1;
|
|
561
|
-
reactIs_production_min.ContextProvider = g$1;
|
|
562
|
-
reactIs_production_min.Element = b;
|
|
563
|
-
reactIs_production_min.ForwardRef = l;
|
|
564
|
-
reactIs_production_min.Fragment = d$1;
|
|
565
|
-
reactIs_production_min.Lazy = q;
|
|
566
|
-
reactIs_production_min.Memo = p;
|
|
567
|
-
reactIs_production_min.Portal = c;
|
|
568
|
-
reactIs_production_min.Profiler = f$1;
|
|
569
|
-
reactIs_production_min.StrictMode = e;
|
|
570
|
-
reactIs_production_min.Suspense = m;
|
|
571
|
-
reactIs_production_min.SuspenseList = n;
|
|
572
|
-
reactIs_production_min.isAsyncMode = function() {
|
|
573
|
-
return false;
|
|
574
|
-
};
|
|
575
|
-
reactIs_production_min.isConcurrentMode = function() {
|
|
576
|
-
return false;
|
|
577
|
-
};
|
|
578
|
-
reactIs_production_min.isContextConsumer = function(a) {
|
|
579
|
-
return v(a) === h$1;
|
|
580
|
-
};
|
|
581
|
-
reactIs_production_min.isContextProvider = function(a) {
|
|
582
|
-
return v(a) === g$1;
|
|
583
|
-
};
|
|
584
|
-
reactIs_production_min.isElement = function(a) {
|
|
585
|
-
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
586
|
-
};
|
|
587
|
-
reactIs_production_min.isForwardRef = function(a) {
|
|
588
|
-
return v(a) === l;
|
|
589
|
-
};
|
|
590
|
-
reactIs_production_min.isFragment = function(a) {
|
|
591
|
-
return v(a) === d$1;
|
|
592
|
-
};
|
|
593
|
-
reactIs_production_min.isLazy = function(a) {
|
|
594
|
-
return v(a) === q;
|
|
595
|
-
};
|
|
596
|
-
reactIs_production_min.isMemo = function(a) {
|
|
597
|
-
return v(a) === p;
|
|
598
|
-
};
|
|
599
|
-
reactIs_production_min.isPortal = function(a) {
|
|
600
|
-
return v(a) === c;
|
|
601
|
-
};
|
|
602
|
-
reactIs_production_min.isProfiler = function(a) {
|
|
603
|
-
return v(a) === f$1;
|
|
604
|
-
};
|
|
605
|
-
reactIs_production_min.isStrictMode = function(a) {
|
|
606
|
-
return v(a) === e;
|
|
607
|
-
};
|
|
608
|
-
reactIs_production_min.isSuspense = function(a) {
|
|
609
|
-
return v(a) === m;
|
|
610
|
-
};
|
|
611
|
-
reactIs_production_min.isSuspenseList = function(a) {
|
|
612
|
-
return v(a) === n;
|
|
613
|
-
};
|
|
614
|
-
reactIs_production_min.isValidElementType = function(a) {
|
|
615
|
-
return "string" === typeof a || "function" === typeof a || a === d$1 || a === f$1 || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g$1 || a.$$typeof === h$1 || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
|
|
616
|
-
};
|
|
617
|
-
reactIs_production_min.typeOf = v;
|
|
618
|
-
return reactIs_production_min;
|
|
619
|
-
}
|
|
620
|
-
var hasRequiredReactIs;
|
|
621
|
-
function requireReactIs() {
|
|
622
|
-
if (hasRequiredReactIs) return reactIs.exports;
|
|
623
|
-
hasRequiredReactIs = 1;
|
|
624
|
-
reactIs.exports = requireReactIs_production_min();
|
|
625
|
-
return reactIs.exports;
|
|
626
|
-
}
|
|
627
|
-
var reactIsExports = requireReactIs();
|
|
628
|
-
var ReactIs18 = /* @__PURE__ */ _mergeNamespaces({
|
|
629
|
-
__proto__: null,
|
|
630
|
-
default: /* @__PURE__ */ getDefaultExportFromCjs(reactIsExports)
|
|
631
|
-
}, [reactIsExports]);
|
|
632
|
-
const ReactIs = Object.fromEntries([
|
|
633
|
-
"isAsyncMode",
|
|
634
|
-
"isConcurrentMode",
|
|
635
|
-
"isContextConsumer",
|
|
636
|
-
"isContextProvider",
|
|
637
|
-
"isElement",
|
|
638
|
-
"isForwardRef",
|
|
639
|
-
"isFragment",
|
|
640
|
-
"isLazy",
|
|
641
|
-
"isMemo",
|
|
642
|
-
"isPortal",
|
|
643
|
-
"isProfiler",
|
|
644
|
-
"isStrictMode",
|
|
645
|
-
"isSuspense",
|
|
646
|
-
"isSuspenseList",
|
|
647
|
-
"isValidElementType"
|
|
648
|
-
].map((m) => [m, (v) => ReactIs18[m](v) || ReactIs19[m](v)]));
|
|
649
|
-
function getChildren(arg, children = []) {
|
|
650
|
-
if (Array.isArray(arg)) for (const item of arg) getChildren(item, children);
|
|
651
|
-
else if (arg != null && arg !== false && arg !== "") children.push(arg);
|
|
652
|
-
return children;
|
|
653
|
-
}
|
|
654
|
-
function getType(element) {
|
|
655
|
-
const type = element.type;
|
|
656
|
-
if (typeof type === "string") return type;
|
|
657
|
-
if (typeof type === "function") return type.displayName || type.name || "Unknown";
|
|
658
|
-
if (ReactIs.isFragment(element)) return "React.Fragment";
|
|
659
|
-
if (ReactIs.isSuspense(element)) return "React.Suspense";
|
|
660
|
-
if (typeof type === "object" && type !== null) {
|
|
661
|
-
if (ReactIs.isContextProvider(element)) return "Context.Provider";
|
|
662
|
-
if (ReactIs.isContextConsumer(element)) return "Context.Consumer";
|
|
663
|
-
if (ReactIs.isForwardRef(element)) {
|
|
664
|
-
if (type.displayName) return type.displayName;
|
|
665
|
-
const functionName = type.render.displayName || type.render.name || "";
|
|
666
|
-
return functionName === "" ? "ForwardRef" : `ForwardRef(${functionName})`;
|
|
667
|
-
}
|
|
668
|
-
if (ReactIs.isMemo(element)) {
|
|
669
|
-
const functionName = type.displayName || type.type.displayName || type.type.name || "";
|
|
670
|
-
return functionName === "" ? "Memo" : `Memo(${functionName})`;
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
return "UNDEFINED";
|
|
674
|
-
}
|
|
675
|
-
function getPropKeys$1(element) {
|
|
676
|
-
const { props } = element;
|
|
677
|
-
return Object.keys(props).filter((key) => key !== "children" && props[key] !== void 0).sort();
|
|
678
|
-
}
|
|
679
|
-
const serialize$1 = (element, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? printElementAsLeaf(getType(element), config) : printElement(getType(element), printProps(getPropKeys$1(element), element.props, config, indentation + config.indent, depth, refs, printer), printChildren(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
|
|
680
|
-
const test$1 = (val) => val != null && ReactIs.isElement(val);
|
|
681
|
-
const plugin$1 = {
|
|
682
|
-
serialize: serialize$1,
|
|
683
|
-
test: test$1
|
|
684
|
-
};
|
|
685
|
-
const testSymbol = typeof Symbol === "function" && Symbol.for ? Symbol.for("react.test.json") : 245830487;
|
|
686
|
-
function getPropKeys(object) {
|
|
687
|
-
const { props } = object;
|
|
688
|
-
return props ? Object.keys(props).filter((key) => props[key] !== void 0).sort() : [];
|
|
689
|
-
}
|
|
690
|
-
const serialize = (object, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? printElementAsLeaf(object.type, config) : printElement(object.type, object.props ? printProps(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer) : "", object.children ? printChildren(object.children, config, indentation + config.indent, depth, refs, printer) : "", config, indentation);
|
|
691
|
-
const test$6 = (val) => val && val.$$typeof === testSymbol;
|
|
692
|
-
const plugin = {
|
|
693
|
-
serialize,
|
|
694
|
-
test: test$6
|
|
695
|
-
};
|
|
696
|
-
const toISOString = Date.prototype.toISOString;
|
|
697
|
-
const errorToString = Error.prototype.toString;
|
|
698
|
-
const regExpToString = RegExp.prototype.toString;
|
|
699
|
-
/**
|
|
700
|
-
* Explicitly comparing typeof constructor to function avoids undefined as name
|
|
701
|
-
* when mock identity-obj-proxy returns the key as the value for any key.
|
|
702
|
-
*/
|
|
703
|
-
function getConstructorName(val) {
|
|
704
|
-
return typeof val.constructor === "function" && val.constructor.name || "Object";
|
|
705
|
-
}
|
|
706
|
-
const ErrorPlugin = {
|
|
707
|
-
test: (val) => val && val instanceof Error,
|
|
708
|
-
serialize(val, config, indentation, depth, refs, printer) {
|
|
709
|
-
if (refs.includes(val)) return "[Circular]";
|
|
710
|
-
refs = [...refs, val];
|
|
711
|
-
const hitMaxDepth = ++depth > config.maxDepth;
|
|
712
|
-
const { message, cause, ...rest } = val;
|
|
713
|
-
const entries = {
|
|
714
|
-
message,
|
|
715
|
-
...typeof cause !== "undefined" ? { cause } : {},
|
|
716
|
-
...val instanceof AggregateError ? { errors: val.errors } : {},
|
|
717
|
-
...rest
|
|
718
|
-
};
|
|
719
|
-
const name = val.name !== "Error" ? val.name : getConstructorName(val);
|
|
720
|
-
return hitMaxDepth ? `[${name}]` : `${name} {${printIteratorEntries(Object.entries(entries).values(), config, indentation, depth, refs, printer)}}`;
|
|
721
|
-
}
|
|
722
|
-
};
|
|
723
|
-
const DEFAULT_THEME = {
|
|
724
|
-
comment: "gray",
|
|
725
|
-
content: "reset",
|
|
726
|
-
prop: "yellow",
|
|
727
|
-
tag: "cyan",
|
|
728
|
-
value: "green"
|
|
729
|
-
};
|
|
730
|
-
const DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);
|
|
731
|
-
const DEFAULT_OPTIONS = {
|
|
732
|
-
callToJSON: true,
|
|
733
|
-
compareKeys: void 0,
|
|
734
|
-
escapeRegex: false,
|
|
735
|
-
escapeString: true,
|
|
736
|
-
highlight: false,
|
|
737
|
-
indent: 2,
|
|
738
|
-
maxDepth: Number.POSITIVE_INFINITY,
|
|
739
|
-
maxWidth: Number.POSITIVE_INFINITY,
|
|
740
|
-
min: false,
|
|
741
|
-
plugins: [],
|
|
742
|
-
printBasicPrototype: true,
|
|
743
|
-
printFunctionName: true,
|
|
744
|
-
printShadowRoot: true,
|
|
745
|
-
theme: DEFAULT_THEME
|
|
746
|
-
};
|
|
747
|
-
const plugins = {
|
|
748
|
-
AsymmetricMatcher: plugin$5,
|
|
749
|
-
DOMCollection: plugin$4,
|
|
750
|
-
DOMElement: plugin$3,
|
|
751
|
-
Immutable: plugin$2,
|
|
752
|
-
ReactElement: plugin$1,
|
|
753
|
-
ReactTestComponent: plugin,
|
|
754
|
-
Error: ErrorPlugin
|
|
755
|
-
};
|
|
756
|
-
|
|
757
|
-
//#endregion
|
|
758
|
-
//#region ../../../../node_modules/@vitest/utils/dist/display.js
|
|
759
|
-
const ansiColors = {
|
|
760
|
-
bold: ["1", "22"],
|
|
761
|
-
dim: ["2", "22"],
|
|
762
|
-
italic: ["3", "23"],
|
|
763
|
-
underline: ["4", "24"],
|
|
764
|
-
inverse: ["7", "27"],
|
|
765
|
-
hidden: ["8", "28"],
|
|
766
|
-
strike: ["9", "29"],
|
|
767
|
-
black: ["30", "39"],
|
|
768
|
-
red: ["31", "39"],
|
|
769
|
-
green: ["32", "39"],
|
|
770
|
-
yellow: ["33", "39"],
|
|
771
|
-
blue: ["34", "39"],
|
|
772
|
-
magenta: ["35", "39"],
|
|
773
|
-
cyan: ["36", "39"],
|
|
774
|
-
white: ["37", "39"],
|
|
775
|
-
brightblack: ["30;1", "39"],
|
|
776
|
-
brightred: ["31;1", "39"],
|
|
777
|
-
brightgreen: ["32;1", "39"],
|
|
778
|
-
brightyellow: ["33;1", "39"],
|
|
779
|
-
brightblue: ["34;1", "39"],
|
|
780
|
-
brightmagenta: ["35;1", "39"],
|
|
781
|
-
brightcyan: ["36;1", "39"],
|
|
782
|
-
brightwhite: ["37;1", "39"],
|
|
783
|
-
grey: ["90", "39"]
|
|
784
|
-
};
|
|
785
|
-
const styles = {
|
|
786
|
-
special: "cyan",
|
|
787
|
-
number: "yellow",
|
|
788
|
-
bigint: "yellow",
|
|
789
|
-
boolean: "yellow",
|
|
790
|
-
undefined: "grey",
|
|
791
|
-
null: "bold",
|
|
792
|
-
string: "green",
|
|
793
|
-
symbol: "green",
|
|
794
|
-
date: "magenta",
|
|
795
|
-
regexp: "red"
|
|
796
|
-
};
|
|
797
|
-
const truncator = "…";
|
|
798
|
-
function colorise(value, styleType) {
|
|
799
|
-
const color = ansiColors[styles[styleType]] || ansiColors[styleType] || "";
|
|
800
|
-
if (!color) return String(value);
|
|
801
|
-
return `\u001b[${color[0]}m${String(value)}\u001b[${color[1]}m`;
|
|
802
|
-
}
|
|
803
|
-
function normaliseOptions({ showHidden = false, depth = 2, colors = false, customInspect = true, showProxy = false, maxArrayLength = Infinity, breakLength = Infinity, seen = [], truncate: truncate$1 = Infinity, stylize = String } = {}, inspect$2) {
|
|
804
|
-
const options = {
|
|
805
|
-
showHidden: Boolean(showHidden),
|
|
806
|
-
depth: Number(depth),
|
|
807
|
-
colors: Boolean(colors),
|
|
808
|
-
customInspect: Boolean(customInspect),
|
|
809
|
-
showProxy: Boolean(showProxy),
|
|
810
|
-
maxArrayLength: Number(maxArrayLength),
|
|
811
|
-
breakLength: Number(breakLength),
|
|
812
|
-
truncate: Number(truncate$1),
|
|
813
|
-
seen,
|
|
814
|
-
inspect: inspect$2,
|
|
815
|
-
stylize
|
|
816
|
-
};
|
|
817
|
-
if (options.colors) options.stylize = colorise;
|
|
818
|
-
return options;
|
|
819
|
-
}
|
|
820
|
-
function isHighSurrogate(char) {
|
|
821
|
-
return char >= "\ud800" && char <= "\udbff";
|
|
822
|
-
}
|
|
823
|
-
function truncate(string, length, tail = truncator) {
|
|
824
|
-
string = String(string);
|
|
825
|
-
const tailLength = tail.length;
|
|
826
|
-
const stringLength = string.length;
|
|
827
|
-
if (tailLength > length && stringLength > tailLength) return tail;
|
|
828
|
-
if (stringLength > length && stringLength > tailLength) {
|
|
829
|
-
let end = length - tailLength;
|
|
830
|
-
if (end > 0 && isHighSurrogate(string[end - 1])) end = end - 1;
|
|
831
|
-
return `${string.slice(0, end)}${tail}`;
|
|
832
|
-
}
|
|
833
|
-
return string;
|
|
834
|
-
}
|
|
835
|
-
function inspectList(list, options, inspectItem, separator = ", ") {
|
|
836
|
-
inspectItem = inspectItem || options.inspect;
|
|
837
|
-
const size = list.length;
|
|
838
|
-
if (size === 0) return "";
|
|
839
|
-
const originalLength = options.truncate;
|
|
840
|
-
let output = "";
|
|
841
|
-
let peek = "";
|
|
842
|
-
let truncated = "";
|
|
843
|
-
for (let i = 0; i < size; i += 1) {
|
|
844
|
-
const last = i + 1 === list.length;
|
|
845
|
-
const secondToLast = i + 2 === list.length;
|
|
846
|
-
truncated = `${truncator}(${list.length - i})`;
|
|
847
|
-
const value = list[i];
|
|
848
|
-
options.truncate = originalLength - output.length - (last ? 0 : separator.length);
|
|
849
|
-
const string = peek || inspectItem(value, options) + (last ? "" : separator);
|
|
850
|
-
const nextLength = output.length + string.length;
|
|
851
|
-
const truncatedLength = nextLength + truncated.length;
|
|
852
|
-
if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) break;
|
|
853
|
-
if (!last && !secondToLast && truncatedLength > originalLength) break;
|
|
854
|
-
peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator);
|
|
855
|
-
if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) break;
|
|
856
|
-
output += string;
|
|
857
|
-
if (!last && !secondToLast && nextLength + peek.length >= originalLength) {
|
|
858
|
-
truncated = `${truncator}(${list.length - i - 1})`;
|
|
859
|
-
break;
|
|
860
|
-
}
|
|
861
|
-
truncated = "";
|
|
862
|
-
}
|
|
863
|
-
return `${output}${truncated}`;
|
|
864
|
-
}
|
|
865
|
-
function quoteComplexKey(key) {
|
|
866
|
-
if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) return key;
|
|
867
|
-
return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, "\"").replace(/(^"|"$)/g, "'");
|
|
868
|
-
}
|
|
869
|
-
function inspectProperty([key, value], options) {
|
|
870
|
-
options.truncate -= 2;
|
|
871
|
-
if (typeof key === "string") key = quoteComplexKey(key);
|
|
872
|
-
else if (typeof key !== "number") key = `[${options.inspect(key, options)}]`;
|
|
873
|
-
options.truncate -= key.length;
|
|
874
|
-
value = options.inspect(value, options);
|
|
875
|
-
return `${key}: ${value}`;
|
|
876
|
-
}
|
|
877
|
-
function inspectArray(array, options) {
|
|
878
|
-
const nonIndexProperties = Object.keys(array).slice(array.length);
|
|
879
|
-
if (!array.length && !nonIndexProperties.length) return "[]";
|
|
880
|
-
options.truncate -= 4;
|
|
881
|
-
const listContents = inspectList(array, options);
|
|
882
|
-
options.truncate -= listContents.length;
|
|
883
|
-
let propertyContents = "";
|
|
884
|
-
if (nonIndexProperties.length) propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty);
|
|
885
|
-
return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`;
|
|
886
|
-
}
|
|
887
|
-
const getArrayName = (array) => {
|
|
888
|
-
if (typeof Buffer === "function" && array instanceof Buffer) return "Buffer";
|
|
889
|
-
if (array[Symbol.toStringTag]) return array[Symbol.toStringTag];
|
|
890
|
-
return array.constructor.name;
|
|
891
|
-
};
|
|
892
|
-
function inspectTypedArray(array, options) {
|
|
893
|
-
const name = getArrayName(array);
|
|
894
|
-
options.truncate -= name.length + 4;
|
|
895
|
-
const nonIndexProperties = Object.keys(array).slice(array.length);
|
|
896
|
-
if (!array.length && !nonIndexProperties.length) return `${name}[]`;
|
|
897
|
-
let output = "";
|
|
898
|
-
for (let i = 0; i < array.length; i++) {
|
|
899
|
-
const string = `${options.stylize(truncate(array[i], options.truncate), "number")}${i === array.length - 1 ? "" : ", "}`;
|
|
900
|
-
options.truncate -= string.length;
|
|
901
|
-
if (array[i] !== array.length && options.truncate <= 3) {
|
|
902
|
-
output += `${truncator}(${array.length - array[i] + 1})`;
|
|
903
|
-
break;
|
|
904
|
-
}
|
|
905
|
-
output += string;
|
|
906
|
-
}
|
|
907
|
-
let propertyContents = "";
|
|
908
|
-
if (nonIndexProperties.length) propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty);
|
|
909
|
-
return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ""} ]`;
|
|
910
|
-
}
|
|
911
|
-
function inspectDate(dateObject, options) {
|
|
912
|
-
const stringRepresentation = dateObject.toJSON();
|
|
913
|
-
if (stringRepresentation === null) return "Invalid Date";
|
|
914
|
-
const split = stringRepresentation.split("T");
|
|
915
|
-
const date = split[0];
|
|
916
|
-
return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, "date");
|
|
917
|
-
}
|
|
918
|
-
function inspectFunction(func, options) {
|
|
919
|
-
const functionType = func[Symbol.toStringTag] || "Function";
|
|
920
|
-
const name = func.name;
|
|
921
|
-
if (!name) return options.stylize(`[${functionType}]`, "special");
|
|
922
|
-
return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, "special");
|
|
923
|
-
}
|
|
924
|
-
function inspectMapEntry([key, value], options) {
|
|
925
|
-
options.truncate -= 4;
|
|
926
|
-
key = options.inspect(key, options);
|
|
927
|
-
options.truncate -= key.length;
|
|
928
|
-
value = options.inspect(value, options);
|
|
929
|
-
return `${key} => ${value}`;
|
|
930
|
-
}
|
|
931
|
-
function mapToEntries(map) {
|
|
932
|
-
const entries = [];
|
|
933
|
-
map.forEach((value, key) => {
|
|
934
|
-
entries.push([key, value]);
|
|
935
|
-
});
|
|
936
|
-
return entries;
|
|
937
|
-
}
|
|
938
|
-
function inspectMap(map, options) {
|
|
939
|
-
if (map.size === 0) return "Map{}";
|
|
940
|
-
options.truncate -= 7;
|
|
941
|
-
return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`;
|
|
942
|
-
}
|
|
943
|
-
const isNaN = Number.isNaN || ((i) => i !== i);
|
|
944
|
-
function inspectNumber(number, options) {
|
|
945
|
-
if (isNaN(number)) return options.stylize("NaN", "number");
|
|
946
|
-
if (number === Infinity) return options.stylize("Infinity", "number");
|
|
947
|
-
if (number === -Infinity) return options.stylize("-Infinity", "number");
|
|
948
|
-
if (number === 0) return options.stylize(1 / number === Infinity ? "+0" : "-0", "number");
|
|
949
|
-
return options.stylize(truncate(String(number), options.truncate), "number");
|
|
950
|
-
}
|
|
951
|
-
function inspectBigInt(number, options) {
|
|
952
|
-
let nums = truncate(number.toString(), options.truncate - 1);
|
|
953
|
-
if (nums !== truncator) nums += "n";
|
|
954
|
-
return options.stylize(nums, "bigint");
|
|
955
|
-
}
|
|
956
|
-
function inspectRegExp(value, options) {
|
|
957
|
-
const flags = value.toString().split("/")[2];
|
|
958
|
-
const sourceLength = options.truncate - (2 + flags.length);
|
|
959
|
-
const source = value.source;
|
|
960
|
-
return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, "regexp");
|
|
961
|
-
}
|
|
962
|
-
function arrayFromSet(set) {
|
|
963
|
-
const values = [];
|
|
964
|
-
set.forEach((value) => {
|
|
965
|
-
values.push(value);
|
|
966
|
-
});
|
|
967
|
-
return values;
|
|
968
|
-
}
|
|
969
|
-
function inspectSet(set, options) {
|
|
970
|
-
if (set.size === 0) return "Set{}";
|
|
971
|
-
options.truncate -= 7;
|
|
972
|
-
return `Set{ ${inspectList(arrayFromSet(set), options)} }`;
|
|
973
|
-
}
|
|
974
|
-
const stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g");
|
|
975
|
-
const escapeCharacters = {
|
|
976
|
-
"\b": "\\b",
|
|
977
|
-
" ": "\\t",
|
|
978
|
-
"\n": "\\n",
|
|
979
|
-
"\f": "\\f",
|
|
980
|
-
"\r": "\\r",
|
|
981
|
-
"'": "\\'",
|
|
982
|
-
"\\": "\\\\"
|
|
983
|
-
};
|
|
984
|
-
const hex = 16;
|
|
985
|
-
function escape(char) {
|
|
986
|
-
return escapeCharacters[char] || `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-4)}`;
|
|
987
|
-
}
|
|
988
|
-
function inspectString(string, options) {
|
|
989
|
-
if (stringEscapeChars.test(string)) string = string.replace(stringEscapeChars, escape);
|
|
990
|
-
return options.stylize(`'${truncate(string, options.truncate - 2)}'`, "string");
|
|
991
|
-
}
|
|
992
|
-
function inspectSymbol(value) {
|
|
993
|
-
if ("description" in Symbol.prototype) return value.description ? `Symbol(${value.description})` : "Symbol()";
|
|
994
|
-
return value.toString();
|
|
995
|
-
}
|
|
996
|
-
const getPromiseValue = () => "Promise{…}";
|
|
997
|
-
function inspectObject$1(object, options) {
|
|
998
|
-
const properties = Object.getOwnPropertyNames(object);
|
|
999
|
-
const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : [];
|
|
1000
|
-
if (properties.length === 0 && symbols.length === 0) return "{}";
|
|
1001
|
-
options.truncate -= 4;
|
|
1002
|
-
options.seen = options.seen || [];
|
|
1003
|
-
if (options.seen.includes(object)) return "[Circular]";
|
|
1004
|
-
options.seen.push(object);
|
|
1005
|
-
const propertyContents = inspectList(properties.map((key) => [key, object[key]]), options, inspectProperty);
|
|
1006
|
-
const symbolContents = inspectList(symbols.map((key) => [key, object[key]]), options, inspectProperty);
|
|
1007
|
-
options.seen.pop();
|
|
1008
|
-
let sep = "";
|
|
1009
|
-
if (propertyContents && symbolContents) sep = ", ";
|
|
1010
|
-
return `{ ${propertyContents}${sep}${symbolContents} }`;
|
|
1011
|
-
}
|
|
1012
|
-
const toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false;
|
|
1013
|
-
function inspectClass(value, options) {
|
|
1014
|
-
let name = "";
|
|
1015
|
-
if (toStringTag && toStringTag in value) name = value[toStringTag];
|
|
1016
|
-
name = name || value.constructor.name;
|
|
1017
|
-
if (!name || name === "_class") name = "<Anonymous Class>";
|
|
1018
|
-
options.truncate -= name.length;
|
|
1019
|
-
return `${name}${inspectObject$1(value, options)}`;
|
|
1020
|
-
}
|
|
1021
|
-
function inspectArguments(args, options) {
|
|
1022
|
-
if (args.length === 0) return "Arguments[]";
|
|
1023
|
-
options.truncate -= 13;
|
|
1024
|
-
return `Arguments[ ${inspectList(args, options)} ]`;
|
|
1025
|
-
}
|
|
1026
|
-
const errorKeys = [
|
|
1027
|
-
"stack",
|
|
1028
|
-
"line",
|
|
1029
|
-
"column",
|
|
1030
|
-
"name",
|
|
1031
|
-
"message",
|
|
1032
|
-
"fileName",
|
|
1033
|
-
"lineNumber",
|
|
1034
|
-
"columnNumber",
|
|
1035
|
-
"number",
|
|
1036
|
-
"description",
|
|
1037
|
-
"cause"
|
|
1038
|
-
];
|
|
1039
|
-
function inspectObject(error, options) {
|
|
1040
|
-
const properties = Object.getOwnPropertyNames(error).filter((key) => errorKeys.indexOf(key) === -1);
|
|
1041
|
-
const name = error.name;
|
|
1042
|
-
options.truncate -= name.length;
|
|
1043
|
-
let message = "";
|
|
1044
|
-
if (typeof error.message === "string") message = truncate(error.message, options.truncate);
|
|
1045
|
-
else properties.unshift("message");
|
|
1046
|
-
message = message ? `: ${message}` : "";
|
|
1047
|
-
options.truncate -= message.length + 5;
|
|
1048
|
-
options.seen = options.seen || [];
|
|
1049
|
-
if (options.seen.includes(error)) return "[Circular]";
|
|
1050
|
-
options.seen.push(error);
|
|
1051
|
-
const propertyContents = inspectList(properties.map((key) => [key, error[key]]), options, inspectProperty);
|
|
1052
|
-
return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`;
|
|
1053
|
-
}
|
|
1054
|
-
function inspectAttribute([key, value], options) {
|
|
1055
|
-
options.truncate -= 3;
|
|
1056
|
-
if (!value) return `${options.stylize(String(key), "yellow")}`;
|
|
1057
|
-
return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`;
|
|
1058
|
-
}
|
|
1059
|
-
function inspectNodeCollection(collection, options) {
|
|
1060
|
-
return inspectList(collection, options, inspectNode, "\n");
|
|
1061
|
-
}
|
|
1062
|
-
function inspectNode(node, options) {
|
|
1063
|
-
switch (node.nodeType) {
|
|
1064
|
-
case 1: return inspectHTML(node, options);
|
|
1065
|
-
case 3: return options.inspect(node.data, options);
|
|
1066
|
-
default: return options.inspect(node, options);
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
function inspectHTML(element, options) {
|
|
1070
|
-
const properties = element.getAttributeNames();
|
|
1071
|
-
const name = element.tagName.toLowerCase();
|
|
1072
|
-
const head = options.stylize(`<${name}`, "special");
|
|
1073
|
-
const headClose = options.stylize(`>`, "special");
|
|
1074
|
-
const tail = options.stylize(`</${name}>`, "special");
|
|
1075
|
-
options.truncate -= name.length * 2 + 5;
|
|
1076
|
-
let propertyContents = "";
|
|
1077
|
-
if (properties.length > 0) {
|
|
1078
|
-
propertyContents += " ";
|
|
1079
|
-
propertyContents += inspectList(properties.map((key) => [key, element.getAttribute(key)]), options, inspectAttribute, " ");
|
|
1080
|
-
}
|
|
1081
|
-
options.truncate -= propertyContents.length;
|
|
1082
|
-
const truncate$1 = options.truncate;
|
|
1083
|
-
let children = inspectNodeCollection(element.children, options);
|
|
1084
|
-
if (children && children.length > truncate$1) children = `${truncator}(${element.children.length})`;
|
|
1085
|
-
return `${head}${propertyContents}${headClose}${children}${tail}`;
|
|
1086
|
-
}
|
|
1087
|
-
const chaiInspect = typeof Symbol === "function" && typeof Symbol.for === "function" ? Symbol.for("chai/inspect") : "@@chai/inspect";
|
|
1088
|
-
const nodeInspect = Symbol.for("nodejs.util.inspect.custom");
|
|
1089
|
-
const constructorMap = /* @__PURE__ */ new WeakMap();
|
|
1090
|
-
const stringTagMap = {};
|
|
1091
|
-
const baseTypesMap = {
|
|
1092
|
-
undefined: (value, options) => options.stylize("undefined", "undefined"),
|
|
1093
|
-
null: (value, options) => options.stylize("null", "null"),
|
|
1094
|
-
boolean: (value, options) => options.stylize(String(value), "boolean"),
|
|
1095
|
-
Boolean: (value, options) => options.stylize(String(value), "boolean"),
|
|
1096
|
-
number: inspectNumber,
|
|
1097
|
-
Number: inspectNumber,
|
|
1098
|
-
bigint: inspectBigInt,
|
|
1099
|
-
BigInt: inspectBigInt,
|
|
1100
|
-
string: inspectString,
|
|
1101
|
-
String: inspectString,
|
|
1102
|
-
function: inspectFunction,
|
|
1103
|
-
Function: inspectFunction,
|
|
1104
|
-
symbol: inspectSymbol,
|
|
1105
|
-
Symbol: inspectSymbol,
|
|
1106
|
-
Array: inspectArray,
|
|
1107
|
-
Date: inspectDate,
|
|
1108
|
-
Map: inspectMap,
|
|
1109
|
-
Set: inspectSet,
|
|
1110
|
-
RegExp: inspectRegExp,
|
|
1111
|
-
Promise: getPromiseValue,
|
|
1112
|
-
WeakSet: (value, options) => options.stylize("WeakSet{…}", "special"),
|
|
1113
|
-
WeakMap: (value, options) => options.stylize("WeakMap{…}", "special"),
|
|
1114
|
-
Arguments: inspectArguments,
|
|
1115
|
-
Int8Array: inspectTypedArray,
|
|
1116
|
-
Uint8Array: inspectTypedArray,
|
|
1117
|
-
Uint8ClampedArray: inspectTypedArray,
|
|
1118
|
-
Int16Array: inspectTypedArray,
|
|
1119
|
-
Uint16Array: inspectTypedArray,
|
|
1120
|
-
Int32Array: inspectTypedArray,
|
|
1121
|
-
Uint32Array: inspectTypedArray,
|
|
1122
|
-
Float32Array: inspectTypedArray,
|
|
1123
|
-
Float64Array: inspectTypedArray,
|
|
1124
|
-
Generator: () => "",
|
|
1125
|
-
DataView: () => "",
|
|
1126
|
-
ArrayBuffer: () => "",
|
|
1127
|
-
Error: inspectObject,
|
|
1128
|
-
HTMLCollection: inspectNodeCollection,
|
|
1129
|
-
NodeList: inspectNodeCollection
|
|
1130
|
-
};
|
|
1131
|
-
const inspectCustom = (value, options, type, inspectFn) => {
|
|
1132
|
-
if (chaiInspect in value && typeof value[chaiInspect] === "function") return value[chaiInspect](options);
|
|
1133
|
-
if (nodeInspect in value && typeof value[nodeInspect] === "function") return value[nodeInspect](options.depth, options, inspectFn);
|
|
1134
|
-
if ("inspect" in value && typeof value.inspect === "function") return value.inspect(options.depth, options);
|
|
1135
|
-
if ("constructor" in value && constructorMap.has(value.constructor)) return constructorMap.get(value.constructor)(value, options);
|
|
1136
|
-
if (stringTagMap[type]) return stringTagMap[type](value, options);
|
|
1137
|
-
return "";
|
|
1138
|
-
};
|
|
1139
|
-
const toString = Object.prototype.toString;
|
|
1140
|
-
function inspect$1(value, opts = {}) {
|
|
1141
|
-
const options = normaliseOptions(opts, inspect$1);
|
|
1142
|
-
const { customInspect } = options;
|
|
1143
|
-
let type = value === null ? "null" : typeof value;
|
|
1144
|
-
if (type === "object") type = toString.call(value).slice(8, -1);
|
|
1145
|
-
if (type in baseTypesMap) return baseTypesMap[type](value, options);
|
|
1146
|
-
if (customInspect && value) {
|
|
1147
|
-
const output = inspectCustom(value, options, type, inspect$1);
|
|
1148
|
-
if (output) {
|
|
1149
|
-
if (typeof output === "string") return output;
|
|
1150
|
-
return inspect$1(output, options);
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
|
-
const proto = value ? Object.getPrototypeOf(value) : false;
|
|
1154
|
-
if (proto === Object.prototype || proto === null) return inspectObject$1(value, options);
|
|
1155
|
-
if (value && typeof HTMLElement === "function" && value instanceof HTMLElement) return inspectHTML(value, options);
|
|
1156
|
-
if ("constructor" in value) {
|
|
1157
|
-
if (value.constructor !== Object) return inspectClass(value, options);
|
|
1158
|
-
return inspectObject$1(value, options);
|
|
1159
|
-
}
|
|
1160
|
-
if (value === Object(value)) return inspectObject$1(value, options);
|
|
1161
|
-
return options.stylize(String(value), type);
|
|
1162
|
-
}
|
|
1163
|
-
const { AsymmetricMatcher, DOMCollection, DOMElement, Immutable, ReactElement, ReactTestComponent } = plugins;
|
|
1164
|
-
const formatRegExp = /%[sdjifoOc%]/g;
|
|
1165
|
-
function format(...args) {
|
|
1166
|
-
if (typeof args[0] !== "string") {
|
|
1167
|
-
const objects = [];
|
|
1168
|
-
for (let i$1 = 0; i$1 < args.length; i$1++) objects.push(inspect(args[i$1], {
|
|
1169
|
-
depth: 0,
|
|
1170
|
-
colors: false
|
|
1171
|
-
}));
|
|
1172
|
-
return objects.join(" ");
|
|
1173
|
-
}
|
|
1174
|
-
const len = args.length;
|
|
1175
|
-
let i = 1;
|
|
1176
|
-
const template = args[0];
|
|
1177
|
-
let str = String(template).replace(formatRegExp, (x) => {
|
|
1178
|
-
if (x === "%%") return "%";
|
|
1179
|
-
if (i >= len) return x;
|
|
1180
|
-
switch (x) {
|
|
1181
|
-
case "%s": {
|
|
1182
|
-
const value = args[i++];
|
|
1183
|
-
if (typeof value === "bigint") return `${value.toString()}n`;
|
|
1184
|
-
if (typeof value === "number" && value === 0 && 1 / value < 0) return "-0";
|
|
1185
|
-
if (typeof value === "object" && value !== null) {
|
|
1186
|
-
if (typeof value.toString === "function" && value.toString !== Object.prototype.toString) return value.toString();
|
|
1187
|
-
return inspect(value, {
|
|
1188
|
-
depth: 0,
|
|
1189
|
-
colors: false
|
|
1190
|
-
});
|
|
1191
|
-
}
|
|
1192
|
-
return String(value);
|
|
1193
|
-
}
|
|
1194
|
-
case "%d": {
|
|
1195
|
-
const value = args[i++];
|
|
1196
|
-
if (typeof value === "bigint") return `${value.toString()}n`;
|
|
1197
|
-
return Number(value).toString();
|
|
1198
|
-
}
|
|
1199
|
-
case "%i": {
|
|
1200
|
-
const value = args[i++];
|
|
1201
|
-
if (typeof value === "bigint") return `${value.toString()}n`;
|
|
1202
|
-
return Number.parseInt(String(value)).toString();
|
|
1203
|
-
}
|
|
1204
|
-
case "%f": return Number.parseFloat(String(args[i++])).toString();
|
|
1205
|
-
case "%o": return inspect(args[i++], {
|
|
1206
|
-
showHidden: true,
|
|
1207
|
-
showProxy: true
|
|
1208
|
-
});
|
|
1209
|
-
case "%O": return inspect(args[i++]);
|
|
1210
|
-
case "%c":
|
|
1211
|
-
i++;
|
|
1212
|
-
return "";
|
|
1213
|
-
case "%j": try {
|
|
1214
|
-
return JSON.stringify(args[i++]);
|
|
1215
|
-
} catch (err) {
|
|
1216
|
-
const m = err.message;
|
|
1217
|
-
if (m.includes("circular structure") || m.includes("cyclic structures") || m.includes("cyclic object")) return "[Circular]";
|
|
1218
|
-
throw err;
|
|
1219
|
-
}
|
|
1220
|
-
default: return x;
|
|
1221
|
-
}
|
|
1222
|
-
});
|
|
1223
|
-
for (let x = args[i]; i < len; x = args[++i]) if (x === null || typeof x !== "object") str += ` ${x}`;
|
|
1224
|
-
else str += ` ${inspect(x)}`;
|
|
1225
|
-
return str;
|
|
1226
|
-
}
|
|
1227
|
-
function inspect(obj, options = {}) {
|
|
1228
|
-
if (options.truncate === 0) options.truncate = Number.POSITIVE_INFINITY;
|
|
1229
|
-
return inspect$1(obj, options);
|
|
1230
|
-
}
|
|
1231
|
-
function objDisplay(obj, options = {}) {
|
|
1232
|
-
if (typeof options.truncate === "undefined") options.truncate = 40;
|
|
1233
|
-
const str = inspect(obj, options);
|
|
1234
|
-
const type = Object.prototype.toString.call(obj);
|
|
1235
|
-
if (options.truncate && str.length >= options.truncate) if (type === "[object Function]") {
|
|
1236
|
-
const fn$1 = obj;
|
|
1237
|
-
return !fn$1.name ? "[Function]" : `[Function: ${fn$1.name}]`;
|
|
1238
|
-
} else if (type === "[object Array]") return `[ Array(${obj.length}) ]`;
|
|
1239
|
-
else if (type === "[object Object]") {
|
|
1240
|
-
const keys = Object.keys(obj);
|
|
1241
|
-
return `{ Object (${keys.length > 2 ? `${keys.splice(0, 2).join(", ")}, ...` : keys.join(", ")}) }`;
|
|
1242
|
-
} else return str;
|
|
1243
|
-
return str;
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1246
|
-
//#endregion
|
|
1247
|
-
//#region ../../../../node_modules/@vitest/utils/dist/helpers.js
|
|
1248
|
-
function assertTypes(value, name, types) {
|
|
1249
|
-
const receivedType = typeof value;
|
|
1250
|
-
if (!types.includes(receivedType)) throw new TypeError(`${name} value must be ${types.join(" or ")}, received "${receivedType}"`);
|
|
1251
|
-
}
|
|
1252
|
-
function toArray(array) {
|
|
1253
|
-
if (array === null || array === void 0) array = [];
|
|
1254
|
-
if (Array.isArray(array)) return array;
|
|
1255
|
-
return [array];
|
|
1256
|
-
}
|
|
1257
|
-
function isObject(item) {
|
|
1258
|
-
return item != null && typeof item === "object" && !Array.isArray(item);
|
|
1259
|
-
}
|
|
1260
|
-
function objectAttr(source, path, defaultValue = void 0) {
|
|
1261
|
-
const paths = path.replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
1262
|
-
let result = source;
|
|
1263
|
-
for (const p of paths) {
|
|
1264
|
-
result = new Object(result)[p];
|
|
1265
|
-
if (result === void 0) return defaultValue;
|
|
1266
|
-
}
|
|
1267
|
-
return result;
|
|
1268
|
-
}
|
|
1269
|
-
function createDefer() {
|
|
1270
|
-
let resolve$1 = null;
|
|
1271
|
-
let reject = null;
|
|
1272
|
-
const p = new Promise((_resolve, _reject) => {
|
|
1273
|
-
resolve$1 = _resolve;
|
|
1274
|
-
reject = _reject;
|
|
1275
|
-
});
|
|
1276
|
-
p.resolve = resolve$1;
|
|
1277
|
-
p.reject = reject;
|
|
1278
|
-
return p;
|
|
1279
|
-
}
|
|
1280
|
-
function isNegativeNaN(val) {
|
|
1281
|
-
if (!Number.isNaN(val)) return false;
|
|
1282
|
-
const f64 = new Float64Array(1);
|
|
1283
|
-
f64[0] = val;
|
|
1284
|
-
return new Uint32Array(f64.buffer)[1] >>> 31 === 1;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
//#endregion
|
|
1288
|
-
//#region ../../../../node_modules/@vitest/utils/dist/timers.js
|
|
1289
|
-
const SAFE_TIMERS_SYMBOL = Symbol("vitest:SAFE_TIMERS");
|
|
1290
|
-
function getSafeTimers() {
|
|
1291
|
-
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
|
|
1292
|
-
const { nextTick: safeNextTick } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis.process || {};
|
|
1293
|
-
return {
|
|
1294
|
-
nextTick: safeNextTick,
|
|
1295
|
-
setTimeout: safeSetTimeout,
|
|
1296
|
-
setInterval: safeSetInterval,
|
|
1297
|
-
clearInterval: safeClearInterval,
|
|
1298
|
-
clearTimeout: safeClearTimeout,
|
|
1299
|
-
setImmediate: safeSetImmediate,
|
|
1300
|
-
clearImmediate: safeClearImmediate,
|
|
1301
|
-
queueMicrotask: safeQueueMicrotask
|
|
1302
|
-
};
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
//#endregion
|
|
1306
|
-
//#region ../../../../node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
|
|
1307
|
-
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
1308
|
-
function normalizeWindowsPath(input = "") {
|
|
1309
|
-
if (!input) return input;
|
|
1310
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
1311
|
-
}
|
|
1312
|
-
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
1313
|
-
function cwd() {
|
|
1314
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") return process.cwd().replace(/\\/g, "/");
|
|
1315
|
-
return "/";
|
|
1316
|
-
}
|
|
1317
|
-
const resolve = function(...arguments_) {
|
|
1318
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
1319
|
-
let resolvedPath = "";
|
|
1320
|
-
let resolvedAbsolute = false;
|
|
1321
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
1322
|
-
const path = index >= 0 ? arguments_[index] : cwd();
|
|
1323
|
-
if (!path || path.length === 0) continue;
|
|
1324
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
1325
|
-
resolvedAbsolute = isAbsolute(path);
|
|
1326
|
-
}
|
|
1327
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
1328
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) return `/${resolvedPath}`;
|
|
1329
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
1330
|
-
};
|
|
1331
|
-
function normalizeString(path, allowAboveRoot) {
|
|
1332
|
-
let res = "";
|
|
1333
|
-
let lastSegmentLength = 0;
|
|
1334
|
-
let lastSlash = -1;
|
|
1335
|
-
let dots = 0;
|
|
1336
|
-
let char = null;
|
|
1337
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
1338
|
-
if (index < path.length) char = path[index];
|
|
1339
|
-
else if (char === "/") break;
|
|
1340
|
-
else char = "/";
|
|
1341
|
-
if (char === "/") {
|
|
1342
|
-
if (lastSlash === index - 1 || dots === 1);
|
|
1343
|
-
else if (dots === 2) {
|
|
1344
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
1345
|
-
if (res.length > 2) {
|
|
1346
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
1347
|
-
if (lastSlashIndex === -1) {
|
|
1348
|
-
res = "";
|
|
1349
|
-
lastSegmentLength = 0;
|
|
1350
|
-
} else {
|
|
1351
|
-
res = res.slice(0, lastSlashIndex);
|
|
1352
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
1353
|
-
}
|
|
1354
|
-
lastSlash = index;
|
|
1355
|
-
dots = 0;
|
|
1356
|
-
continue;
|
|
1357
|
-
} else if (res.length > 0) {
|
|
1358
|
-
res = "";
|
|
1359
|
-
lastSegmentLength = 0;
|
|
1360
|
-
lastSlash = index;
|
|
1361
|
-
dots = 0;
|
|
1362
|
-
continue;
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
if (allowAboveRoot) {
|
|
1366
|
-
res += res.length > 0 ? "/.." : "..";
|
|
1367
|
-
lastSegmentLength = 2;
|
|
1368
|
-
}
|
|
1369
|
-
} else {
|
|
1370
|
-
if (res.length > 0) res += `/${path.slice(lastSlash + 1, index)}`;
|
|
1371
|
-
else res = path.slice(lastSlash + 1, index);
|
|
1372
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
1373
|
-
}
|
|
1374
|
-
lastSlash = index;
|
|
1375
|
-
dots = 0;
|
|
1376
|
-
} else if (char === "." && dots !== -1) ++dots;
|
|
1377
|
-
else dots = -1;
|
|
1378
|
-
}
|
|
1379
|
-
return res;
|
|
1380
|
-
}
|
|
1381
|
-
const isAbsolute = function(p) {
|
|
1382
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
1383
|
-
};
|
|
1384
|
-
|
|
1385
|
-
//#endregion
|
|
1386
|
-
//#region ../../../../node_modules/@vitest/utils/dist/source-map.js
|
|
1387
|
-
var comma = ",".charCodeAt(0);
|
|
1388
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1389
|
-
var intToChar = new Uint8Array(64);
|
|
1390
|
-
var charToInt = new Uint8Array(128);
|
|
1391
|
-
for (let i = 0; i < chars.length; i++) {
|
|
1392
|
-
const c = chars.charCodeAt(i);
|
|
1393
|
-
intToChar[i] = c;
|
|
1394
|
-
charToInt[c] = i;
|
|
1395
|
-
}
|
|
1396
|
-
const CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
|
|
1397
|
-
const SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
|
|
1398
|
-
function extractLocation(urlLike) {
|
|
1399
|
-
if (!urlLike.includes(":")) return [urlLike];
|
|
1400
|
-
const parts = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec(urlLike.replace(/^\(|\)$/g, ""));
|
|
1401
|
-
if (!parts) return [urlLike];
|
|
1402
|
-
let url = parts[1];
|
|
1403
|
-
if (url.startsWith("async ")) url = url.slice(6);
|
|
1404
|
-
if (url.startsWith("http:") || url.startsWith("https:")) {
|
|
1405
|
-
const urlObj = new URL(url);
|
|
1406
|
-
urlObj.searchParams.delete("import");
|
|
1407
|
-
urlObj.searchParams.delete("browserv");
|
|
1408
|
-
url = urlObj.pathname + urlObj.hash + urlObj.search;
|
|
1409
|
-
}
|
|
1410
|
-
if (url.startsWith("/@fs/")) {
|
|
1411
|
-
const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
|
|
1412
|
-
url = url.slice(isWindows ? 5 : 4);
|
|
1413
|
-
}
|
|
1414
|
-
return [
|
|
1415
|
-
url,
|
|
1416
|
-
parts[2] || void 0,
|
|
1417
|
-
parts[3] || void 0
|
|
1418
|
-
];
|
|
1419
|
-
}
|
|
1420
|
-
function parseSingleFFOrSafariStack(raw) {
|
|
1421
|
-
let line = raw.trim();
|
|
1422
|
-
if (SAFARI_NATIVE_CODE_REGEXP.test(line)) return null;
|
|
1423
|
-
if (line.includes(" > eval")) line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1");
|
|
1424
|
-
if (!line.includes("@")) return null;
|
|
1425
|
-
let atIndex = -1;
|
|
1426
|
-
let locationPart = "";
|
|
1427
|
-
let functionName;
|
|
1428
|
-
for (let i = 0; i < line.length; i++) if (line[i] === "@") {
|
|
1429
|
-
const candidateLocation = line.slice(i + 1);
|
|
1430
|
-
if (candidateLocation.includes(":") && candidateLocation.length >= 3) {
|
|
1431
|
-
atIndex = i;
|
|
1432
|
-
locationPart = candidateLocation;
|
|
1433
|
-
functionName = i > 0 ? line.slice(0, i) : void 0;
|
|
1434
|
-
break;
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
if (atIndex === -1 || !locationPart.includes(":") || locationPart.length < 3) return null;
|
|
1438
|
-
const [url, lineNumber, columnNumber] = extractLocation(locationPart);
|
|
1439
|
-
if (!url || !lineNumber || !columnNumber) return null;
|
|
1440
|
-
return {
|
|
1441
|
-
file: url,
|
|
1442
|
-
method: functionName || "",
|
|
1443
|
-
line: Number.parseInt(lineNumber),
|
|
1444
|
-
column: Number.parseInt(columnNumber)
|
|
1445
|
-
};
|
|
1446
|
-
}
|
|
1447
|
-
function parseSingleStack(raw) {
|
|
1448
|
-
const line = raw.trim();
|
|
1449
|
-
if (!CHROME_IE_STACK_REGEXP.test(line)) return parseSingleFFOrSafariStack(line);
|
|
1450
|
-
return parseSingleV8Stack(line);
|
|
1451
|
-
}
|
|
1452
|
-
function parseSingleV8Stack(raw) {
|
|
1453
|
-
let line = raw.trim();
|
|
1454
|
-
if (!CHROME_IE_STACK_REGEXP.test(line)) return null;
|
|
1455
|
-
if (line.includes("(eval ")) line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
|
|
1456
|
-
let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
|
|
1457
|
-
const location = sanitizedLine.match(/ (\(.+\)$)/);
|
|
1458
|
-
sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
|
|
1459
|
-
const [url, lineNumber, columnNumber] = extractLocation(location ? location[1] : sanitizedLine);
|
|
1460
|
-
let method = location && sanitizedLine || "";
|
|
1461
|
-
let file = url && ["eval", "<anonymous>"].includes(url) ? void 0 : url;
|
|
1462
|
-
if (!file || !lineNumber || !columnNumber) return null;
|
|
1463
|
-
if (method.startsWith("async ")) method = method.slice(6);
|
|
1464
|
-
if (file.startsWith("file://")) file = file.slice(7);
|
|
1465
|
-
file = file.startsWith("node:") || file.startsWith("internal:") ? file : resolve(file);
|
|
1466
|
-
if (method) method = method.replace(/__vite_ssr_import_\d+__\./g, "").replace(/(Object\.)?__vite_ssr_export_default__\s?/g, "");
|
|
1467
|
-
return {
|
|
1468
|
-
method,
|
|
1469
|
-
file,
|
|
1470
|
-
line: Number.parseInt(lineNumber),
|
|
1471
|
-
column: Number.parseInt(columnNumber)
|
|
1472
|
-
};
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
//#endregion
|
|
1476
|
-
//#region ../../../../node_modules/@vitest/runner/dist/chunk-tasks.js
|
|
1477
|
-
function createChainable(keys, fn$1) {
|
|
1478
|
-
function create(context) {
|
|
1479
|
-
const chain$1 = function(...args) {
|
|
1480
|
-
return fn$1.apply(context, args);
|
|
1481
|
-
};
|
|
1482
|
-
Object.assign(chain$1, fn$1);
|
|
1483
|
-
chain$1.withContext = () => chain$1.bind(context);
|
|
1484
|
-
chain$1.setContext = (key, value) => {
|
|
1485
|
-
context[key] = value;
|
|
1486
|
-
};
|
|
1487
|
-
chain$1.mergeContext = (ctx) => {
|
|
1488
|
-
Object.assign(context, ctx);
|
|
1489
|
-
};
|
|
1490
|
-
for (const key of keys) Object.defineProperty(chain$1, key, { get() {
|
|
1491
|
-
return create({
|
|
1492
|
-
...context,
|
|
1493
|
-
[key]: true
|
|
1494
|
-
});
|
|
1495
|
-
} });
|
|
1496
|
-
return chain$1;
|
|
1497
|
-
}
|
|
1498
|
-
const chain = create({});
|
|
1499
|
-
chain.fn = fn$1;
|
|
1500
|
-
return chain;
|
|
1501
|
-
}
|
|
1502
|
-
function findTestFileStackTrace(testFilePath, error) {
|
|
1503
|
-
const lines = error.split("\n").slice(1);
|
|
1504
|
-
for (const line of lines) {
|
|
1505
|
-
const stack = parseSingleStack(line);
|
|
1506
|
-
if (stack && stack.file === testFilePath) return stack;
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
function createTaskName(names, separator = " > ") {
|
|
1510
|
-
return names.filter((name) => name !== void 0).join(separator);
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
//#endregion
|
|
1514
|
-
//#region ../../../../node_modules/@vitest/runner/dist/index.js
|
|
1515
|
-
var PendingError = class extends Error {
|
|
1516
|
-
code = "VITEST_PENDING";
|
|
1517
|
-
taskId;
|
|
1518
|
-
constructor(message, task, note) {
|
|
1519
|
-
super(message);
|
|
1520
|
-
this.message = message;
|
|
1521
|
-
this.note = note;
|
|
1522
|
-
this.taskId = task.id;
|
|
1523
|
-
}
|
|
1524
|
-
};
|
|
1525
|
-
const fnMap = /* @__PURE__ */ new WeakMap();
|
|
1526
|
-
const testFixtureMap = /* @__PURE__ */ new WeakMap();
|
|
1527
|
-
const hooksMap = /* @__PURE__ */ new WeakMap();
|
|
1528
|
-
function setFn(key, fn$1) {
|
|
1529
|
-
fnMap.set(key, fn$1);
|
|
1530
|
-
}
|
|
1531
|
-
function setTestFixture(key, fixture) {
|
|
1532
|
-
testFixtureMap.set(key, fixture);
|
|
1533
|
-
}
|
|
1534
|
-
function getTestFixture(key) {
|
|
1535
|
-
return testFixtureMap.get(key);
|
|
1536
|
-
}
|
|
1537
|
-
function setHooks(key, hooks) {
|
|
1538
|
-
hooksMap.set(key, hooks);
|
|
1539
|
-
}
|
|
1540
|
-
function getHooks(key) {
|
|
1541
|
-
return hooksMap.get(key);
|
|
1542
|
-
}
|
|
1543
|
-
function mergeScopedFixtures(testFixtures, scopedFixtures) {
|
|
1544
|
-
const scopedFixturesMap = scopedFixtures.reduce((map, fixture) => {
|
|
1545
|
-
map[fixture.prop] = fixture;
|
|
1546
|
-
return map;
|
|
1547
|
-
}, {});
|
|
1548
|
-
const newFixtures = {};
|
|
1549
|
-
testFixtures.forEach((fixture) => {
|
|
1550
|
-
const useFixture = scopedFixturesMap[fixture.prop] || { ...fixture };
|
|
1551
|
-
newFixtures[useFixture.prop] = useFixture;
|
|
1552
|
-
});
|
|
1553
|
-
for (const fixtureKep in newFixtures) {
|
|
1554
|
-
var _fixture$deps;
|
|
1555
|
-
const fixture = newFixtures[fixtureKep];
|
|
1556
|
-
fixture.deps = (_fixture$deps = fixture.deps) === null || _fixture$deps === void 0 ? void 0 : _fixture$deps.map((dep) => newFixtures[dep.prop]);
|
|
1557
|
-
}
|
|
1558
|
-
return Object.values(newFixtures);
|
|
1559
|
-
}
|
|
1560
|
-
function mergeContextFixtures(fixtures, context, runner$1) {
|
|
1561
|
-
const fixtureOptionKeys = [
|
|
1562
|
-
"auto",
|
|
1563
|
-
"injected",
|
|
1564
|
-
"scope"
|
|
1565
|
-
];
|
|
1566
|
-
const fixtureArray = Object.entries(fixtures).map(([prop, value]) => {
|
|
1567
|
-
const fixtureItem = { value };
|
|
1568
|
-
if (Array.isArray(value) && value.length >= 2 && isObject(value[1]) && Object.keys(value[1]).some((key) => fixtureOptionKeys.includes(key))) {
|
|
1569
|
-
var _runner$injectValue;
|
|
1570
|
-
Object.assign(fixtureItem, value[1]);
|
|
1571
|
-
const userValue = value[0];
|
|
1572
|
-
fixtureItem.value = fixtureItem.injected ? ((_runner$injectValue = runner$1.injectValue) === null || _runner$injectValue === void 0 ? void 0 : _runner$injectValue.call(runner$1, prop)) ?? userValue : userValue;
|
|
1573
|
-
}
|
|
1574
|
-
fixtureItem.scope = fixtureItem.scope || "test";
|
|
1575
|
-
if (fixtureItem.scope === "worker" && !runner$1.getWorkerContext) fixtureItem.scope = "file";
|
|
1576
|
-
fixtureItem.prop = prop;
|
|
1577
|
-
fixtureItem.isFn = typeof fixtureItem.value === "function";
|
|
1578
|
-
return fixtureItem;
|
|
1579
|
-
});
|
|
1580
|
-
if (Array.isArray(context.fixtures)) context.fixtures = context.fixtures.concat(fixtureArray);
|
|
1581
|
-
else context.fixtures = fixtureArray;
|
|
1582
|
-
fixtureArray.forEach((fixture) => {
|
|
1583
|
-
if (fixture.isFn) {
|
|
1584
|
-
const usedProps = getUsedProps(fixture.value);
|
|
1585
|
-
if (usedProps.length) fixture.deps = context.fixtures.filter(({ prop }) => prop !== fixture.prop && usedProps.includes(prop));
|
|
1586
|
-
if (fixture.scope !== "test") {
|
|
1587
|
-
var _fixture$deps2;
|
|
1588
|
-
(_fixture$deps2 = fixture.deps) === null || _fixture$deps2 === void 0 || _fixture$deps2.forEach((dep) => {
|
|
1589
|
-
if (!dep.isFn) return;
|
|
1590
|
-
if (fixture.scope === "worker" && dep.scope === "worker") return;
|
|
1591
|
-
if (fixture.scope === "file" && dep.scope !== "test") return;
|
|
1592
|
-
throw new SyntaxError(`cannot use the ${dep.scope} fixture "${dep.prop}" inside the ${fixture.scope} fixture "${fixture.prop}"`);
|
|
1593
|
-
});
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
});
|
|
1597
|
-
return context;
|
|
1598
|
-
}
|
|
1599
|
-
const fixtureValueMaps = /* @__PURE__ */ new Map();
|
|
1600
|
-
const cleanupFnArrayMap = /* @__PURE__ */ new Map();
|
|
1601
|
-
function withFixtures(runner$1, fn$1, testContext) {
|
|
1602
|
-
return (hookContext) => {
|
|
1603
|
-
const context = hookContext || testContext;
|
|
1604
|
-
if (!context) return fn$1({});
|
|
1605
|
-
const fixtures = getTestFixture(context);
|
|
1606
|
-
if (!(fixtures === null || fixtures === void 0 ? void 0 : fixtures.length)) return fn$1(context);
|
|
1607
|
-
const usedProps = getUsedProps(fn$1);
|
|
1608
|
-
const hasAutoFixture = fixtures.some(({ auto }) => auto);
|
|
1609
|
-
if (!usedProps.length && !hasAutoFixture) return fn$1(context);
|
|
1610
|
-
if (!fixtureValueMaps.get(context)) fixtureValueMaps.set(context, /* @__PURE__ */ new Map());
|
|
1611
|
-
const fixtureValueMap = fixtureValueMaps.get(context);
|
|
1612
|
-
if (!cleanupFnArrayMap.has(context)) cleanupFnArrayMap.set(context, []);
|
|
1613
|
-
const cleanupFnArray = cleanupFnArrayMap.get(context);
|
|
1614
|
-
const pendingFixtures = resolveDeps(fixtures.filter(({ prop, auto }) => auto || usedProps.includes(prop)));
|
|
1615
|
-
if (!pendingFixtures.length) return fn$1(context);
|
|
1616
|
-
async function resolveFixtures() {
|
|
1617
|
-
for (const fixture of pendingFixtures) {
|
|
1618
|
-
if (fixtureValueMap.has(fixture)) continue;
|
|
1619
|
-
const resolvedValue = await resolveFixtureValue(runner$1, fixture, context, cleanupFnArray);
|
|
1620
|
-
context[fixture.prop] = resolvedValue;
|
|
1621
|
-
fixtureValueMap.set(fixture, resolvedValue);
|
|
1622
|
-
if (fixture.scope === "test") cleanupFnArray.unshift(() => {
|
|
1623
|
-
fixtureValueMap.delete(fixture);
|
|
1624
|
-
});
|
|
1625
|
-
}
|
|
1626
|
-
}
|
|
1627
|
-
return resolveFixtures().then(() => fn$1(context));
|
|
1628
|
-
};
|
|
1629
|
-
}
|
|
1630
|
-
const globalFixturePromise = /* @__PURE__ */ new WeakMap();
|
|
1631
|
-
function resolveFixtureValue(runner$1, fixture, context, cleanupFnArray) {
|
|
1632
|
-
var _runner$getWorkerCont;
|
|
1633
|
-
const fileContext = getFileContext(context.task.file);
|
|
1634
|
-
const workerContext = (_runner$getWorkerCont = runner$1.getWorkerContext) === null || _runner$getWorkerCont === void 0 ? void 0 : _runner$getWorkerCont.call(runner$1);
|
|
1635
|
-
if (!fixture.isFn) {
|
|
1636
|
-
var _fixture$prop;
|
|
1637
|
-
fileContext[_fixture$prop = fixture.prop] ?? (fileContext[_fixture$prop] = fixture.value);
|
|
1638
|
-
if (workerContext) {
|
|
1639
|
-
var _fixture$prop2;
|
|
1640
|
-
workerContext[_fixture$prop2 = fixture.prop] ?? (workerContext[_fixture$prop2] = fixture.value);
|
|
1641
|
-
}
|
|
1642
|
-
return fixture.value;
|
|
1643
|
-
}
|
|
1644
|
-
if (fixture.scope === "test") return resolveFixtureFunction(fixture.value, context, cleanupFnArray);
|
|
1645
|
-
if (globalFixturePromise.has(fixture)) return globalFixturePromise.get(fixture);
|
|
1646
|
-
let fixtureContext;
|
|
1647
|
-
if (fixture.scope === "worker") {
|
|
1648
|
-
if (!workerContext) throw new TypeError("[@vitest/runner] The worker context is not available in the current test runner. Please, provide the `getWorkerContext` method when initiating the runner.");
|
|
1649
|
-
fixtureContext = workerContext;
|
|
1650
|
-
} else fixtureContext = fileContext;
|
|
1651
|
-
if (fixture.prop in fixtureContext) return fixtureContext[fixture.prop];
|
|
1652
|
-
if (!cleanupFnArrayMap.has(fixtureContext)) cleanupFnArrayMap.set(fixtureContext, []);
|
|
1653
|
-
const cleanupFnFileArray = cleanupFnArrayMap.get(fixtureContext);
|
|
1654
|
-
const promise = resolveFixtureFunction(fixture.value, fixtureContext, cleanupFnFileArray).then((value) => {
|
|
1655
|
-
fixtureContext[fixture.prop] = value;
|
|
1656
|
-
globalFixturePromise.delete(fixture);
|
|
1657
|
-
return value;
|
|
1658
|
-
});
|
|
1659
|
-
globalFixturePromise.set(fixture, promise);
|
|
1660
|
-
return promise;
|
|
1661
|
-
}
|
|
1662
|
-
async function resolveFixtureFunction(fixtureFn, context, cleanupFnArray) {
|
|
1663
|
-
const useFnArgPromise = createDefer();
|
|
1664
|
-
let isUseFnArgResolved = false;
|
|
1665
|
-
const fixtureReturn = fixtureFn(context, async (useFnArg) => {
|
|
1666
|
-
isUseFnArgResolved = true;
|
|
1667
|
-
useFnArgPromise.resolve(useFnArg);
|
|
1668
|
-
const useReturnPromise = createDefer();
|
|
1669
|
-
cleanupFnArray.push(async () => {
|
|
1670
|
-
useReturnPromise.resolve();
|
|
1671
|
-
await fixtureReturn;
|
|
1672
|
-
});
|
|
1673
|
-
await useReturnPromise;
|
|
1674
|
-
}).catch((e) => {
|
|
1675
|
-
if (!isUseFnArgResolved) {
|
|
1676
|
-
useFnArgPromise.reject(e);
|
|
1677
|
-
return;
|
|
1678
|
-
}
|
|
1679
|
-
throw e;
|
|
1680
|
-
});
|
|
1681
|
-
return useFnArgPromise;
|
|
1682
|
-
}
|
|
1683
|
-
function resolveDeps(fixtures, depSet = /* @__PURE__ */ new Set(), pendingFixtures = []) {
|
|
1684
|
-
fixtures.forEach((fixture) => {
|
|
1685
|
-
if (pendingFixtures.includes(fixture)) return;
|
|
1686
|
-
if (!fixture.isFn || !fixture.deps) {
|
|
1687
|
-
pendingFixtures.push(fixture);
|
|
1688
|
-
return;
|
|
1689
|
-
}
|
|
1690
|
-
if (depSet.has(fixture)) throw new Error(`Circular fixture dependency detected: ${fixture.prop} <- ${[...depSet].reverse().map((d$1) => d$1.prop).join(" <- ")}`);
|
|
1691
|
-
depSet.add(fixture);
|
|
1692
|
-
resolveDeps(fixture.deps, depSet, pendingFixtures);
|
|
1693
|
-
pendingFixtures.push(fixture);
|
|
1694
|
-
depSet.clear();
|
|
1695
|
-
});
|
|
1696
|
-
return pendingFixtures;
|
|
1697
|
-
}
|
|
1698
|
-
function getUsedProps(fn$1) {
|
|
1699
|
-
let fnString = filterOutComments(fn$1.toString());
|
|
1700
|
-
if (/__async\((?:this|null), (?:null|arguments|\[[_0-9, ]*\]), function\*/.test(fnString)) fnString = fnString.split(/__async\((?:this|null),/)[1];
|
|
1701
|
-
const match = fnString.match(/[^(]*\(([^)]*)/);
|
|
1702
|
-
if (!match) return [];
|
|
1703
|
-
const args = splitByComma(match[1]);
|
|
1704
|
-
if (!args.length) return [];
|
|
1705
|
-
let first = args[0];
|
|
1706
|
-
if ("__VITEST_FIXTURE_INDEX__" in fn$1) {
|
|
1707
|
-
first = args[fn$1.__VITEST_FIXTURE_INDEX__];
|
|
1708
|
-
if (!first) return [];
|
|
1709
|
-
}
|
|
1710
|
-
if (!(first[0] === "{" && first.endsWith("}"))) throw new Error(`The first argument inside a fixture must use object destructuring pattern, e.g. ({ test } => {}). Instead, received "${first}".`);
|
|
1711
|
-
const props = splitByComma(first.slice(1, -1).replace(/\s/g, "")).map((prop) => {
|
|
1712
|
-
return prop.replace(/:.*|=.*/g, "");
|
|
1713
|
-
});
|
|
1714
|
-
const last = props.at(-1);
|
|
1715
|
-
if (last && last.startsWith("...")) throw new Error(`Rest parameters are not supported in fixtures, received "${last}".`);
|
|
1716
|
-
return props;
|
|
1717
|
-
}
|
|
1718
|
-
function filterOutComments(s) {
|
|
1719
|
-
const result = [];
|
|
1720
|
-
let commentState = "none";
|
|
1721
|
-
for (let i = 0; i < s.length; ++i) if (commentState === "singleline") {
|
|
1722
|
-
if (s[i] === "\n") commentState = "none";
|
|
1723
|
-
} else if (commentState === "multiline") {
|
|
1724
|
-
if (s[i - 1] === "*" && s[i] === "/") commentState = "none";
|
|
1725
|
-
} else if (commentState === "none") if (s[i] === "/" && s[i + 1] === "/") commentState = "singleline";
|
|
1726
|
-
else if (s[i] === "/" && s[i + 1] === "*") {
|
|
1727
|
-
commentState = "multiline";
|
|
1728
|
-
i += 2;
|
|
1729
|
-
} else result.push(s[i]);
|
|
1730
|
-
return result.join("");
|
|
1731
|
-
}
|
|
1732
|
-
function splitByComma(s) {
|
|
1733
|
-
const result = [];
|
|
1734
|
-
const stack = [];
|
|
1735
|
-
let start = 0;
|
|
1736
|
-
for (let i = 0; i < s.length; i++) if (s[i] === "{" || s[i] === "[") stack.push(s[i] === "{" ? "}" : "]");
|
|
1737
|
-
else if (s[i] === stack.at(-1)) stack.pop();
|
|
1738
|
-
else if (!stack.length && s[i] === ",") {
|
|
1739
|
-
const token = s.substring(start, i).trim();
|
|
1740
|
-
if (token) result.push(token);
|
|
1741
|
-
start = i + 1;
|
|
1742
|
-
}
|
|
1743
|
-
const lastToken = s.substring(start).trim();
|
|
1744
|
-
if (lastToken) result.push(lastToken);
|
|
1745
|
-
return result;
|
|
1746
|
-
}
|
|
1747
|
-
let _test;
|
|
1748
|
-
function getCurrentTest() {
|
|
1749
|
-
return _test;
|
|
1750
|
-
}
|
|
1751
|
-
function getDefaultHookTimeout() {
|
|
1752
|
-
return getRunner().config.hookTimeout;
|
|
1753
|
-
}
|
|
1754
|
-
const CLEANUP_TIMEOUT_KEY = Symbol.for("VITEST_CLEANUP_TIMEOUT");
|
|
1755
|
-
const CLEANUP_STACK_TRACE_KEY = Symbol.for("VITEST_CLEANUP_STACK_TRACE");
|
|
1756
|
-
/**
|
|
1757
|
-
* Registers a callback function to be executed once before all tests within the current suite.
|
|
1758
|
-
* This hook is useful for scenarios where you need to perform setup operations that are common to all tests in a suite, such as initializing a database connection or setting up a test environment.
|
|
1759
|
-
*
|
|
1760
|
-
* **Note:** The `beforeAll` hooks are executed in the order they are defined one after another. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
1761
|
-
*
|
|
1762
|
-
* @param {Function} fn - The callback function to be executed before all tests.
|
|
1763
|
-
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
1764
|
-
* @returns {void}
|
|
1765
|
-
* @example
|
|
1766
|
-
* ```ts
|
|
1767
|
-
* // Example of using beforeAll to set up a database connection
|
|
1768
|
-
* beforeAll(async () => {
|
|
1769
|
-
* await database.connect();
|
|
1770
|
-
* });
|
|
1771
|
-
* ```
|
|
1772
|
-
*/
|
|
1773
|
-
function beforeAll(fn$1, timeout = getDefaultHookTimeout()) {
|
|
1774
|
-
assertTypes(fn$1, "\"beforeAll\" callback", ["function"]);
|
|
1775
|
-
const stackTraceError = /* @__PURE__ */ new Error("STACK_TRACE_ERROR");
|
|
1776
|
-
return getCurrentSuite().on("beforeAll", Object.assign(withTimeout(fn$1, timeout, true, stackTraceError), {
|
|
1777
|
-
[CLEANUP_TIMEOUT_KEY]: timeout,
|
|
1778
|
-
[CLEANUP_STACK_TRACE_KEY]: stackTraceError
|
|
1779
|
-
}));
|
|
1780
|
-
}
|
|
1781
|
-
/**
|
|
1782
|
-
* Registers a callback function to be executed once after all tests within the current suite have completed.
|
|
1783
|
-
* This hook is useful for scenarios where you need to perform cleanup operations after all tests in a suite have run, such as closing database connections or cleaning up temporary files.
|
|
1784
|
-
*
|
|
1785
|
-
* **Note:** The `afterAll` hooks are running in reverse order of their registration. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
1786
|
-
*
|
|
1787
|
-
* @param {Function} fn - The callback function to be executed after all tests.
|
|
1788
|
-
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
1789
|
-
* @returns {void}
|
|
1790
|
-
* @example
|
|
1791
|
-
* ```ts
|
|
1792
|
-
* // Example of using afterAll to close a database connection
|
|
1793
|
-
* afterAll(async () => {
|
|
1794
|
-
* await database.disconnect();
|
|
1795
|
-
* });
|
|
1796
|
-
* ```
|
|
1797
|
-
*/
|
|
1798
|
-
function afterAll(fn$1, timeout) {
|
|
1799
|
-
assertTypes(fn$1, "\"afterAll\" callback", ["function"]);
|
|
1800
|
-
return getCurrentSuite().on("afterAll", withTimeout(fn$1, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR")));
|
|
1801
|
-
}
|
|
1802
|
-
/**
|
|
1803
|
-
* Registers a callback function to be executed before each test within the current suite.
|
|
1804
|
-
* This hook is useful for scenarios where you need to reset or reinitialize the test environment before each test runs, such as resetting database states, clearing caches, or reinitializing variables.
|
|
1805
|
-
*
|
|
1806
|
-
* **Note:** The `beforeEach` hooks are executed in the order they are defined one after another. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
1807
|
-
*
|
|
1808
|
-
* @param {Function} fn - The callback function to be executed before each test. This function receives an `TestContext` parameter if additional test context is needed.
|
|
1809
|
-
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
1810
|
-
* @returns {void}
|
|
1811
|
-
* @example
|
|
1812
|
-
* ```ts
|
|
1813
|
-
* // Example of using beforeEach to reset a database state
|
|
1814
|
-
* beforeEach(async () => {
|
|
1815
|
-
* await database.reset();
|
|
1816
|
-
* });
|
|
1817
|
-
* ```
|
|
1818
|
-
*/
|
|
1819
|
-
function beforeEach(fn$1, timeout = getDefaultHookTimeout()) {
|
|
1820
|
-
assertTypes(fn$1, "\"beforeEach\" callback", ["function"]);
|
|
1821
|
-
const stackTraceError = /* @__PURE__ */ new Error("STACK_TRACE_ERROR");
|
|
1822
|
-
const runner$1 = getRunner();
|
|
1823
|
-
return getCurrentSuite().on("beforeEach", Object.assign(withTimeout(withFixtures(runner$1, fn$1), timeout ?? getDefaultHookTimeout(), true, stackTraceError, abortIfTimeout), {
|
|
1824
|
-
[CLEANUP_TIMEOUT_KEY]: timeout,
|
|
1825
|
-
[CLEANUP_STACK_TRACE_KEY]: stackTraceError
|
|
1826
|
-
}));
|
|
1827
|
-
}
|
|
1828
|
-
/**
|
|
1829
|
-
* Registers a callback function to be executed after each test within the current suite has completed.
|
|
1830
|
-
* This hook is useful for scenarios where you need to clean up or reset the test environment after each test runs, such as deleting temporary files, clearing test-specific database entries, or resetting mocked functions.
|
|
1831
|
-
*
|
|
1832
|
-
* **Note:** The `afterEach` hooks are running in reverse order of their registration. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
1833
|
-
*
|
|
1834
|
-
* @param {Function} fn - The callback function to be executed after each test. This function receives an `TestContext` parameter if additional test context is needed.
|
|
1835
|
-
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
1836
|
-
* @returns {void}
|
|
1837
|
-
* @example
|
|
1838
|
-
* ```ts
|
|
1839
|
-
* // Example of using afterEach to delete temporary files created during a test
|
|
1840
|
-
* afterEach(async () => {
|
|
1841
|
-
* await fileSystem.deleteTempFiles();
|
|
1842
|
-
* });
|
|
1843
|
-
* ```
|
|
1844
|
-
*/
|
|
1845
|
-
function afterEach(fn$1, timeout) {
|
|
1846
|
-
assertTypes(fn$1, "\"afterEach\" callback", ["function"]);
|
|
1847
|
-
const runner$1 = getRunner();
|
|
1848
|
-
return getCurrentSuite().on("afterEach", withTimeout(withFixtures(runner$1, fn$1), timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
1849
|
-
}
|
|
1850
|
-
/**
|
|
1851
|
-
* Registers a callback function to be executed when a test fails within the current suite.
|
|
1852
|
-
* This function allows for custom actions to be performed in response to test failures, such as logging, cleanup, or additional diagnostics.
|
|
1853
|
-
*
|
|
1854
|
-
* **Note:** The `onTestFailed` hooks are running in reverse order of their registration. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
1855
|
-
*
|
|
1856
|
-
* @param {Function} fn - The callback function to be executed upon a test failure. The function receives the test result (including errors).
|
|
1857
|
-
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
1858
|
-
* @throws {Error} Throws an error if the function is not called within a test.
|
|
1859
|
-
* @returns {void}
|
|
1860
|
-
* @example
|
|
1861
|
-
* ```ts
|
|
1862
|
-
* // Example of using onTestFailed to log failure details
|
|
1863
|
-
* onTestFailed(({ errors }) => {
|
|
1864
|
-
* console.log(`Test failed: ${test.name}`, errors);
|
|
1865
|
-
* });
|
|
1866
|
-
* ```
|
|
1867
|
-
*/
|
|
1868
|
-
const onTestFailed = createTestHook("onTestFailed", (test$7, handler, timeout) => {
|
|
1869
|
-
test$7.onFailed || (test$7.onFailed = []);
|
|
1870
|
-
test$7.onFailed.push(withTimeout(handler, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
1871
|
-
});
|
|
1872
|
-
/**
|
|
1873
|
-
* Registers a callback function to be executed when the current test finishes, regardless of the outcome (pass or fail).
|
|
1874
|
-
* This function is ideal for performing actions that should occur after every test execution, such as cleanup, logging, or resetting shared resources.
|
|
1875
|
-
*
|
|
1876
|
-
* This hook is useful if you have access to a resource in the test itself and you want to clean it up after the test finishes. It is a more compact way to clean up resources than using the combination of `beforeEach` and `afterEach`.
|
|
1877
|
-
*
|
|
1878
|
-
* **Note:** The `onTestFinished` hooks are running in reverse order of their registration. You can configure this by changing the `sequence.hooks` option in the config file.
|
|
1879
|
-
*
|
|
1880
|
-
* **Note:** The `onTestFinished` hook is not called if the test is canceled with a dynamic `ctx.skip()` call.
|
|
1881
|
-
*
|
|
1882
|
-
* @param {Function} fn - The callback function to be executed after a test finishes. The function can receive parameters providing details about the completed test, including its success or failure status.
|
|
1883
|
-
* @param {number} [timeout] - Optional timeout in milliseconds for the hook. If not provided, the default hook timeout from the runner's configuration is used.
|
|
1884
|
-
* @throws {Error} Throws an error if the function is not called within a test.
|
|
1885
|
-
* @returns {void}
|
|
1886
|
-
* @example
|
|
1887
|
-
* ```ts
|
|
1888
|
-
* // Example of using onTestFinished for cleanup
|
|
1889
|
-
* const db = await connectToDatabase();
|
|
1890
|
-
* onTestFinished(async () => {
|
|
1891
|
-
* await db.disconnect();
|
|
1892
|
-
* });
|
|
1893
|
-
* ```
|
|
1894
|
-
*/
|
|
1895
|
-
const onTestFinished = createTestHook("onTestFinished", (test$7, handler, timeout) => {
|
|
1896
|
-
test$7.onFinished || (test$7.onFinished = []);
|
|
1897
|
-
test$7.onFinished.push(withTimeout(handler, timeout ?? getDefaultHookTimeout(), true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), abortIfTimeout));
|
|
1898
|
-
});
|
|
1899
|
-
function createTestHook(name, handler) {
|
|
1900
|
-
return (fn$1, timeout) => {
|
|
1901
|
-
assertTypes(fn$1, `"${name}" callback`, ["function"]);
|
|
1902
|
-
const current = getCurrentTest();
|
|
1903
|
-
if (!current) throw new Error(`Hook ${name}() can only be called inside a test`);
|
|
1904
|
-
return handler(current, fn$1, timeout);
|
|
1905
|
-
};
|
|
1906
|
-
}
|
|
1907
|
-
/**
|
|
1908
|
-
* Creates a suite of tests, allowing for grouping and hierarchical organization of tests.
|
|
1909
|
-
* Suites can contain both tests and other suites, enabling complex test structures.
|
|
1910
|
-
*
|
|
1911
|
-
* @param {string} name - The name of the suite, used for identification and reporting.
|
|
1912
|
-
* @param {Function} fn - A function that defines the tests and suites within this suite.
|
|
1913
|
-
* @example
|
|
1914
|
-
* ```ts
|
|
1915
|
-
* // Define a suite with two tests
|
|
1916
|
-
* suite('Math operations', () => {
|
|
1917
|
-
* test('should add two numbers', () => {
|
|
1918
|
-
* expect(add(1, 2)).toBe(3);
|
|
1919
|
-
* });
|
|
1920
|
-
*
|
|
1921
|
-
* test('should subtract two numbers', () => {
|
|
1922
|
-
* expect(subtract(5, 2)).toBe(3);
|
|
1923
|
-
* });
|
|
1924
|
-
* });
|
|
1925
|
-
* ```
|
|
1926
|
-
* @example
|
|
1927
|
-
* ```ts
|
|
1928
|
-
* // Define nested suites
|
|
1929
|
-
* suite('String operations', () => {
|
|
1930
|
-
* suite('Trimming', () => {
|
|
1931
|
-
* test('should trim whitespace from start and end', () => {
|
|
1932
|
-
* expect(' hello '.trim()).toBe('hello');
|
|
1933
|
-
* });
|
|
1934
|
-
* });
|
|
1935
|
-
*
|
|
1936
|
-
* suite('Concatenation', () => {
|
|
1937
|
-
* test('should concatenate two strings', () => {
|
|
1938
|
-
* expect('hello' + ' ' + 'world').toBe('hello world');
|
|
1939
|
-
* });
|
|
1940
|
-
* });
|
|
1941
|
-
* });
|
|
1942
|
-
* ```
|
|
1943
|
-
*/
|
|
1944
|
-
const suite = createSuite();
|
|
1945
|
-
/**
|
|
1946
|
-
* Defines a test case with a given name and test function. The test function can optionally be configured with test options.
|
|
1947
|
-
*
|
|
1948
|
-
* @param {string | Function} name - The name of the test or a function that will be used as a test name.
|
|
1949
|
-
* @param {TestOptions | TestFunction} [optionsOrFn] - Optional. The test options or the test function if no explicit name is provided.
|
|
1950
|
-
* @param {number | TestOptions | TestFunction} [optionsOrTest] - Optional. The test function or options, depending on the previous parameters.
|
|
1951
|
-
* @throws {Error} If called inside another test function.
|
|
1952
|
-
* @example
|
|
1953
|
-
* ```ts
|
|
1954
|
-
* // Define a simple test
|
|
1955
|
-
* test('should add two numbers', () => {
|
|
1956
|
-
* expect(add(1, 2)).toBe(3);
|
|
1957
|
-
* });
|
|
1958
|
-
* ```
|
|
1959
|
-
* @example
|
|
1960
|
-
* ```ts
|
|
1961
|
-
* // Define a test with options
|
|
1962
|
-
* test('should subtract two numbers', { retry: 3 }, () => {
|
|
1963
|
-
* expect(subtract(5, 2)).toBe(3);
|
|
1964
|
-
* });
|
|
1965
|
-
* ```
|
|
1966
|
-
*/
|
|
1967
|
-
const test = createTest(function(name, optionsOrFn, optionsOrTest) {
|
|
1968
|
-
if (getCurrentTest()) throw new Error("Calling the test function inside another test function is not allowed. Please put it inside \"describe\" or \"suite\" so it can be properly collected.");
|
|
1969
|
-
getCurrentSuite().test.fn.call(this, formatName(name), optionsOrFn, optionsOrTest);
|
|
1970
|
-
});
|
|
1971
|
-
let runner;
|
|
1972
|
-
let defaultSuite;
|
|
1973
|
-
let currentTestFilepath;
|
|
1974
|
-
function assert(condition, message) {
|
|
1975
|
-
if (!condition) throw new Error(`Vitest failed to find ${message}. This is a bug in Vitest. Please, open an issue with reproduction.`);
|
|
1976
|
-
}
|
|
1977
|
-
function getRunner() {
|
|
1978
|
-
assert(runner, "the runner");
|
|
1979
|
-
return runner;
|
|
1980
|
-
}
|
|
1981
|
-
function getCurrentSuite() {
|
|
1982
|
-
const currentSuite = collectorContext.currentSuite || defaultSuite;
|
|
1983
|
-
assert(currentSuite, "the current suite");
|
|
1984
|
-
return currentSuite;
|
|
1985
|
-
}
|
|
1986
|
-
function createSuiteHooks() {
|
|
1987
|
-
return {
|
|
1988
|
-
beforeAll: [],
|
|
1989
|
-
afterAll: [],
|
|
1990
|
-
beforeEach: [],
|
|
1991
|
-
afterEach: []
|
|
1992
|
-
};
|
|
1993
|
-
}
|
|
1994
|
-
function parseArguments(optionsOrFn, timeoutOrTest) {
|
|
1995
|
-
if (timeoutOrTest != null && typeof timeoutOrTest === "object") throw new TypeError(`Signature "test(name, fn, { ... })" was deprecated in Vitest 3 and removed in Vitest 4. Please, provide options as a second argument instead.`);
|
|
1996
|
-
let options = {};
|
|
1997
|
-
let fn$1;
|
|
1998
|
-
if (typeof timeoutOrTest === "number") options = { timeout: timeoutOrTest };
|
|
1999
|
-
else if (typeof optionsOrFn === "object") options = optionsOrFn;
|
|
2000
|
-
if (typeof optionsOrFn === "function") {
|
|
2001
|
-
if (typeof timeoutOrTest === "function") throw new TypeError("Cannot use two functions as arguments. Please use the second argument for options.");
|
|
2002
|
-
fn$1 = optionsOrFn;
|
|
2003
|
-
} else if (typeof timeoutOrTest === "function") fn$1 = timeoutOrTest;
|
|
2004
|
-
return {
|
|
2005
|
-
options,
|
|
2006
|
-
handler: fn$1
|
|
2007
|
-
};
|
|
2008
|
-
}
|
|
2009
|
-
function createSuiteCollector(name, factory = () => {}, mode, each, suiteOptions, parentCollectorFixtures) {
|
|
2010
|
-
const tasks = [];
|
|
2011
|
-
let suite$1;
|
|
2012
|
-
initSuite(true);
|
|
2013
|
-
const task = function(name$1 = "", options = {}) {
|
|
2014
|
-
var _collectorContext$cur, _collectorContext$cur2, _collectorContext$cur3;
|
|
2015
|
-
const timeout = (options === null || options === void 0 ? void 0 : options.timeout) ?? runner.config.testTimeout;
|
|
2016
|
-
const currentSuite = (_collectorContext$cur = collectorContext.currentSuite) === null || _collectorContext$cur === void 0 ? void 0 : _collectorContext$cur.suite;
|
|
2017
|
-
const task$1 = {
|
|
2018
|
-
id: "",
|
|
2019
|
-
name: name$1,
|
|
2020
|
-
fullName: createTaskName([(currentSuite === null || currentSuite === void 0 ? void 0 : currentSuite.fullName) ?? ((_collectorContext$cur2 = collectorContext.currentSuite) === null || _collectorContext$cur2 === void 0 || (_collectorContext$cur2 = _collectorContext$cur2.file) === null || _collectorContext$cur2 === void 0 ? void 0 : _collectorContext$cur2.fullName), name$1]),
|
|
2021
|
-
fullTestName: createTaskName([currentSuite === null || currentSuite === void 0 ? void 0 : currentSuite.fullTestName, name$1]),
|
|
2022
|
-
suite: currentSuite,
|
|
2023
|
-
each: options.each,
|
|
2024
|
-
fails: options.fails,
|
|
2025
|
-
context: void 0,
|
|
2026
|
-
type: "test",
|
|
2027
|
-
file: (currentSuite === null || currentSuite === void 0 ? void 0 : currentSuite.file) ?? ((_collectorContext$cur3 = collectorContext.currentSuite) === null || _collectorContext$cur3 === void 0 ? void 0 : _collectorContext$cur3.file),
|
|
2028
|
-
timeout,
|
|
2029
|
-
retry: options.retry ?? runner.config.retry,
|
|
2030
|
-
repeats: options.repeats,
|
|
2031
|
-
mode: options.only ? "only" : options.skip ? "skip" : options.todo ? "todo" : "run",
|
|
2032
|
-
meta: options.meta ?? Object.create(null),
|
|
2033
|
-
annotations: [],
|
|
2034
|
-
artifacts: []
|
|
2035
|
-
};
|
|
2036
|
-
const handler = options.handler;
|
|
2037
|
-
if (task$1.mode === "run" && !handler) task$1.mode = "todo";
|
|
2038
|
-
if (options.concurrent || !options.sequential && runner.config.sequence.concurrent) task$1.concurrent = true;
|
|
2039
|
-
task$1.shuffle = suiteOptions === null || suiteOptions === void 0 ? void 0 : suiteOptions.shuffle;
|
|
2040
|
-
const context = createTestContext(task$1, runner);
|
|
2041
|
-
Object.defineProperty(task$1, "context", {
|
|
2042
|
-
value: context,
|
|
2043
|
-
enumerable: false
|
|
2044
|
-
});
|
|
2045
|
-
setTestFixture(context, options.fixtures);
|
|
2046
|
-
const limit = Error.stackTraceLimit;
|
|
2047
|
-
Error.stackTraceLimit = 15;
|
|
2048
|
-
const stackTraceError = /* @__PURE__ */ new Error("STACK_TRACE_ERROR");
|
|
2049
|
-
Error.stackTraceLimit = limit;
|
|
2050
|
-
if (handler) setFn(task$1, withTimeout(withAwaitAsyncAssertions(withFixtures(runner, handler, context), task$1), timeout, false, stackTraceError, (_, error) => abortIfTimeout([context], error)));
|
|
2051
|
-
if (runner.config.includeTaskLocation) {
|
|
2052
|
-
const error = stackTraceError.stack;
|
|
2053
|
-
const stack = findTestFileStackTrace(currentTestFilepath, error);
|
|
2054
|
-
if (stack) task$1.location = {
|
|
2055
|
-
line: stack.line,
|
|
2056
|
-
column: stack.column
|
|
2057
|
-
};
|
|
2058
|
-
}
|
|
2059
|
-
tasks.push(task$1);
|
|
2060
|
-
return task$1;
|
|
2061
|
-
};
|
|
2062
|
-
const test$7 = createTest(function(name$1, optionsOrFn, timeoutOrTest) {
|
|
2063
|
-
let { options, handler } = parseArguments(optionsOrFn, timeoutOrTest);
|
|
2064
|
-
if (typeof suiteOptions === "object") options = Object.assign({}, suiteOptions, options);
|
|
2065
|
-
options.concurrent = this.concurrent || !this.sequential && (options === null || options === void 0 ? void 0 : options.concurrent);
|
|
2066
|
-
options.sequential = this.sequential || !this.concurrent && (options === null || options === void 0 ? void 0 : options.sequential);
|
|
2067
|
-
const test$8 = task(formatName(name$1), {
|
|
2068
|
-
...this,
|
|
2069
|
-
...options,
|
|
2070
|
-
handler
|
|
2071
|
-
});
|
|
2072
|
-
test$8.type = "test";
|
|
2073
|
-
});
|
|
2074
|
-
let collectorFixtures = parentCollectorFixtures;
|
|
2075
|
-
const collector = {
|
|
2076
|
-
type: "collector",
|
|
2077
|
-
name,
|
|
2078
|
-
mode,
|
|
2079
|
-
suite: suite$1,
|
|
2080
|
-
options: suiteOptions,
|
|
2081
|
-
test: test$7,
|
|
2082
|
-
tasks,
|
|
2083
|
-
collect,
|
|
2084
|
-
task,
|
|
2085
|
-
clear,
|
|
2086
|
-
on: addHook,
|
|
2087
|
-
fixtures() {
|
|
2088
|
-
return collectorFixtures;
|
|
2089
|
-
},
|
|
2090
|
-
scoped(fixtures) {
|
|
2091
|
-
const parsed = mergeContextFixtures(fixtures, { fixtures: collectorFixtures }, runner);
|
|
2092
|
-
if (parsed.fixtures) collectorFixtures = parsed.fixtures;
|
|
2093
|
-
}
|
|
2094
|
-
};
|
|
2095
|
-
function addHook(name$1, ...fn$1) {
|
|
2096
|
-
getHooks(suite$1)[name$1].push(...fn$1);
|
|
2097
|
-
}
|
|
2098
|
-
function initSuite(includeLocation) {
|
|
2099
|
-
var _collectorContext$cur4, _collectorContext$cur5, _collectorContext$cur6;
|
|
2100
|
-
if (typeof suiteOptions === "number") suiteOptions = { timeout: suiteOptions };
|
|
2101
|
-
const currentSuite = (_collectorContext$cur4 = collectorContext.currentSuite) === null || _collectorContext$cur4 === void 0 ? void 0 : _collectorContext$cur4.suite;
|
|
2102
|
-
suite$1 = {
|
|
2103
|
-
id: "",
|
|
2104
|
-
type: "suite",
|
|
2105
|
-
name,
|
|
2106
|
-
fullName: createTaskName([(currentSuite === null || currentSuite === void 0 ? void 0 : currentSuite.fullName) ?? ((_collectorContext$cur5 = collectorContext.currentSuite) === null || _collectorContext$cur5 === void 0 || (_collectorContext$cur5 = _collectorContext$cur5.file) === null || _collectorContext$cur5 === void 0 ? void 0 : _collectorContext$cur5.fullName), name]),
|
|
2107
|
-
fullTestName: createTaskName([currentSuite === null || currentSuite === void 0 ? void 0 : currentSuite.fullTestName, name]),
|
|
2108
|
-
suite: currentSuite,
|
|
2109
|
-
mode,
|
|
2110
|
-
each,
|
|
2111
|
-
file: (currentSuite === null || currentSuite === void 0 ? void 0 : currentSuite.file) ?? ((_collectorContext$cur6 = collectorContext.currentSuite) === null || _collectorContext$cur6 === void 0 ? void 0 : _collectorContext$cur6.file),
|
|
2112
|
-
shuffle: suiteOptions === null || suiteOptions === void 0 ? void 0 : suiteOptions.shuffle,
|
|
2113
|
-
tasks: [],
|
|
2114
|
-
meta: Object.create(null),
|
|
2115
|
-
concurrent: suiteOptions === null || suiteOptions === void 0 ? void 0 : suiteOptions.concurrent
|
|
2116
|
-
};
|
|
2117
|
-
if (runner && includeLocation && runner.config.includeTaskLocation) {
|
|
2118
|
-
const limit = Error.stackTraceLimit;
|
|
2119
|
-
Error.stackTraceLimit = 15;
|
|
2120
|
-
const error = (/* @__PURE__ */ new Error("stacktrace")).stack;
|
|
2121
|
-
Error.stackTraceLimit = limit;
|
|
2122
|
-
const stack = findTestFileStackTrace(currentTestFilepath, error);
|
|
2123
|
-
if (stack) suite$1.location = {
|
|
2124
|
-
line: stack.line,
|
|
2125
|
-
column: stack.column
|
|
2126
|
-
};
|
|
2127
|
-
}
|
|
2128
|
-
setHooks(suite$1, createSuiteHooks());
|
|
2129
|
-
}
|
|
2130
|
-
function clear() {
|
|
2131
|
-
tasks.length = 0;
|
|
2132
|
-
initSuite(false);
|
|
2133
|
-
}
|
|
2134
|
-
async function collect(file) {
|
|
2135
|
-
if (!file) throw new TypeError("File is required to collect tasks.");
|
|
2136
|
-
if (factory) await runWithSuite(collector, () => factory(test$7));
|
|
2137
|
-
const allChildren = [];
|
|
2138
|
-
for (const i of tasks) allChildren.push(i.type === "collector" ? await i.collect(file) : i);
|
|
2139
|
-
suite$1.tasks = allChildren;
|
|
2140
|
-
return suite$1;
|
|
2141
|
-
}
|
|
2142
|
-
collectTask(collector);
|
|
2143
|
-
return collector;
|
|
2144
|
-
}
|
|
2145
|
-
function withAwaitAsyncAssertions(fn$1, task) {
|
|
2146
|
-
return (async (...args) => {
|
|
2147
|
-
const fnResult = await fn$1(...args);
|
|
2148
|
-
if (task.promises) {
|
|
2149
|
-
const errors = (await Promise.allSettled(task.promises)).map((r) => r.status === "rejected" ? r.reason : void 0).filter(Boolean);
|
|
2150
|
-
if (errors.length) throw errors;
|
|
2151
|
-
}
|
|
2152
|
-
return fnResult;
|
|
2153
|
-
});
|
|
2154
|
-
}
|
|
2155
|
-
function createSuite() {
|
|
2156
|
-
function suiteFn(name, factoryOrOptions, optionsOrFactory) {
|
|
2157
|
-
var _currentSuite$options;
|
|
2158
|
-
let mode = this.only ? "only" : this.skip ? "skip" : this.todo ? "todo" : "run";
|
|
2159
|
-
const currentSuite = collectorContext.currentSuite || defaultSuite;
|
|
2160
|
-
let { options, handler: factory } = parseArguments(factoryOrOptions, optionsOrFactory);
|
|
2161
|
-
if (mode === "run" && !factory) mode = "todo";
|
|
2162
|
-
const isConcurrentSpecified = options.concurrent || this.concurrent || options.sequential === false;
|
|
2163
|
-
const isSequentialSpecified = options.sequential || this.sequential || options.concurrent === false;
|
|
2164
|
-
options = {
|
|
2165
|
-
...currentSuite === null || currentSuite === void 0 ? void 0 : currentSuite.options,
|
|
2166
|
-
...options,
|
|
2167
|
-
shuffle: this.shuffle ?? options.shuffle ?? (currentSuite === null || currentSuite === void 0 || (_currentSuite$options = currentSuite.options) === null || _currentSuite$options === void 0 ? void 0 : _currentSuite$options.shuffle) ?? (runner === null || runner === void 0 ? void 0 : runner.config.sequence.shuffle)
|
|
2168
|
-
};
|
|
2169
|
-
const isConcurrent = isConcurrentSpecified || options.concurrent && !isSequentialSpecified;
|
|
2170
|
-
const isSequential = isSequentialSpecified || options.sequential && !isConcurrentSpecified;
|
|
2171
|
-
options.concurrent = isConcurrent && !isSequential;
|
|
2172
|
-
options.sequential = isSequential && !isConcurrent;
|
|
2173
|
-
return createSuiteCollector(formatName(name), factory, mode, this.each, options, currentSuite === null || currentSuite === void 0 ? void 0 : currentSuite.fixtures());
|
|
2174
|
-
}
|
|
2175
|
-
suiteFn.each = function(cases, ...args) {
|
|
2176
|
-
const suite$1 = this.withContext();
|
|
2177
|
-
this.setContext("each", true);
|
|
2178
|
-
if (Array.isArray(cases) && args.length) cases = formatTemplateString(cases, args);
|
|
2179
|
-
return (name, optionsOrFn, fnOrOptions) => {
|
|
2180
|
-
const _name = formatName(name);
|
|
2181
|
-
const arrayOnlyCases = cases.every(Array.isArray);
|
|
2182
|
-
const { options, handler } = parseArguments(optionsOrFn, fnOrOptions);
|
|
2183
|
-
const fnFirst = typeof optionsOrFn === "function";
|
|
2184
|
-
cases.forEach((i, idx) => {
|
|
2185
|
-
const items = Array.isArray(i) ? i : [i];
|
|
2186
|
-
if (fnFirst) if (arrayOnlyCases) suite$1(formatTitle(_name, items, idx), handler ? () => handler(...items) : void 0, options.timeout);
|
|
2187
|
-
else suite$1(formatTitle(_name, items, idx), handler ? () => handler(i) : void 0, options.timeout);
|
|
2188
|
-
else if (arrayOnlyCases) suite$1(formatTitle(_name, items, idx), options, handler ? () => handler(...items) : void 0);
|
|
2189
|
-
else suite$1(formatTitle(_name, items, idx), options, handler ? () => handler(i) : void 0);
|
|
2190
|
-
});
|
|
2191
|
-
this.setContext("each", void 0);
|
|
2192
|
-
};
|
|
2193
|
-
};
|
|
2194
|
-
suiteFn.for = function(cases, ...args) {
|
|
2195
|
-
if (Array.isArray(cases) && args.length) cases = formatTemplateString(cases, args);
|
|
2196
|
-
return (name, optionsOrFn, fnOrOptions) => {
|
|
2197
|
-
const name_ = formatName(name);
|
|
2198
|
-
const { options, handler } = parseArguments(optionsOrFn, fnOrOptions);
|
|
2199
|
-
cases.forEach((item, idx) => {
|
|
2200
|
-
suite(formatTitle(name_, toArray(item), idx), options, handler ? () => handler(item) : void 0);
|
|
2201
|
-
});
|
|
2202
|
-
};
|
|
2203
|
-
};
|
|
2204
|
-
suiteFn.skipIf = (condition) => condition ? suite.skip : suite;
|
|
2205
|
-
suiteFn.runIf = (condition) => condition ? suite : suite.skip;
|
|
2206
|
-
return createChainable([
|
|
2207
|
-
"concurrent",
|
|
2208
|
-
"sequential",
|
|
2209
|
-
"shuffle",
|
|
2210
|
-
"skip",
|
|
2211
|
-
"only",
|
|
2212
|
-
"todo"
|
|
2213
|
-
], suiteFn);
|
|
2214
|
-
}
|
|
2215
|
-
function createTaskCollector(fn$1, context) {
|
|
2216
|
-
const taskFn = fn$1;
|
|
2217
|
-
taskFn.each = function(cases, ...args) {
|
|
2218
|
-
const test$7 = this.withContext();
|
|
2219
|
-
this.setContext("each", true);
|
|
2220
|
-
if (Array.isArray(cases) && args.length) cases = formatTemplateString(cases, args);
|
|
2221
|
-
return (name, optionsOrFn, fnOrOptions) => {
|
|
2222
|
-
const _name = formatName(name);
|
|
2223
|
-
const arrayOnlyCases = cases.every(Array.isArray);
|
|
2224
|
-
const { options, handler } = parseArguments(optionsOrFn, fnOrOptions);
|
|
2225
|
-
const fnFirst = typeof optionsOrFn === "function";
|
|
2226
|
-
cases.forEach((i, idx) => {
|
|
2227
|
-
const items = Array.isArray(i) ? i : [i];
|
|
2228
|
-
if (fnFirst) if (arrayOnlyCases) test$7(formatTitle(_name, items, idx), handler ? () => handler(...items) : void 0, options.timeout);
|
|
2229
|
-
else test$7(formatTitle(_name, items, idx), handler ? () => handler(i) : void 0, options.timeout);
|
|
2230
|
-
else if (arrayOnlyCases) test$7(formatTitle(_name, items, idx), options, handler ? () => handler(...items) : void 0);
|
|
2231
|
-
else test$7(formatTitle(_name, items, idx), options, handler ? () => handler(i) : void 0);
|
|
2232
|
-
});
|
|
2233
|
-
this.setContext("each", void 0);
|
|
2234
|
-
};
|
|
2235
|
-
};
|
|
2236
|
-
taskFn.for = function(cases, ...args) {
|
|
2237
|
-
const test$7 = this.withContext();
|
|
2238
|
-
if (Array.isArray(cases) && args.length) cases = formatTemplateString(cases, args);
|
|
2239
|
-
return (name, optionsOrFn, fnOrOptions) => {
|
|
2240
|
-
const _name = formatName(name);
|
|
2241
|
-
const { options, handler } = parseArguments(optionsOrFn, fnOrOptions);
|
|
2242
|
-
cases.forEach((item, idx) => {
|
|
2243
|
-
const handlerWrapper = handler ? (ctx) => handler(item, ctx) : void 0;
|
|
2244
|
-
if (handlerWrapper) {
|
|
2245
|
-
handlerWrapper.__VITEST_FIXTURE_INDEX__ = 1;
|
|
2246
|
-
handlerWrapper.toString = () => handler.toString();
|
|
2247
|
-
}
|
|
2248
|
-
test$7(formatTitle(_name, toArray(item), idx), options, handlerWrapper);
|
|
2249
|
-
});
|
|
2250
|
-
};
|
|
2251
|
-
};
|
|
2252
|
-
taskFn.skipIf = function(condition) {
|
|
2253
|
-
return condition ? this.skip : this;
|
|
2254
|
-
};
|
|
2255
|
-
taskFn.runIf = function(condition) {
|
|
2256
|
-
return condition ? this : this.skip;
|
|
2257
|
-
};
|
|
2258
|
-
taskFn.scoped = function(fixtures) {
|
|
2259
|
-
getCurrentSuite().scoped(fixtures);
|
|
2260
|
-
};
|
|
2261
|
-
taskFn.extend = function(fixtures) {
|
|
2262
|
-
const _context = mergeContextFixtures(fixtures, context || {}, runner);
|
|
2263
|
-
const originalWrapper = fn$1;
|
|
2264
|
-
return createTest(function(name, optionsOrFn, optionsOrTest) {
|
|
2265
|
-
const scopedFixtures = getCurrentSuite().fixtures();
|
|
2266
|
-
const context$1 = { ...this };
|
|
2267
|
-
if (scopedFixtures) context$1.fixtures = mergeScopedFixtures(context$1.fixtures || [], scopedFixtures);
|
|
2268
|
-
originalWrapper.call(context$1, formatName(name), optionsOrFn, optionsOrTest);
|
|
2269
|
-
}, _context);
|
|
2270
|
-
};
|
|
2271
|
-
taskFn.beforeEach = beforeEach;
|
|
2272
|
-
taskFn.afterEach = afterEach;
|
|
2273
|
-
taskFn.beforeAll = beforeAll;
|
|
2274
|
-
taskFn.afterAll = afterAll;
|
|
2275
|
-
const _test$1 = createChainable([
|
|
2276
|
-
"concurrent",
|
|
2277
|
-
"sequential",
|
|
2278
|
-
"skip",
|
|
2279
|
-
"only",
|
|
2280
|
-
"todo",
|
|
2281
|
-
"fails"
|
|
2282
|
-
], taskFn);
|
|
2283
|
-
if (context) _test$1.mergeContext(context);
|
|
2284
|
-
return _test$1;
|
|
2285
|
-
}
|
|
2286
|
-
function createTest(fn$1, context) {
|
|
2287
|
-
return createTaskCollector(fn$1, context);
|
|
2288
|
-
}
|
|
2289
|
-
function formatName(name) {
|
|
2290
|
-
return typeof name === "string" ? name : typeof name === "function" ? name.name || "<anonymous>" : String(name);
|
|
2291
|
-
}
|
|
2292
|
-
function formatTitle(template, items, idx) {
|
|
2293
|
-
if (template.includes("%#") || template.includes("%$")) template = template.replace(/%%/g, "__vitest_escaped_%__").replace(/%#/g, `${idx}`).replace(/%\$/g, `${idx + 1}`).replace(/__vitest_escaped_%__/g, "%%");
|
|
2294
|
-
const count = template.split("%").length - 1;
|
|
2295
|
-
if (template.includes("%f")) (template.match(/%f/g) || []).forEach((_, i$1) => {
|
|
2296
|
-
if (isNegativeNaN(items[i$1]) || Object.is(items[i$1], -0)) {
|
|
2297
|
-
let occurrence = 0;
|
|
2298
|
-
template = template.replace(/%f/g, (match) => {
|
|
2299
|
-
occurrence++;
|
|
2300
|
-
return occurrence === i$1 + 1 ? "-%f" : match;
|
|
2301
|
-
});
|
|
2302
|
-
}
|
|
2303
|
-
});
|
|
2304
|
-
const isObjectItem = isObject(items[0]);
|
|
2305
|
-
function formatAttribute(s) {
|
|
2306
|
-
return s.replace(/\$([$\w.]+)/g, (_, key) => {
|
|
2307
|
-
var _runner$config;
|
|
2308
|
-
const isArrayKey = /^\d+$/.test(key);
|
|
2309
|
-
if (!isObjectItem && !isArrayKey) return `$${key}`;
|
|
2310
|
-
const arrayElement = isArrayKey ? objectAttr(items, key) : void 0;
|
|
2311
|
-
return objDisplay(isObjectItem ? objectAttr(items[0], key, arrayElement) : arrayElement, { truncate: runner === null || runner === void 0 || (_runner$config = runner.config) === null || _runner$config === void 0 || (_runner$config = _runner$config.chaiConfig) === null || _runner$config === void 0 ? void 0 : _runner$config.truncateThreshold });
|
|
2312
|
-
});
|
|
2313
|
-
}
|
|
2314
|
-
let output = "";
|
|
2315
|
-
let i = 0;
|
|
2316
|
-
handleRegexMatch(template, formatRegExp, (match) => {
|
|
2317
|
-
if (i < count) output += format(match[0], items[i++]);
|
|
2318
|
-
else output += match[0];
|
|
2319
|
-
}, (nonMatch) => {
|
|
2320
|
-
output += formatAttribute(nonMatch);
|
|
2321
|
-
});
|
|
2322
|
-
return output;
|
|
2323
|
-
}
|
|
2324
|
-
function handleRegexMatch(input, regex, onMatch, onNonMatch) {
|
|
2325
|
-
let lastIndex = 0;
|
|
2326
|
-
for (const m of input.matchAll(regex)) {
|
|
2327
|
-
if (lastIndex < m.index) onNonMatch(input.slice(lastIndex, m.index));
|
|
2328
|
-
onMatch(m);
|
|
2329
|
-
lastIndex = m.index + m[0].length;
|
|
2330
|
-
}
|
|
2331
|
-
if (lastIndex < input.length) onNonMatch(input.slice(lastIndex));
|
|
2332
|
-
}
|
|
2333
|
-
function formatTemplateString(cases, args) {
|
|
2334
|
-
const header = cases.join("").trim().replace(/ /g, "").split("\n").map((i) => i.split("|"))[0];
|
|
2335
|
-
const res = [];
|
|
2336
|
-
for (let i = 0; i < Math.floor(args.length / header.length); i++) {
|
|
2337
|
-
const oneCase = {};
|
|
2338
|
-
for (let j = 0; j < header.length; j++) oneCase[header[j]] = args[i * header.length + j];
|
|
2339
|
-
res.push(oneCase);
|
|
2340
|
-
}
|
|
2341
|
-
return res;
|
|
2342
|
-
}
|
|
2343
|
-
const now$2 = Date.now;
|
|
2344
|
-
const collectorContext = {
|
|
2345
|
-
tasks: [],
|
|
2346
|
-
currentSuite: null
|
|
2347
|
-
};
|
|
2348
|
-
function collectTask(task) {
|
|
2349
|
-
var _collectorContext$cur;
|
|
2350
|
-
(_collectorContext$cur = collectorContext.currentSuite) === null || _collectorContext$cur === void 0 || _collectorContext$cur.tasks.push(task);
|
|
2351
|
-
}
|
|
2352
|
-
async function runWithSuite(suite$1, fn$1) {
|
|
2353
|
-
const prev = collectorContext.currentSuite;
|
|
2354
|
-
collectorContext.currentSuite = suite$1;
|
|
2355
|
-
await fn$1();
|
|
2356
|
-
collectorContext.currentSuite = prev;
|
|
2357
|
-
}
|
|
2358
|
-
function withTimeout(fn$1, timeout, isHook = false, stackTraceError, onTimeout) {
|
|
2359
|
-
if (timeout <= 0 || timeout === Number.POSITIVE_INFINITY) return fn$1;
|
|
2360
|
-
const { setTimeout: setTimeout$2, clearTimeout: clearTimeout$1 } = getSafeTimers();
|
|
2361
|
-
return (function runWithTimeout(...args) {
|
|
2362
|
-
const startTime = now$2();
|
|
2363
|
-
const runner$1 = getRunner();
|
|
2364
|
-
runner$1._currentTaskStartTime = startTime;
|
|
2365
|
-
runner$1._currentTaskTimeout = timeout;
|
|
2366
|
-
return new Promise((resolve_, reject_) => {
|
|
2367
|
-
var _timer$unref;
|
|
2368
|
-
const timer = setTimeout$2(() => {
|
|
2369
|
-
clearTimeout$1(timer);
|
|
2370
|
-
rejectTimeoutError();
|
|
2371
|
-
}, timeout);
|
|
2372
|
-
(_timer$unref = timer.unref) === null || _timer$unref === void 0 || _timer$unref.call(timer);
|
|
2373
|
-
function rejectTimeoutError() {
|
|
2374
|
-
const error = makeTimeoutError(isHook, timeout, stackTraceError);
|
|
2375
|
-
onTimeout === null || onTimeout === void 0 || onTimeout(args, error);
|
|
2376
|
-
reject_(error);
|
|
2377
|
-
}
|
|
2378
|
-
function resolve$1(result) {
|
|
2379
|
-
runner$1._currentTaskStartTime = void 0;
|
|
2380
|
-
runner$1._currentTaskTimeout = void 0;
|
|
2381
|
-
clearTimeout$1(timer);
|
|
2382
|
-
if (now$2() - startTime >= timeout) {
|
|
2383
|
-
rejectTimeoutError();
|
|
2384
|
-
return;
|
|
2385
|
-
}
|
|
2386
|
-
resolve_(result);
|
|
2387
|
-
}
|
|
2388
|
-
function reject(error) {
|
|
2389
|
-
runner$1._currentTaskStartTime = void 0;
|
|
2390
|
-
runner$1._currentTaskTimeout = void 0;
|
|
2391
|
-
clearTimeout$1(timer);
|
|
2392
|
-
reject_(error);
|
|
2393
|
-
}
|
|
2394
|
-
try {
|
|
2395
|
-
const result = fn$1(...args);
|
|
2396
|
-
if (typeof result === "object" && result != null && typeof result.then === "function") result.then(resolve$1, reject);
|
|
2397
|
-
else resolve$1(result);
|
|
2398
|
-
} catch (error) {
|
|
2399
|
-
reject(error);
|
|
2400
|
-
}
|
|
2401
|
-
});
|
|
2402
|
-
});
|
|
2403
|
-
}
|
|
2404
|
-
const abortControllers = /* @__PURE__ */ new WeakMap();
|
|
2405
|
-
function abortIfTimeout([context], error) {
|
|
2406
|
-
if (context) abortContextSignal(context, error);
|
|
2407
|
-
}
|
|
2408
|
-
function abortContextSignal(context, error) {
|
|
2409
|
-
const abortController = abortControllers.get(context);
|
|
2410
|
-
abortController === null || abortController === void 0 || abortController.abort(error);
|
|
2411
|
-
}
|
|
2412
|
-
function createTestContext(test$7, runner$1) {
|
|
2413
|
-
var _runner$extendTaskCon;
|
|
2414
|
-
const context = function() {
|
|
2415
|
-
throw new Error("done() callback is deprecated, use promise instead");
|
|
2416
|
-
};
|
|
2417
|
-
let abortController = abortControllers.get(context);
|
|
2418
|
-
if (!abortController) {
|
|
2419
|
-
abortController = new AbortController();
|
|
2420
|
-
abortControllers.set(context, abortController);
|
|
2421
|
-
}
|
|
2422
|
-
context.signal = abortController.signal;
|
|
2423
|
-
context.task = test$7;
|
|
2424
|
-
context.skip = (condition, note) => {
|
|
2425
|
-
if (condition === false) return;
|
|
2426
|
-
test$7.result ?? (test$7.result = { state: "skip" });
|
|
2427
|
-
test$7.result.pending = true;
|
|
2428
|
-
throw new PendingError("test is skipped; abort execution", test$7, typeof condition === "string" ? condition : note);
|
|
2429
|
-
};
|
|
2430
|
-
context.annotate = ((message, type, attachment) => {
|
|
2431
|
-
if (test$7.result && test$7.result.state !== "run") throw new Error(`Cannot annotate tests outside of the test run. The test "${test$7.name}" finished running with the "${test$7.result.state}" state already.`);
|
|
2432
|
-
const annotation = {
|
|
2433
|
-
message,
|
|
2434
|
-
type: typeof type === "object" || type === void 0 ? "notice" : type
|
|
2435
|
-
};
|
|
2436
|
-
const annotationAttachment = typeof type === "object" ? type : attachment;
|
|
2437
|
-
if (annotationAttachment) {
|
|
2438
|
-
annotation.attachment = annotationAttachment;
|
|
2439
|
-
manageArtifactAttachment(annotation.attachment);
|
|
2440
|
-
}
|
|
2441
|
-
return recordAsyncOperation(test$7, recordArtifact(test$7, {
|
|
2442
|
-
type: "internal:annotation",
|
|
2443
|
-
annotation
|
|
2444
|
-
}).then(async ({ annotation: annotation$1 }) => {
|
|
2445
|
-
if (!runner$1.onTestAnnotate) throw new Error(`Test runner doesn't support test annotations.`);
|
|
2446
|
-
await finishSendTasksUpdate(runner$1);
|
|
2447
|
-
const resolvedAnnotation = await runner$1.onTestAnnotate(test$7, annotation$1);
|
|
2448
|
-
test$7.annotations.push(resolvedAnnotation);
|
|
2449
|
-
return resolvedAnnotation;
|
|
2450
|
-
}));
|
|
2451
|
-
});
|
|
2452
|
-
context.onTestFailed = (handler, timeout) => {
|
|
2453
|
-
test$7.onFailed || (test$7.onFailed = []);
|
|
2454
|
-
test$7.onFailed.push(withTimeout(handler, timeout ?? runner$1.config.hookTimeout, true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), (_, error) => abortController.abort(error)));
|
|
2455
|
-
};
|
|
2456
|
-
context.onTestFinished = (handler, timeout) => {
|
|
2457
|
-
test$7.onFinished || (test$7.onFinished = []);
|
|
2458
|
-
test$7.onFinished.push(withTimeout(handler, timeout ?? runner$1.config.hookTimeout, true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), (_, error) => abortController.abort(error)));
|
|
2459
|
-
};
|
|
2460
|
-
return ((_runner$extendTaskCon = runner$1.extendTaskContext) === null || _runner$extendTaskCon === void 0 ? void 0 : _runner$extendTaskCon.call(runner$1, context)) || context;
|
|
2461
|
-
}
|
|
2462
|
-
function makeTimeoutError(isHook, timeout, stackTraceError) {
|
|
2463
|
-
const message = `${isHook ? "Hook" : "Test"} timed out in ${timeout}ms.\nIf this is a long-running ${isHook ? "hook" : "test"}, pass a timeout value as the last argument or configure it globally with "${isHook ? "hookTimeout" : "testTimeout"}".`;
|
|
2464
|
-
const error = new Error(message);
|
|
2465
|
-
if (stackTraceError === null || stackTraceError === void 0 ? void 0 : stackTraceError.stack) error.stack = stackTraceError.stack.replace(error.message, stackTraceError.message);
|
|
2466
|
-
return error;
|
|
2467
|
-
}
|
|
2468
|
-
const fileContexts = /* @__PURE__ */ new WeakMap();
|
|
2469
|
-
function getFileContext(file) {
|
|
2470
|
-
const context = fileContexts.get(file);
|
|
2471
|
-
if (!context) throw new Error(`Cannot find file context for ${file.name}`);
|
|
2472
|
-
return context;
|
|
2473
|
-
}
|
|
2474
|
-
const now$1 = globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
2475
|
-
const now = globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
2476
|
-
const unixNow = Date.now;
|
|
2477
|
-
const { clearTimeout, setTimeout: setTimeout$1 } = getSafeTimers();
|
|
2478
|
-
const packs = /* @__PURE__ */ new Map();
|
|
2479
|
-
const eventsPacks = [];
|
|
2480
|
-
const pendingTasksUpdates = [];
|
|
2481
|
-
function sendTasksUpdate(runner$1) {
|
|
2482
|
-
if (packs.size) {
|
|
2483
|
-
var _runner$onTaskUpdate;
|
|
2484
|
-
const taskPacks = Array.from(packs).map(([id, task]) => {
|
|
2485
|
-
return [
|
|
2486
|
-
id,
|
|
2487
|
-
task[0],
|
|
2488
|
-
task[1]
|
|
2489
|
-
];
|
|
2490
|
-
});
|
|
2491
|
-
const p = (_runner$onTaskUpdate = runner$1.onTaskUpdate) === null || _runner$onTaskUpdate === void 0 ? void 0 : _runner$onTaskUpdate.call(runner$1, taskPacks, eventsPacks);
|
|
2492
|
-
if (p) {
|
|
2493
|
-
pendingTasksUpdates.push(p);
|
|
2494
|
-
p.then(() => pendingTasksUpdates.splice(pendingTasksUpdates.indexOf(p), 1), () => {});
|
|
2495
|
-
}
|
|
2496
|
-
eventsPacks.length = 0;
|
|
2497
|
-
packs.clear();
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
async function finishSendTasksUpdate(runner$1) {
|
|
2501
|
-
sendTasksUpdate(runner$1);
|
|
2502
|
-
await Promise.all(pendingTasksUpdates);
|
|
2503
|
-
}
|
|
2504
|
-
function throttle(fn$1, ms) {
|
|
2505
|
-
let last = 0;
|
|
2506
|
-
let pendingCall;
|
|
2507
|
-
return function call(...args) {
|
|
2508
|
-
const now$3 = unixNow();
|
|
2509
|
-
if (now$3 - last > ms) {
|
|
2510
|
-
last = now$3;
|
|
2511
|
-
clearTimeout(pendingCall);
|
|
2512
|
-
pendingCall = void 0;
|
|
2513
|
-
return fn$1.apply(this, args);
|
|
2514
|
-
}
|
|
2515
|
-
pendingCall ?? (pendingCall = setTimeout$1(() => call.bind(this)(...args), ms));
|
|
2516
|
-
};
|
|
2517
|
-
}
|
|
2518
|
-
const sendTasksUpdateThrottled = throttle(sendTasksUpdate, 100);
|
|
2519
|
-
/**
|
|
2520
|
-
* @experimental
|
|
2521
|
-
* @advanced
|
|
2522
|
-
*
|
|
2523
|
-
* Records a custom test artifact during test execution.
|
|
2524
|
-
*
|
|
2525
|
-
* This function allows you to attach structured data, files, or metadata to a test.
|
|
2526
|
-
*
|
|
2527
|
-
* Vitest automatically injects the source location where the artifact was created and manages any attachments you include.
|
|
2528
|
-
*
|
|
2529
|
-
* @param task - The test task context, typically accessed via `this.task` in custom matchers or `context.task` in tests
|
|
2530
|
-
* @param artifact - The artifact to record. Must extend {@linkcode TestArtifactBase}
|
|
2531
|
-
*
|
|
2532
|
-
* @returns A promise that resolves to the recorded artifact with location injected
|
|
2533
|
-
*
|
|
2534
|
-
* @throws {Error} If called after the test has finished running
|
|
2535
|
-
* @throws {Error} If the test runner doesn't support artifacts
|
|
2536
|
-
*
|
|
2537
|
-
* @example
|
|
2538
|
-
* ```ts
|
|
2539
|
-
* // In a custom assertion
|
|
2540
|
-
* async function toHaveValidSchema(this: MatcherState, actual: unknown) {
|
|
2541
|
-
* const validation = validateSchema(actual)
|
|
2542
|
-
*
|
|
2543
|
-
* await recordArtifact(this.task, {
|
|
2544
|
-
* type: 'my-plugin:schema-validation',
|
|
2545
|
-
* passed: validation.valid,
|
|
2546
|
-
* errors: validation.errors,
|
|
2547
|
-
* })
|
|
2548
|
-
*
|
|
2549
|
-
* return { pass: validation.valid, message: () => '...' }
|
|
2550
|
-
* }
|
|
2551
|
-
* ```
|
|
2552
|
-
*/
|
|
2553
|
-
async function recordArtifact(task, artifact) {
|
|
2554
|
-
const runner$1 = getRunner();
|
|
2555
|
-
if (task.result && task.result.state !== "run") throw new Error(`Cannot record a test artifact outside of the test run. The test "${task.name}" finished running with the "${task.result.state}" state already.`);
|
|
2556
|
-
const stack = findTestFileStackTrace(task.file.filepath, (/* @__PURE__ */ new Error("STACK_TRACE")).stack);
|
|
2557
|
-
if (stack) {
|
|
2558
|
-
artifact.location = {
|
|
2559
|
-
file: stack.file,
|
|
2560
|
-
line: stack.line,
|
|
2561
|
-
column: stack.column
|
|
2562
|
-
};
|
|
2563
|
-
if (artifact.type === "internal:annotation") artifact.annotation.location = artifact.location;
|
|
2564
|
-
}
|
|
2565
|
-
if (Array.isArray(artifact.attachments)) for (const attachment of artifact.attachments) manageArtifactAttachment(attachment);
|
|
2566
|
-
if (artifact.type === "internal:annotation") return artifact;
|
|
2567
|
-
if (!runner$1.onTestArtifactRecord) throw new Error(`Test runner doesn't support test artifacts.`);
|
|
2568
|
-
await finishSendTasksUpdate(runner$1);
|
|
2569
|
-
const resolvedArtifact = await runner$1.onTestArtifactRecord(task, artifact);
|
|
2570
|
-
task.artifacts.push(resolvedArtifact);
|
|
2571
|
-
return resolvedArtifact;
|
|
2572
|
-
}
|
|
2573
|
-
const table = [];
|
|
2574
|
-
for (let i = 65; i < 91; i++) table.push(String.fromCharCode(i));
|
|
2575
|
-
for (let i = 97; i < 123; i++) table.push(String.fromCharCode(i));
|
|
2576
|
-
for (let i = 0; i < 10; i++) table.push(i.toString(10));
|
|
2577
|
-
table.push("+", "/");
|
|
2578
|
-
function encodeUint8Array(bytes) {
|
|
2579
|
-
let base64 = "";
|
|
2580
|
-
const len = bytes.byteLength;
|
|
2581
|
-
for (let i = 0; i < len; i += 3) if (len === i + 1) {
|
|
2582
|
-
const a = (bytes[i] & 252) >> 2;
|
|
2583
|
-
const b = (bytes[i] & 3) << 4;
|
|
2584
|
-
base64 += table[a];
|
|
2585
|
-
base64 += table[b];
|
|
2586
|
-
base64 += "==";
|
|
2587
|
-
} else if (len === i + 2) {
|
|
2588
|
-
const a = (bytes[i] & 252) >> 2;
|
|
2589
|
-
const b = (bytes[i] & 3) << 4 | (bytes[i + 1] & 240) >> 4;
|
|
2590
|
-
const c = (bytes[i + 1] & 15) << 2;
|
|
2591
|
-
base64 += table[a];
|
|
2592
|
-
base64 += table[b];
|
|
2593
|
-
base64 += table[c];
|
|
2594
|
-
base64 += "=";
|
|
2595
|
-
} else {
|
|
2596
|
-
const a = (bytes[i] & 252) >> 2;
|
|
2597
|
-
const b = (bytes[i] & 3) << 4 | (bytes[i + 1] & 240) >> 4;
|
|
2598
|
-
const c = (bytes[i + 1] & 15) << 2 | (bytes[i + 2] & 192) >> 6;
|
|
2599
|
-
const d$1 = bytes[i + 2] & 63;
|
|
2600
|
-
base64 += table[a];
|
|
2601
|
-
base64 += table[b];
|
|
2602
|
-
base64 += table[c];
|
|
2603
|
-
base64 += table[d$1];
|
|
2604
|
-
}
|
|
2605
|
-
return base64;
|
|
2606
|
-
}
|
|
2607
|
-
/**
|
|
2608
|
-
* Records an async operation associated with a test task.
|
|
2609
|
-
*
|
|
2610
|
-
* This function tracks promises that should be awaited before a test completes.
|
|
2611
|
-
* The promise is automatically removed from the test's promise list once it settles.
|
|
2612
|
-
*/
|
|
2613
|
-
function recordAsyncOperation(test$7, promise) {
|
|
2614
|
-
promise = promise.finally(() => {
|
|
2615
|
-
if (!test$7.promises) return;
|
|
2616
|
-
const index = test$7.promises.indexOf(promise);
|
|
2617
|
-
if (index !== -1) test$7.promises.splice(index, 1);
|
|
2618
|
-
});
|
|
2619
|
-
if (!test$7.promises) test$7.promises = [];
|
|
2620
|
-
test$7.promises.push(promise);
|
|
2621
|
-
return promise;
|
|
2622
|
-
}
|
|
2623
|
-
/**
|
|
2624
|
-
* Validates and prepares a test attachment for serialization.
|
|
2625
|
-
*
|
|
2626
|
-
* This function ensures attachments have either `body` or `path` set (but not both), and converts `Uint8Array` bodies to base64-encoded strings for easier serialization.
|
|
2627
|
-
*
|
|
2628
|
-
* @param attachment - The attachment to validate and prepare
|
|
2629
|
-
*
|
|
2630
|
-
* @throws {TypeError} If neither `body` nor `path` is provided
|
|
2631
|
-
* @throws {TypeError} If both `body` and `path` are provided
|
|
2632
|
-
*/
|
|
2633
|
-
function manageArtifactAttachment(attachment) {
|
|
2634
|
-
if (attachment.body == null && !attachment.path) throw new TypeError(`Test attachment requires "body" or "path" to be set. Both are missing.`);
|
|
2635
|
-
if (attachment.body && attachment.path) throw new TypeError(`Test attachment requires only one of "body" or "path" to be set. Both are specified.`);
|
|
2636
|
-
if (attachment.body instanceof Uint8Array) attachment.body = encodeUint8Array(attachment.body);
|
|
2637
|
-
}
|
|
2638
|
-
|
|
2639
|
-
//#endregion
|
|
2640
|
-
//#region ../../../../node_modules/expect-type/dist/branding.js
|
|
2641
|
-
var require_branding = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2642
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2643
|
-
}));
|
|
2644
|
-
|
|
2645
|
-
//#endregion
|
|
2646
|
-
//#region ../../../../node_modules/expect-type/dist/messages.js
|
|
2647
|
-
var require_messages = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2648
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2649
|
-
}));
|
|
2650
|
-
|
|
2651
|
-
//#endregion
|
|
2652
|
-
//#region ../../../../node_modules/expect-type/dist/overloads.js
|
|
2653
|
-
var require_overloads = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2654
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2655
|
-
}));
|
|
2656
|
-
|
|
2657
|
-
//#endregion
|
|
2658
|
-
//#region ../../../../node_modules/expect-type/dist/utils.js
|
|
2659
|
-
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2660
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2661
|
-
}));
|
|
2662
|
-
|
|
2663
|
-
//#endregion
|
|
2664
|
-
//#region ../../../../node_modules/expect-type/dist/index.js
|
|
2665
|
-
var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
2666
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
2667
|
-
if (k2 === void 0) k2 = k;
|
|
2668
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2669
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
2670
|
-
enumerable: true,
|
|
2671
|
-
get: function() {
|
|
2672
|
-
return m[k];
|
|
2673
|
-
}
|
|
2674
|
-
};
|
|
2675
|
-
Object.defineProperty(o, k2, desc);
|
|
2676
|
-
}) : (function(o, m, k, k2) {
|
|
2677
|
-
if (k2 === void 0) k2 = k;
|
|
2678
|
-
o[k2] = m[k];
|
|
2679
|
-
}));
|
|
2680
|
-
var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
|
|
2681
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
|
|
2682
|
-
};
|
|
2683
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2684
|
-
exports.expectTypeOf = void 0;
|
|
2685
|
-
__exportStar(require_branding(), exports);
|
|
2686
|
-
__exportStar(require_messages(), exports);
|
|
2687
|
-
__exportStar(require_overloads(), exports);
|
|
2688
|
-
__exportStar(require_utils(), exports);
|
|
2689
|
-
const fn = () => true;
|
|
2690
|
-
/**
|
|
2691
|
-
* Similar to Jest's `expect`, but with type-awareness.
|
|
2692
|
-
* Gives you access to a number of type-matchers that let you make assertions about the
|
|
2693
|
-
* form of a reference or generic type parameter.
|
|
2694
|
-
*
|
|
2695
|
-
* @example
|
|
2696
|
-
* ```ts
|
|
2697
|
-
* import { foo, bar } from '../foo'
|
|
2698
|
-
* import { expectTypeOf } from 'expect-type'
|
|
2699
|
-
*
|
|
2700
|
-
* test('foo types', () => {
|
|
2701
|
-
* // make sure `foo` has type { a: number }
|
|
2702
|
-
* expectTypeOf(foo).toMatchTypeOf({ a: 1 })
|
|
2703
|
-
* expectTypeOf(foo).toHaveProperty('a').toBeNumber()
|
|
2704
|
-
*
|
|
2705
|
-
* // make sure `bar` is a function taking a string:
|
|
2706
|
-
* expectTypeOf(bar).parameter(0).toBeString()
|
|
2707
|
-
* expectTypeOf(bar).returns.not.toBeAny()
|
|
2708
|
-
* })
|
|
2709
|
-
* ```
|
|
2710
|
-
*
|
|
2711
|
-
* @description
|
|
2712
|
-
* See the [full docs](https://npmjs.com/package/expect-type#documentation) for lots more examples.
|
|
2713
|
-
*/
|
|
2714
|
-
const expectTypeOf$1 = (_actual) => {
|
|
2715
|
-
const nonFunctionProperties = [
|
|
2716
|
-
"parameters",
|
|
2717
|
-
"returns",
|
|
2718
|
-
"resolves",
|
|
2719
|
-
"not",
|
|
2720
|
-
"items",
|
|
2721
|
-
"constructorParameters",
|
|
2722
|
-
"thisParameter",
|
|
2723
|
-
"instance",
|
|
2724
|
-
"guards",
|
|
2725
|
-
"asserts",
|
|
2726
|
-
"branded"
|
|
2727
|
-
];
|
|
2728
|
-
const obj = {
|
|
2729
|
-
toBeAny: fn,
|
|
2730
|
-
toBeUnknown: fn,
|
|
2731
|
-
toBeNever: fn,
|
|
2732
|
-
toBeFunction: fn,
|
|
2733
|
-
toBeObject: fn,
|
|
2734
|
-
toBeArray: fn,
|
|
2735
|
-
toBeString: fn,
|
|
2736
|
-
toBeNumber: fn,
|
|
2737
|
-
toBeBoolean: fn,
|
|
2738
|
-
toBeVoid: fn,
|
|
2739
|
-
toBeSymbol: fn,
|
|
2740
|
-
toBeNull: fn,
|
|
2741
|
-
toBeUndefined: fn,
|
|
2742
|
-
toBeNullable: fn,
|
|
2743
|
-
toBeBigInt: fn,
|
|
2744
|
-
toMatchTypeOf: fn,
|
|
2745
|
-
toEqualTypeOf: fn,
|
|
2746
|
-
toBeConstructibleWith: fn,
|
|
2747
|
-
toMatchObjectType: fn,
|
|
2748
|
-
toExtend: fn,
|
|
2749
|
-
map: exports.expectTypeOf,
|
|
2750
|
-
toBeCallableWith: exports.expectTypeOf,
|
|
2751
|
-
extract: exports.expectTypeOf,
|
|
2752
|
-
exclude: exports.expectTypeOf,
|
|
2753
|
-
pick: exports.expectTypeOf,
|
|
2754
|
-
omit: exports.expectTypeOf,
|
|
2755
|
-
toHaveProperty: exports.expectTypeOf,
|
|
2756
|
-
parameter: exports.expectTypeOf
|
|
2757
|
-
};
|
|
2758
|
-
nonFunctionProperties.forEach((prop) => Object.defineProperty(obj, prop, { get: () => (0, exports.expectTypeOf)({}) }));
|
|
2759
|
-
return obj;
|
|
2760
|
-
};
|
|
2761
|
-
exports.expectTypeOf = expectTypeOf$1;
|
|
2762
|
-
}));
|
|
2763
|
-
|
|
2764
|
-
//#endregion
|
|
2765
|
-
//#region ../../../../node_modules/vitest/dist/index.js
|
|
2766
|
-
var import_dist = require_dist();
|
|
2767
|
-
|
|
2768
|
-
//#endregion
|
|
2769
|
-
export { };
|
|
2770
|
-
//# sourceMappingURL=dist-BlfFtOk2.js.map
|