@depup/msw 2.12.13-depup.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +40 -0
- package/browser/package.json +31 -0
- package/changes.json +46 -0
- package/cli/index.js +35 -0
- package/cli/init.js +226 -0
- package/cli/invariant.js +9 -0
- package/cli/package.json +3 -0
- package/config/constants.js +13 -0
- package/config/package.json +3 -0
- package/config/scripts/postinstall.js +36 -0
- package/lib/browser/index.d.mts +102 -0
- package/lib/browser/index.d.ts +102 -0
- package/lib/browser/index.js +2911 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/index.mjs +2888 -0
- package/lib/browser/index.mjs.map +1 -0
- package/lib/core/HttpResponse-Be4eT3x6.d.mts +338 -0
- package/lib/core/HttpResponse-Dj6ibgFJ.d.ts +338 -0
- package/lib/core/HttpResponse.d.mts +6 -0
- package/lib/core/HttpResponse.d.ts +6 -0
- package/lib/core/HttpResponse.js +176 -0
- package/lib/core/HttpResponse.js.map +1 -0
- package/lib/core/HttpResponse.mjs +159 -0
- package/lib/core/HttpResponse.mjs.map +1 -0
- package/lib/core/SetupApi.d.mts +44 -0
- package/lib/core/SetupApi.d.ts +44 -0
- package/lib/core/SetupApi.js +112 -0
- package/lib/core/SetupApi.js.map +1 -0
- package/lib/core/SetupApi.mjs +92 -0
- package/lib/core/SetupApi.mjs.map +1 -0
- package/lib/core/bypass.d.mts +16 -0
- package/lib/core/bypass.d.ts +16 -0
- package/lib/core/bypass.js +42 -0
- package/lib/core/bypass.js.map +1 -0
- package/lib/core/bypass.mjs +22 -0
- package/lib/core/bypass.mjs.map +1 -0
- package/lib/core/delay.d.mts +18 -0
- package/lib/core/delay.d.ts +18 -0
- package/lib/core/delay.js +77 -0
- package/lib/core/delay.js.map +1 -0
- package/lib/core/delay.mjs +57 -0
- package/lib/core/delay.mjs.map +1 -0
- package/lib/core/getResponse.d.mts +18 -0
- package/lib/core/getResponse.d.ts +18 -0
- package/lib/core/getResponse.js +35 -0
- package/lib/core/getResponse.js.map +1 -0
- package/lib/core/getResponse.mjs +17 -0
- package/lib/core/getResponse.mjs.map +1 -0
- package/lib/core/graphql.d.mts +76 -0
- package/lib/core/graphql.d.ts +76 -0
- package/lib/core/graphql.js +90 -0
- package/lib/core/graphql.js.map +1 -0
- package/lib/core/graphql.mjs +72 -0
- package/lib/core/graphql.mjs.map +1 -0
- package/lib/core/handlers/GraphQLHandler.d.mts +6 -0
- package/lib/core/handlers/GraphQLHandler.d.ts +6 -0
- package/lib/core/handlers/GraphQLHandler.js +231 -0
- package/lib/core/handlers/GraphQLHandler.js.map +1 -0
- package/lib/core/handlers/GraphQLHandler.mjs +218 -0
- package/lib/core/handlers/GraphQLHandler.mjs.map +1 -0
- package/lib/core/handlers/HttpHandler.d.mts +75 -0
- package/lib/core/handlers/HttpHandler.d.ts +75 -0
- package/lib/core/handlers/HttpHandler.js +128 -0
- package/lib/core/handlers/HttpHandler.js.map +1 -0
- package/lib/core/handlers/HttpHandler.mjs +112 -0
- package/lib/core/handlers/HttpHandler.mjs.map +1 -0
- package/lib/core/handlers/RequestHandler.d.mts +6 -0
- package/lib/core/handlers/RequestHandler.d.ts +6 -0
- package/lib/core/handlers/RequestHandler.js +173 -0
- package/lib/core/handlers/RequestHandler.js.map +1 -0
- package/lib/core/handlers/RequestHandler.mjs +155 -0
- package/lib/core/handlers/RequestHandler.mjs.map +1 -0
- package/lib/core/handlers/WebSocketHandler.d.mts +42 -0
- package/lib/core/handlers/WebSocketHandler.d.ts +42 -0
- package/lib/core/handlers/WebSocketHandler.js +147 -0
- package/lib/core/handlers/WebSocketHandler.js.map +1 -0
- package/lib/core/handlers/WebSocketHandler.mjs +129 -0
- package/lib/core/handlers/WebSocketHandler.mjs.map +1 -0
- package/lib/core/handlers/common.d.mts +3 -0
- package/lib/core/handlers/common.d.ts +3 -0
- package/lib/core/handlers/common.js +17 -0
- package/lib/core/handlers/common.js.map +1 -0
- package/lib/core/handlers/common.mjs +1 -0
- package/lib/core/handlers/common.mjs.map +1 -0
- package/lib/core/http.d.mts +31 -0
- package/lib/core/http.d.ts +31 -0
- package/lib/core/http.js +40 -0
- package/lib/core/http.js.map +1 -0
- package/lib/core/http.mjs +23 -0
- package/lib/core/http.mjs.map +1 -0
- package/lib/core/index.d.mts +32 -0
- package/lib/core/index.d.ts +32 -0
- package/lib/core/index.js +64 -0
- package/lib/core/index.js.map +1 -0
- package/lib/core/index.mjs +52 -0
- package/lib/core/index.mjs.map +1 -0
- package/lib/core/isCommonAssetRequest.d.mts +20 -0
- package/lib/core/isCommonAssetRequest.d.ts +20 -0
- package/lib/core/isCommonAssetRequest.js +42 -0
- package/lib/core/isCommonAssetRequest.js.map +1 -0
- package/lib/core/isCommonAssetRequest.mjs +22 -0
- package/lib/core/isCommonAssetRequest.mjs.map +1 -0
- package/lib/core/passthrough.d.mts +24 -0
- package/lib/core/passthrough.d.ts +24 -0
- package/lib/core/passthrough.js +33 -0
- package/lib/core/passthrough.js.map +1 -0
- package/lib/core/passthrough.mjs +13 -0
- package/lib/core/passthrough.mjs.map +1 -0
- package/lib/core/sharedOptions.d.mts +64 -0
- package/lib/core/sharedOptions.d.ts +64 -0
- package/lib/core/sharedOptions.js +17 -0
- package/lib/core/sharedOptions.js.map +1 -0
- package/lib/core/sharedOptions.mjs +1 -0
- package/lib/core/sharedOptions.mjs.map +1 -0
- package/lib/core/sse.d.mts +116 -0
- package/lib/core/sse.d.ts +116 -0
- package/lib/core/sse.js +607 -0
- package/lib/core/sse.js.map +1 -0
- package/lib/core/sse.mjs +589 -0
- package/lib/core/sse.mjs.map +1 -0
- package/lib/core/typeUtils.d.mts +12 -0
- package/lib/core/typeUtils.d.ts +12 -0
- package/lib/core/typeUtils.js +17 -0
- package/lib/core/typeUtils.js.map +1 -0
- package/lib/core/typeUtils.mjs +1 -0
- package/lib/core/typeUtils.mjs.map +1 -0
- package/lib/core/utils/HttpResponse/decorators.d.mts +17 -0
- package/lib/core/utils/HttpResponse/decorators.d.ts +17 -0
- package/lib/core/utils/HttpResponse/decorators.js +77 -0
- package/lib/core/utils/HttpResponse/decorators.js.map +1 -0
- package/lib/core/utils/HttpResponse/decorators.mjs +47 -0
- package/lib/core/utils/HttpResponse/decorators.mjs.map +1 -0
- package/lib/core/utils/cookieStore.d.mts +13 -0
- package/lib/core/utils/cookieStore.d.ts +13 -0
- package/lib/core/utils/cookieStore.js +90 -0
- package/lib/core/utils/cookieStore.js.map +1 -0
- package/lib/core/utils/cookieStore.mjs +74 -0
- package/lib/core/utils/cookieStore.mjs.map +1 -0
- package/lib/core/utils/executeHandlers.d.mts +6 -0
- package/lib/core/utils/executeHandlers.d.ts +6 -0
- package/lib/core/utils/executeHandlers.js +50 -0
- package/lib/core/utils/executeHandlers.js.map +1 -0
- package/lib/core/utils/executeHandlers.mjs +30 -0
- package/lib/core/utils/executeHandlers.mjs.map +1 -0
- package/lib/core/utils/handleRequest.d.mts +29 -0
- package/lib/core/utils/handleRequest.d.ts +29 -0
- package/lib/core/utils/handleRequest.js +76 -0
- package/lib/core/utils/handleRequest.js.map +1 -0
- package/lib/core/utils/handleRequest.mjs +58 -0
- package/lib/core/utils/handleRequest.mjs.map +1 -0
- package/lib/core/utils/internal/Disposable.d.mts +7 -0
- package/lib/core/utils/internal/Disposable.d.ts +7 -0
- package/lib/core/utils/internal/Disposable.js +33 -0
- package/lib/core/utils/internal/Disposable.js.map +1 -0
- package/lib/core/utils/internal/Disposable.mjs +13 -0
- package/lib/core/utils/internal/Disposable.mjs.map +1 -0
- package/lib/core/utils/internal/checkGlobals.d.mts +3 -0
- package/lib/core/utils/internal/checkGlobals.d.ts +3 -0
- package/lib/core/utils/internal/checkGlobals.js +34 -0
- package/lib/core/utils/internal/checkGlobals.js.map +1 -0
- package/lib/core/utils/internal/checkGlobals.mjs +14 -0
- package/lib/core/utils/internal/checkGlobals.mjs.map +1 -0
- package/lib/core/utils/internal/devUtils.d.mts +28 -0
- package/lib/core/utils/internal/devUtils.d.ts +28 -0
- package/lib/core/utils/internal/devUtils.js +48 -0
- package/lib/core/utils/internal/devUtils.js.map +1 -0
- package/lib/core/utils/internal/devUtils.mjs +28 -0
- package/lib/core/utils/internal/devUtils.mjs.map +1 -0
- package/lib/core/utils/internal/getCallFrame.d.mts +6 -0
- package/lib/core/utils/internal/getCallFrame.d.ts +6 -0
- package/lib/core/utils/internal/getCallFrame.js +41 -0
- package/lib/core/utils/internal/getCallFrame.js.map +1 -0
- package/lib/core/utils/internal/getCallFrame.mjs +21 -0
- package/lib/core/utils/internal/getCallFrame.mjs.map +1 -0
- package/lib/core/utils/internal/hasRefCounted.d.mts +3 -0
- package/lib/core/utils/internal/hasRefCounted.d.ts +3 -0
- package/lib/core/utils/internal/hasRefCounted.js +27 -0
- package/lib/core/utils/internal/hasRefCounted.js.map +1 -0
- package/lib/core/utils/internal/hasRefCounted.mjs +7 -0
- package/lib/core/utils/internal/hasRefCounted.mjs.map +1 -0
- package/lib/core/utils/internal/isHandlerKind.d.mts +19 -0
- package/lib/core/utils/internal/isHandlerKind.d.ts +19 -0
- package/lib/core/utils/internal/isHandlerKind.js +29 -0
- package/lib/core/utils/internal/isHandlerKind.js.map +1 -0
- package/lib/core/utils/internal/isHandlerKind.mjs +9 -0
- package/lib/core/utils/internal/isHandlerKind.mjs.map +1 -0
- package/lib/core/utils/internal/isIterable.d.mts +20 -0
- package/lib/core/utils/internal/isIterable.d.ts +20 -0
- package/lib/core/utils/internal/isIterable.js +30 -0
- package/lib/core/utils/internal/isIterable.js.map +1 -0
- package/lib/core/utils/internal/isIterable.mjs +10 -0
- package/lib/core/utils/internal/isIterable.mjs.map +1 -0
- package/lib/core/utils/internal/isObject.d.mts +6 -0
- package/lib/core/utils/internal/isObject.d.ts +6 -0
- package/lib/core/utils/internal/isObject.js +27 -0
- package/lib/core/utils/internal/isObject.js.map +1 -0
- package/lib/core/utils/internal/isObject.mjs +7 -0
- package/lib/core/utils/internal/isObject.mjs.map +1 -0
- package/lib/core/utils/internal/isStringEqual.d.mts +6 -0
- package/lib/core/utils/internal/isStringEqual.d.ts +6 -0
- package/lib/core/utils/internal/isStringEqual.js +27 -0
- package/lib/core/utils/internal/isStringEqual.js.map +1 -0
- package/lib/core/utils/internal/isStringEqual.mjs +7 -0
- package/lib/core/utils/internal/isStringEqual.mjs.map +1 -0
- package/lib/core/utils/internal/jsonParse.d.mts +7 -0
- package/lib/core/utils/internal/jsonParse.d.ts +7 -0
- package/lib/core/utils/internal/jsonParse.js +31 -0
- package/lib/core/utils/internal/jsonParse.js.map +1 -0
- package/lib/core/utils/internal/jsonParse.mjs +11 -0
- package/lib/core/utils/internal/jsonParse.mjs.map +1 -0
- package/lib/core/utils/internal/mergeRight.d.mts +7 -0
- package/lib/core/utils/internal/mergeRight.d.ts +7 -0
- package/lib/core/utils/internal/mergeRight.js +43 -0
- package/lib/core/utils/internal/mergeRight.js.map +1 -0
- package/lib/core/utils/internal/mergeRight.mjs +23 -0
- package/lib/core/utils/internal/mergeRight.mjs.map +1 -0
- package/lib/core/utils/internal/parseGraphQLRequest.d.mts +6 -0
- package/lib/core/utils/internal/parseGraphQLRequest.d.ts +6 -0
- package/lib/core/utils/internal/parseGraphQLRequest.js +146 -0
- package/lib/core/utils/internal/parseGraphQLRequest.js.map +1 -0
- package/lib/core/utils/internal/parseGraphQLRequest.mjs +129 -0
- package/lib/core/utils/internal/parseGraphQLRequest.mjs.map +1 -0
- package/lib/core/utils/internal/parseMultipartData.d.mts +14 -0
- package/lib/core/utils/internal/parseMultipartData.d.ts +14 -0
- package/lib/core/utils/internal/parseMultipartData.js +83 -0
- package/lib/core/utils/internal/parseMultipartData.js.map +1 -0
- package/lib/core/utils/internal/parseMultipartData.mjs +63 -0
- package/lib/core/utils/internal/parseMultipartData.mjs.map +1 -0
- package/lib/core/utils/internal/pipeEvents.d.mts +8 -0
- package/lib/core/utils/internal/pipeEvents.d.ts +8 -0
- package/lib/core/utils/internal/pipeEvents.js +36 -0
- package/lib/core/utils/internal/pipeEvents.js.map +1 -0
- package/lib/core/utils/internal/pipeEvents.mjs +16 -0
- package/lib/core/utils/internal/pipeEvents.mjs.map +1 -0
- package/lib/core/utils/internal/requestHandlerUtils.d.mts +12 -0
- package/lib/core/utils/internal/requestHandlerUtils.d.ts +12 -0
- package/lib/core/utils/internal/requestHandlerUtils.js +37 -0
- package/lib/core/utils/internal/requestHandlerUtils.js.map +1 -0
- package/lib/core/utils/internal/requestHandlerUtils.mjs +17 -0
- package/lib/core/utils/internal/requestHandlerUtils.mjs.map +1 -0
- package/lib/core/utils/internal/toReadonlyArray.d.mts +6 -0
- package/lib/core/utils/internal/toReadonlyArray.d.ts +6 -0
- package/lib/core/utils/internal/toReadonlyArray.js +29 -0
- package/lib/core/utils/internal/toReadonlyArray.js.map +1 -0
- package/lib/core/utils/internal/toReadonlyArray.mjs +9 -0
- package/lib/core/utils/internal/toReadonlyArray.mjs.map +1 -0
- package/lib/core/utils/internal/tryCatch.d.mts +3 -0
- package/lib/core/utils/internal/tryCatch.d.ts +3 -0
- package/lib/core/utils/internal/tryCatch.js +32 -0
- package/lib/core/utils/internal/tryCatch.js.map +1 -0
- package/lib/core/utils/internal/tryCatch.mjs +12 -0
- package/lib/core/utils/internal/tryCatch.mjs.map +1 -0
- package/lib/core/utils/logging/getStatusCodeColor.d.mts +11 -0
- package/lib/core/utils/logging/getStatusCodeColor.d.ts +11 -0
- package/lib/core/utils/logging/getStatusCodeColor.js +40 -0
- package/lib/core/utils/logging/getStatusCodeColor.js.map +1 -0
- package/lib/core/utils/logging/getStatusCodeColor.mjs +20 -0
- package/lib/core/utils/logging/getStatusCodeColor.mjs.map +1 -0
- package/lib/core/utils/logging/getTimestamp.d.mts +9 -0
- package/lib/core/utils/logging/getTimestamp.d.ts +9 -0
- package/lib/core/utils/logging/getTimestamp.js +32 -0
- package/lib/core/utils/logging/getTimestamp.js.map +1 -0
- package/lib/core/utils/logging/getTimestamp.mjs +12 -0
- package/lib/core/utils/logging/getTimestamp.mjs.map +1 -0
- package/lib/core/utils/logging/serializeRequest.d.mts +12 -0
- package/lib/core/utils/logging/serializeRequest.d.ts +12 -0
- package/lib/core/utils/logging/serializeRequest.js +34 -0
- package/lib/core/utils/logging/serializeRequest.js.map +1 -0
- package/lib/core/utils/logging/serializeRequest.mjs +14 -0
- package/lib/core/utils/logging/serializeRequest.mjs.map +1 -0
- package/lib/core/utils/logging/serializeResponse.d.mts +9 -0
- package/lib/core/utils/logging/serializeResponse.d.ts +9 -0
- package/lib/core/utils/logging/serializeResponse.js +48 -0
- package/lib/core/utils/logging/serializeResponse.js.map +1 -0
- package/lib/core/utils/logging/serializeResponse.mjs +18 -0
- package/lib/core/utils/logging/serializeResponse.mjs.map +1 -0
- package/lib/core/utils/matching/matchRequestUrl.d.mts +20 -0
- package/lib/core/utils/matching/matchRequestUrl.d.ts +20 -0
- package/lib/core/utils/matching/matchRequestUrl.js +55 -0
- package/lib/core/utils/matching/matchRequestUrl.js.map +1 -0
- package/lib/core/utils/matching/matchRequestUrl.mjs +35 -0
- package/lib/core/utils/matching/matchRequestUrl.mjs.map +1 -0
- package/lib/core/utils/matching/normalizePath.d.mts +13 -0
- package/lib/core/utils/matching/normalizePath.d.ts +13 -0
- package/lib/core/utils/matching/normalizePath.js +33 -0
- package/lib/core/utils/matching/normalizePath.js.map +1 -0
- package/lib/core/utils/matching/normalizePath.mjs +13 -0
- package/lib/core/utils/matching/normalizePath.mjs.map +1 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.d.mts +14 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.d.ts +14 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.js +61 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.js.map +1 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.mjs +41 -0
- package/lib/core/utils/request/getAllAcceptedMimeTypes.mjs.map +1 -0
- package/lib/core/utils/request/getRequestCookies.d.mts +3 -0
- package/lib/core/utils/request/getRequestCookies.d.ts +3 -0
- package/lib/core/utils/request/getRequestCookies.js +79 -0
- package/lib/core/utils/request/getRequestCookies.js.map +1 -0
- package/lib/core/utils/request/getRequestCookies.mjs +62 -0
- package/lib/core/utils/request/getRequestCookies.mjs.map +1 -0
- package/lib/core/utils/request/onUnhandledRequest.d.mts +9 -0
- package/lib/core/utils/request/onUnhandledRequest.d.ts +9 -0
- package/lib/core/utils/request/onUnhandledRequest.js +76 -0
- package/lib/core/utils/request/onUnhandledRequest.js.map +1 -0
- package/lib/core/utils/request/onUnhandledRequest.mjs +56 -0
- package/lib/core/utils/request/onUnhandledRequest.mjs.map +1 -0
- package/lib/core/utils/request/storeResponseCookies.d.mts +3 -0
- package/lib/core/utils/request/storeResponseCookies.d.ts +3 -0
- package/lib/core/utils/request/storeResponseCookies.js +32 -0
- package/lib/core/utils/request/storeResponseCookies.js.map +1 -0
- package/lib/core/utils/request/storeResponseCookies.mjs +12 -0
- package/lib/core/utils/request/storeResponseCookies.mjs.map +1 -0
- package/lib/core/utils/request/toPublicUrl.d.mts +7 -0
- package/lib/core/utils/request/toPublicUrl.d.ts +7 -0
- package/lib/core/utils/request/toPublicUrl.js +31 -0
- package/lib/core/utils/request/toPublicUrl.js.map +1 -0
- package/lib/core/utils/request/toPublicUrl.mjs +11 -0
- package/lib/core/utils/request/toPublicUrl.mjs.map +1 -0
- package/lib/core/utils/toResponseInit.d.mts +3 -0
- package/lib/core/utils/toResponseInit.d.ts +3 -0
- package/lib/core/utils/toResponseInit.js +31 -0
- package/lib/core/utils/toResponseInit.js.map +1 -0
- package/lib/core/utils/toResponseInit.mjs +11 -0
- package/lib/core/utils/toResponseInit.mjs.map +1 -0
- package/lib/core/utils/url/cleanUrl.d.mts +7 -0
- package/lib/core/utils/url/cleanUrl.d.ts +7 -0
- package/lib/core/utils/url/cleanUrl.js +31 -0
- package/lib/core/utils/url/cleanUrl.js.map +1 -0
- package/lib/core/utils/url/cleanUrl.mjs +11 -0
- package/lib/core/utils/url/cleanUrl.mjs.map +1 -0
- package/lib/core/utils/url/getAbsoluteUrl.d.mts +6 -0
- package/lib/core/utils/url/getAbsoluteUrl.d.ts +6 -0
- package/lib/core/utils/url/getAbsoluteUrl.js +38 -0
- package/lib/core/utils/url/getAbsoluteUrl.js.map +1 -0
- package/lib/core/utils/url/getAbsoluteUrl.mjs +18 -0
- package/lib/core/utils/url/getAbsoluteUrl.mjs.map +1 -0
- package/lib/core/utils/url/isAbsoluteUrl.d.mts +6 -0
- package/lib/core/utils/url/isAbsoluteUrl.d.ts +6 -0
- package/lib/core/utils/url/isAbsoluteUrl.js +27 -0
- package/lib/core/utils/url/isAbsoluteUrl.js.map +1 -0
- package/lib/core/utils/url/isAbsoluteUrl.mjs +7 -0
- package/lib/core/utils/url/isAbsoluteUrl.mjs.map +1 -0
- package/lib/core/ws/WebSocketClientManager.d.mts +65 -0
- package/lib/core/ws/WebSocketClientManager.d.ts +65 -0
- package/lib/core/ws/WebSocketClientManager.js +159 -0
- package/lib/core/ws/WebSocketClientManager.js.map +1 -0
- package/lib/core/ws/WebSocketClientManager.mjs +139 -0
- package/lib/core/ws/WebSocketClientManager.mjs.map +1 -0
- package/lib/core/ws/WebSocketClientStore.d.mts +13 -0
- package/lib/core/ws/WebSocketClientStore.d.ts +13 -0
- package/lib/core/ws/WebSocketClientStore.js +26 -0
- package/lib/core/ws/WebSocketClientStore.js.map +1 -0
- package/lib/core/ws/WebSocketClientStore.mjs +6 -0
- package/lib/core/ws/WebSocketClientStore.mjs.map +1 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.d.mts +14 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.d.ts +14 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.js +130 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.js.map +1 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.mjs +110 -0
- package/lib/core/ws/WebSocketIndexedDBClientStore.mjs.map +1 -0
- package/lib/core/ws/WebSocketMemoryClientStore.d.mts +12 -0
- package/lib/core/ws/WebSocketMemoryClientStore.d.ts +12 -0
- package/lib/core/ws/WebSocketMemoryClientStore.js +41 -0
- package/lib/core/ws/WebSocketMemoryClientStore.js.map +1 -0
- package/lib/core/ws/WebSocketMemoryClientStore.mjs +21 -0
- package/lib/core/ws/WebSocketMemoryClientStore.mjs.map +1 -0
- package/lib/core/ws/handleWebSocketEvent.d.mts +20 -0
- package/lib/core/ws/handleWebSocketEvent.d.ts +20 -0
- package/lib/core/ws/handleWebSocketEvent.js +61 -0
- package/lib/core/ws/handleWebSocketEvent.js.map +1 -0
- package/lib/core/ws/handleWebSocketEvent.mjs +43 -0
- package/lib/core/ws/handleWebSocketEvent.mjs.map +1 -0
- package/lib/core/ws/utils/attachWebSocketLogger.d.mts +18 -0
- package/lib/core/ws/utils/attachWebSocketLogger.d.ts +18 -0
- package/lib/core/ws/utils/attachWebSocketLogger.js +199 -0
- package/lib/core/ws/utils/attachWebSocketLogger.js.map +1 -0
- package/lib/core/ws/utils/attachWebSocketLogger.mjs +179 -0
- package/lib/core/ws/utils/attachWebSocketLogger.mjs.map +1 -0
- package/lib/core/ws/utils/getMessageLength.d.mts +11 -0
- package/lib/core/ws/utils/getMessageLength.d.ts +11 -0
- package/lib/core/ws/utils/getMessageLength.js +34 -0
- package/lib/core/ws/utils/getMessageLength.js.map +1 -0
- package/lib/core/ws/utils/getMessageLength.mjs +14 -0
- package/lib/core/ws/utils/getMessageLength.mjs.map +1 -0
- package/lib/core/ws/utils/getPublicData.d.mts +5 -0
- package/lib/core/ws/utils/getPublicData.d.ts +5 -0
- package/lib/core/ws/utils/getPublicData.js +37 -0
- package/lib/core/ws/utils/getPublicData.js.map +1 -0
- package/lib/core/ws/utils/getPublicData.mjs +17 -0
- package/lib/core/ws/utils/getPublicData.mjs.map +1 -0
- package/lib/core/ws/utils/truncateMessage.d.mts +3 -0
- package/lib/core/ws/utils/truncateMessage.d.ts +3 -0
- package/lib/core/ws/utils/truncateMessage.js +31 -0
- package/lib/core/ws/utils/truncateMessage.js.map +1 -0
- package/lib/core/ws/utils/truncateMessage.mjs +11 -0
- package/lib/core/ws/utils/truncateMessage.mjs.map +1 -0
- package/lib/core/ws/webSocketInterceptor.d.mts +5 -0
- package/lib/core/ws/webSocketInterceptor.d.ts +5 -0
- package/lib/core/ws/webSocketInterceptor.js +26 -0
- package/lib/core/ws/webSocketInterceptor.js.map +1 -0
- package/lib/core/ws/webSocketInterceptor.mjs +6 -0
- package/lib/core/ws/webSocketInterceptor.mjs.map +1 -0
- package/lib/core/ws.d.mts +75 -0
- package/lib/core/ws.d.ts +75 -0
- package/lib/core/ws.js +69 -0
- package/lib/core/ws.js.map +1 -0
- package/lib/core/ws.mjs +52 -0
- package/lib/core/ws.mjs.map +1 -0
- package/lib/iife/index.js +23752 -0
- package/lib/iife/index.js.map +1 -0
- package/lib/mockServiceWorker.js +349 -0
- package/lib/native/index.d.mts +74 -0
- package/lib/native/index.d.ts +74 -0
- package/lib/native/index.js +156 -0
- package/lib/native/index.js.map +1 -0
- package/lib/native/index.mjs +134 -0
- package/lib/native/index.mjs.map +1 -0
- package/lib/node/index.d.mts +91 -0
- package/lib/node/index.d.ts +91 -0
- package/lib/node/index.js +209 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/index.mjs +184 -0
- package/lib/node/index.mjs.map +1 -0
- package/lib/shims/cookie.d.mts +7 -0
- package/lib/shims/cookie.d.ts +7 -0
- package/lib/shims/cookie.js +204 -0
- package/lib/shims/cookie.mjs +196 -0
- package/lib/shims/statuses.d.mts +6 -0
- package/lib/shims/statuses.d.ts +6 -0
- package/lib/shims/statuses.js +195 -0
- package/lib/shims/statuses.mjs +187 -0
- package/native/package.json +30 -0
- package/node/package.json +33 -0
- package/package.json +381 -0
- package/src/browser/global.browser.d.ts +1 -0
- package/src/browser/index.ts +3 -0
- package/src/browser/setupWorker/glossary.ts +138 -0
- package/src/browser/setupWorker/setupWorker.node.test.ts +10 -0
- package/src/browser/setupWorker/setupWorker.ts +184 -0
- package/src/browser/setupWorker/start/createFallbackRequestListener.ts +71 -0
- package/src/browser/setupWorker/start/createRequestListener.ts +138 -0
- package/src/browser/setupWorker/start/createResponseListener.ts +57 -0
- package/src/browser/setupWorker/start/createStartHandler.ts +137 -0
- package/src/browser/setupWorker/start/utils/enableMocking.ts +30 -0
- package/src/browser/setupWorker/start/utils/getWorkerByRegistration.ts +25 -0
- package/src/browser/setupWorker/start/utils/getWorkerInstance.ts +97 -0
- package/src/browser/setupWorker/start/utils/prepareStartHandler.test.ts +59 -0
- package/src/browser/setupWorker/start/utils/prepareStartHandler.ts +44 -0
- package/src/browser/setupWorker/start/utils/printStartMessage.test.ts +84 -0
- package/src/browser/setupWorker/start/utils/printStartMessage.ts +51 -0
- package/src/browser/setupWorker/start/utils/validateWorkerScope.ts +18 -0
- package/src/browser/setupWorker/stop/utils/printStopMessage.test.ts +26 -0
- package/src/browser/setupWorker/stop/utils/printStopMessage.ts +13 -0
- package/src/browser/tsconfig.browser.build.json +6 -0
- package/src/browser/tsconfig.browser.json +9 -0
- package/src/browser/utils/checkWorkerIntegrity.ts +42 -0
- package/src/browser/utils/deserializeRequest.ts +15 -0
- package/src/browser/utils/getAbsoluteWorkerUrl.test.ts +29 -0
- package/src/browser/utils/getAbsoluteWorkerUrl.ts +7 -0
- package/src/browser/utils/pruneGetRequestBody.test.ts +53 -0
- package/src/browser/utils/pruneGetRequestBody.ts +21 -0
- package/src/browser/utils/supports.ts +30 -0
- package/src/browser/utils/workerChannel.ts +159 -0
- package/src/core/HttpResponse.test.ts +378 -0
- package/src/core/HttpResponse.ts +248 -0
- package/src/core/SetupApi.ts +127 -0
- package/src/core/bypass.test.ts +80 -0
- package/src/core/bypass.ts +46 -0
- package/src/core/delay.ts +82 -0
- package/src/core/getResponse.test.ts +74 -0
- package/src/core/getResponse.ts +29 -0
- package/src/core/graphql.test.ts +11 -0
- package/src/core/graphql.ts +136 -0
- package/src/core/handlers/GraphQLHandler.test.ts +873 -0
- package/src/core/handlers/GraphQLHandler.ts +437 -0
- package/src/core/handlers/HttpHandler.test.ts +253 -0
- package/src/core/handlers/HttpHandler.ts +214 -0
- package/src/core/handlers/RequestHandler.ts +391 -0
- package/src/core/handlers/WebSocketHandler.test.ts +127 -0
- package/src/core/handlers/WebSocketHandler.ts +209 -0
- package/src/core/handlers/common.ts +1 -0
- package/src/core/http.test.ts +15 -0
- package/src/core/http.ts +64 -0
- package/src/core/index.ts +110 -0
- package/src/core/isCommonAssetRequest.ts +45 -0
- package/src/core/passthrough.test.ts +11 -0
- package/src/core/passthrough.ts +25 -0
- package/src/core/sharedOptions.ts +66 -0
- package/src/core/sse.ts +916 -0
- package/src/core/typeUtils.ts +26 -0
- package/src/core/utils/HttpResponse/decorators.ts +76 -0
- package/src/core/utils/cookieStore.ts +94 -0
- package/src/core/utils/executeHandlers.ts +69 -0
- package/src/core/utils/handleRequest.test.ts +573 -0
- package/src/core/utils/handleRequest.ts +117 -0
- package/src/core/utils/internal/Disposable.ts +12 -0
- package/src/core/utils/internal/checkGlobals.ts +17 -0
- package/src/core/utils/internal/devUtils.test.ts +21 -0
- package/src/core/utils/internal/devUtils.ts +44 -0
- package/src/core/utils/internal/getCallFrame.test.ts +154 -0
- package/src/core/utils/internal/getCallFrame.ts +35 -0
- package/src/core/utils/internal/hasRefCounted.test.ts +16 -0
- package/src/core/utils/internal/hasRefCounted.ts +8 -0
- package/src/core/utils/internal/isHandlerKind.test.ts +64 -0
- package/src/core/utils/internal/isHandlerKind.ts +21 -0
- package/src/core/utils/internal/isIterable.test.ts +23 -0
- package/src/core/utils/internal/isIterable.ts +32 -0
- package/src/core/utils/internal/isObject.test.ts +20 -0
- package/src/core/utils/internal/isObject.ts +6 -0
- package/src/core/utils/internal/isStringEqual.test.ts +45 -0
- package/src/core/utils/internal/isStringEqual.ts +6 -0
- package/src/core/utils/internal/jsonParse.test.ts +13 -0
- package/src/core/utils/internal/jsonParse.ts +13 -0
- package/src/core/utils/internal/mergeRight.test.ts +43 -0
- package/src/core/utils/internal/mergeRight.ts +30 -0
- package/src/core/utils/internal/parseGraphQLRequest.test.ts +99 -0
- package/src/core/utils/internal/parseGraphQLRequest.ts +214 -0
- package/src/core/utils/internal/parseMultipartData.test.ts +76 -0
- package/src/core/utils/internal/parseMultipartData.ts +106 -0
- package/src/core/utils/internal/pipeEvents.test.ts +14 -0
- package/src/core/utils/internal/pipeEvents.ts +25 -0
- package/src/core/utils/internal/requestHandlerUtils.ts +21 -0
- package/src/core/utils/internal/toReadonlyArray.test.ts +30 -0
- package/src/core/utils/internal/toReadonlyArray.ts +8 -0
- package/src/core/utils/internal/tryCatch.test.ts +29 -0
- package/src/core/utils/internal/tryCatch.ts +11 -0
- package/src/core/utils/logging/getStatusCodeColor.test.ts +22 -0
- package/src/core/utils/logging/getStatusCodeColor.ts +20 -0
- package/src/core/utils/logging/getTimestamp.test.ts +32 -0
- package/src/core/utils/logging/getTimestamp.ts +17 -0
- package/src/core/utils/logging/serializeRequest.test.ts +23 -0
- package/src/core/utils/logging/serializeRequest.ts +23 -0
- package/src/core/utils/logging/serializeResponse.test.ts +77 -0
- package/src/core/utils/logging/serializeResponse.ts +31 -0
- package/src/core/utils/matching/matchRequestUrl.test.ts +183 -0
- package/src/core/utils/matching/matchRequestUrl.ts +77 -0
- package/src/core/utils/matching/normalizePath.node.test.ts +44 -0
- package/src/core/utils/matching/normalizePath.test.ts +56 -0
- package/src/core/utils/matching/normalizePath.ts +22 -0
- package/src/core/utils/request/getAllAcceptedMimeTypes.test.ts +86 -0
- package/src/core/utils/request/getAllAcceptedMimeTypes.ts +70 -0
- package/src/core/utils/request/getRequestCookies.ts +88 -0
- package/src/core/utils/request/onUnhandledRequest.node.test.ts +62 -0
- package/src/core/utils/request/onUnhandledRequest.test.ts +228 -0
- package/src/core/utils/request/onUnhandledRequest.ts +81 -0
- package/src/core/utils/request/storeResponseCookies.ts +17 -0
- package/src/core/utils/request/toPublicUrl.node.test.ts +17 -0
- package/src/core/utils/request/toPublicUrl.test.ts +16 -0
- package/src/core/utils/request/toPublicUrl.ts +16 -0
- package/src/core/utils/toResponseInit.ts +7 -0
- package/src/core/utils/url/cleanUrl.test.ts +22 -0
- package/src/core/utils/url/cleanUrl.ts +16 -0
- package/src/core/utils/url/getAbsoluteUrl.node.test.ts +19 -0
- package/src/core/utils/url/getAbsoluteUrl.test.ts +47 -0
- package/src/core/utils/url/getAbsoluteUrl.ts +25 -0
- package/src/core/utils/url/isAbsoluteUrl.test.ts +32 -0
- package/src/core/utils/url/isAbsoluteUrl.ts +6 -0
- package/src/core/ws/WebSocketClientManager.test.ts +164 -0
- package/src/core/ws/WebSocketClientManager.ts +241 -0
- package/src/core/ws/WebSocketClientStore.ts +14 -0
- package/src/core/ws/WebSocketIndexedDBClientStore.ts +140 -0
- package/src/core/ws/WebSocketMemoryClientStore.ts +27 -0
- package/src/core/ws/handleWebSocketEvent.ts +64 -0
- package/src/core/ws/utils/attachWebSocketLogger.ts +245 -0
- package/src/core/ws/utils/getMessageLength.test.ts +16 -0
- package/src/core/ws/utils/getMessageLength.ts +20 -0
- package/src/core/ws/utils/getPublicData.test.ts +38 -0
- package/src/core/ws/utils/getPublicData.ts +18 -0
- package/src/core/ws/utils/truncateMessage.test.ts +12 -0
- package/src/core/ws/utils/truncateMessage.ts +9 -0
- package/src/core/ws/webSocketInterceptor.ts +3 -0
- package/src/core/ws.test.ts +23 -0
- package/src/core/ws.ts +161 -0
- package/src/iife/index.ts +2 -0
- package/src/mockServiceWorker.js +349 -0
- package/src/native/index.ts +21 -0
- package/src/node/SetupServerApi.ts +87 -0
- package/src/node/SetupServerCommonApi.ts +169 -0
- package/src/node/glossary.ts +74 -0
- package/src/node/index.ts +3 -0
- package/src/node/setupServer.ts +15 -0
- package/src/package.json +3 -0
- package/src/shims/cookie.ts +7 -0
- package/src/shims/statuses.ts +6 -0
- package/src/tsconfig.core.build.json +6 -0
- package/src/tsconfig.node.build.json +6 -0
- package/src/tsconfig.node.json +8 -0
- package/src/tsconfig.src.json +10 -0
- package/src/tsconfig.worker.json +13 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { invariant } from 'outvariant'
|
|
2
|
+
import { devUtils } from './devUtils'
|
|
3
|
+
|
|
4
|
+
export function checkGlobals() {
|
|
5
|
+
/**
|
|
6
|
+
* MSW expects the "URL" constructor to be defined.
|
|
7
|
+
* It's not present in React Native so suggest a polyfill
|
|
8
|
+
* instead of failing silently.
|
|
9
|
+
* @see https://github.com/mswjs/msw/issues/1408
|
|
10
|
+
*/
|
|
11
|
+
invariant(
|
|
12
|
+
typeof URL !== 'undefined',
|
|
13
|
+
devUtils.formatMessage(
|
|
14
|
+
`Global "URL" class is not defined. This likely means that you're running MSW in an environment that doesn't support all Node.js standard API (e.g. React Native). If that's the case, please use an appropriate polyfill for the "URL" class, like "react-native-url-polyfill".`,
|
|
15
|
+
),
|
|
16
|
+
)
|
|
17
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { InternalError } from './devUtils'
|
|
2
|
+
|
|
3
|
+
describe(InternalError, () => {
|
|
4
|
+
it('creates an InternalError instance', () => {
|
|
5
|
+
const error = new InternalError('Message')
|
|
6
|
+
|
|
7
|
+
expect(error.name).toBe('InternalError')
|
|
8
|
+
expect(error.message).toBe('Message')
|
|
9
|
+
expect(error.toString()).toBe('InternalError: Message')
|
|
10
|
+
expect(error.stack).toMatch(/\w+/)
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
it('passes the identity check', () => {
|
|
14
|
+
const error = new InternalError('Message')
|
|
15
|
+
expect(error instanceof InternalError).toBe(true)
|
|
16
|
+
expect(error instanceof Error).toBe(true)
|
|
17
|
+
|
|
18
|
+
const extraneousError = new Error('Message')
|
|
19
|
+
expect(extraneousError).not.toBeInstanceOf(InternalError)
|
|
20
|
+
})
|
|
21
|
+
})
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { format } from 'outvariant'
|
|
2
|
+
|
|
3
|
+
const LIBRARY_PREFIX = '[MSW]'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Formats a given message by appending the library's prefix string.
|
|
7
|
+
*/
|
|
8
|
+
function formatMessage(message: string, ...positionals: any[]): string {
|
|
9
|
+
const interpolatedMessage = format(message, ...positionals)
|
|
10
|
+
return `${LIBRARY_PREFIX} ${interpolatedMessage}`
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Prints a library-specific warning.
|
|
15
|
+
*/
|
|
16
|
+
function warn(message: string, ...positionals: any[]): void {
|
|
17
|
+
console.warn(formatMessage(message, ...positionals))
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Prints a library-specific error.
|
|
22
|
+
*/
|
|
23
|
+
function error(message: string, ...positionals: any[]): void {
|
|
24
|
+
console.error(formatMessage(message, ...positionals))
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const devUtils = {
|
|
28
|
+
formatMessage,
|
|
29
|
+
warn,
|
|
30
|
+
error,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Internal error instance.
|
|
35
|
+
* Used to differentiate the library errors that must be forwarded
|
|
36
|
+
* to the user from the unhandled exceptions. Use this if you don't
|
|
37
|
+
* wish for the error to be coerced to a 500 fallback response.
|
|
38
|
+
*/
|
|
39
|
+
export class InternalError extends Error {
|
|
40
|
+
constructor(message: string) {
|
|
41
|
+
super(message)
|
|
42
|
+
this.name = 'InternalError'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @vitest-environment jsdom
|
|
3
|
+
*/
|
|
4
|
+
import { getCallFrame } from './getCallFrame'
|
|
5
|
+
|
|
6
|
+
class ErrorWithStack extends Error {
|
|
7
|
+
constructor(stack: string[] | undefined | null) {
|
|
8
|
+
super('')
|
|
9
|
+
this.stack = stack?.join('\n')
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
test('supports Node.js (Linux, MacOS) error stack', () => {
|
|
14
|
+
const linuxError = new ErrorWithStack([
|
|
15
|
+
'Error: ',
|
|
16
|
+
' at getCallFrame (/Users/mock/github/msw/lib/node/index.js:3735:22)',
|
|
17
|
+
' at Object.get (/Users/mock/github/msw/lib/node/index.js:3776:29)',
|
|
18
|
+
' at Object.<anonymous> (/Users/mock/github/msw/test/msw-api/setup-server/listHandlers.test.ts:13:8)', // <-- this one
|
|
19
|
+
' at Runtime._execModule (/Users/mock/github/msw/node_modules/jest-runtime/build/index.js:1299:24)',
|
|
20
|
+
' at Runtime._loadModule (/Users/mock/github/msw/node_modules/jest-runtime/build/index.js:898:12)',
|
|
21
|
+
' at Runtime.requireModule (/Users/mock/github/msw/node_modules/jest-runtime/build/index.js:746:10)',
|
|
22
|
+
' at jasmine2 (/Users/mock/github/msw/node_modules/jest-jasmine2/build/index.js:230:13)',
|
|
23
|
+
' at runTestInternal (/Users/mock/github/msw/node_modules/jest-runner/build/runTest.js:380:22)',
|
|
24
|
+
' at runTest (/Users/mock/github/msw/node_modules/jest-runner/build/runTest.js:472:34)',
|
|
25
|
+
])
|
|
26
|
+
expect(getCallFrame(linuxError)).toEqual(
|
|
27
|
+
'/Users/mock/github/msw/test/msw-api/setup-server/listHandlers.test.ts:13:8',
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
const macOsError = new ErrorWithStack([
|
|
31
|
+
'Error: ',
|
|
32
|
+
' at getCallFrame (/Users/mock/git/msw/lib/node/index.js:3735:22)',
|
|
33
|
+
' at graphQLRequestHandler (/Users/mock/git/msw/lib/node/index.js:7071:25)',
|
|
34
|
+
' at Object.query (/Users/mock/git/msw/lib/node/index.js:7182:18)',
|
|
35
|
+
' at Object.<anonymous> (/Users/mock/git/msw/test/msw-api/setup-server/listHandlers.test.ts:14:11)', // <-- this one
|
|
36
|
+
' at Runtime._execModule (/Users/mock/git/msw/node_modules/jest-runtime/build/index.js:1299:24)',
|
|
37
|
+
' at Runtime._loadModule (/Users/mock/git/msw/node_modules/jest-runtime/build/index.js:898:12)',
|
|
38
|
+
' at Runtime.requireModule (/Users/mock/git/msw/node_modules/jest-runtime/build/index.js:746:10)',
|
|
39
|
+
' at jasmine2 (/Users/mock/git/msw/node_modules/jest-jasmine2/build/index.js:230:13)',
|
|
40
|
+
' at runTestInternal (/Users/mock/git/msw/node_modules/jest-runner/build/runTest.js:380:22)',
|
|
41
|
+
' at runTest (/Users/mock/git/msw/node_modules/jest-runner/build/runTest.js:472:34)',
|
|
42
|
+
])
|
|
43
|
+
|
|
44
|
+
expect(getCallFrame(macOsError)).toEqual(
|
|
45
|
+
'/Users/mock/git/msw/test/msw-api/setup-server/listHandlers.test.ts:14:11',
|
|
46
|
+
)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
test('supports Node.js (Windows) error stack', () => {
|
|
50
|
+
const error = new ErrorWithStack([
|
|
51
|
+
'Error: ',
|
|
52
|
+
' at getCallFrame (C:\\Users\\mock\\git\\msw\\lib\\node\\index.js:3735:22)',
|
|
53
|
+
' at graphQLRequestHandler (C:\\Users\\mock\\git\\msw\\lib\\node\\index.js:7071:25)',
|
|
54
|
+
' at Object.query (C:\\Users\\mock\\git\\msw\\lib\\node\\index.js:7182:18)',
|
|
55
|
+
' at Object.<anonymous> (C:\\Users\\mock\\git\\msw\\test\\msw-api\\setup-server\\listHandlers.test.ts:75:13)', // <-- this one
|
|
56
|
+
' at Object.asyncJestTest (C:\\Users\\mock\\git\\msw\\node_modules\\jest-jasmine2\\build\\jasmineAsyncInstall.js:106:37)',
|
|
57
|
+
' at C:\\Users\\mock\\git\\msw\\node_modules\\jest-jasmine2\\build\\queueRunner.js:45:12',
|
|
58
|
+
' at new Promise (<anonymous>)',
|
|
59
|
+
' at mapper (C:\\Users\\mock\\git\\msw\\node_modules\\jest-jasmine2\\build\\queueRunner.js:28:19)',
|
|
60
|
+
' at C:\\Users\\mock\\git\\msw\\node_modules\\jest-jasmine2\\build\\queueRunner.js:75:41',
|
|
61
|
+
])
|
|
62
|
+
|
|
63
|
+
expect(getCallFrame(error)).toBe(
|
|
64
|
+
'C:\\Users\\mock\\git\\msw\\test\\msw-api\\setup-server\\listHandlers.test.ts:75:13',
|
|
65
|
+
)
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
test('supports Chrome and Edge error stack', () => {
|
|
69
|
+
const error = new ErrorWithStack([
|
|
70
|
+
'Error',
|
|
71
|
+
' at getCallFrame (webpack:///./lib/browser/getCallFrame-deps.js?:272:20)',
|
|
72
|
+
' at Object.eval [as get] (webpack:///./lib/browser/rest-deps.js?:1402:90)',
|
|
73
|
+
' at eval (webpack:///./test/msw-api/setup-worker/listHandlers.mocks.ts?:6:113)', // <-- this one
|
|
74
|
+
' at Module../test/msw-api/setup-worker/listHandlers.mocks.ts (http://localhost:59464/main.js:1376:1)',
|
|
75
|
+
' at __webpack_require__ (http://localhost:59464/main.js:790:30)',
|
|
76
|
+
' at fn (http://localhost:59464/main.js:101:20)',
|
|
77
|
+
' at eval (webpack:///multi_(webpack)-dev-server/client?:4:18)',
|
|
78
|
+
' at Object.0 (http://localhost:59464/main.js:1399:1)',
|
|
79
|
+
' at __webpack_require__ (http://localhost:59464/main.js:790:30)',
|
|
80
|
+
' at http://localhost:59464/main.js:857:37',
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
expect(getCallFrame(error)).toBe(
|
|
84
|
+
'webpack:///./test/msw-api/setup-worker/listHandlers.mocks.ts?:6:113',
|
|
85
|
+
)
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
test('supports Firefox (MacOS, Windows) error stack', () => {
|
|
89
|
+
const error = new ErrorWithStack([
|
|
90
|
+
'getCallFrame@webpack:///./lib/browser/getCallFrame-deps.js?:272:20',
|
|
91
|
+
'createRestHandler/<@webpack:///./lib/browser/rest-deps.js?:1402:90',
|
|
92
|
+
'@webpack:///./test/msw-api/setup-worker/listHandlers.mocks.ts?:6:113', // <-- this one
|
|
93
|
+
'./test/msw-api/setup-worker/listHandlers.mocks.ts@http://localhost:59464/main.js:1376:1',
|
|
94
|
+
'__webpack_require__@http://localhost:59464/main.js:790:30',
|
|
95
|
+
'fn@http://localhost:59464/main.js:101:20',
|
|
96
|
+
'@webpack:///multi_(webpack)-dev-server/client?:4:18',
|
|
97
|
+
'0@http://localhost:59464/main.js:1399:1',
|
|
98
|
+
'__webpack_require__@http://localhost:59464/main.js:790:30',
|
|
99
|
+
'@http://localhost:59464/main.js:857:37',
|
|
100
|
+
])
|
|
101
|
+
|
|
102
|
+
expect(getCallFrame(error)).toBe(
|
|
103
|
+
'webpack:///./test/msw-api/setup-worker/listHandlers.mocks.ts?:6:113',
|
|
104
|
+
)
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
test('supports Safari (MacOS) error stack', () => {
|
|
108
|
+
const errorOne = new ErrorWithStack([
|
|
109
|
+
'getCallFrame',
|
|
110
|
+
'',
|
|
111
|
+
'eval code',
|
|
112
|
+
'eval@[native code]',
|
|
113
|
+
'./test/msw-api/setup-worker/listHandlers.mocks.ts@http://localhost:59464/main.js:1376:5', // <-- this one
|
|
114
|
+
'__webpack_require__@http://localhost:59464/main.js:790:34',
|
|
115
|
+
'fn@http://localhost:59464/main.js:101:39',
|
|
116
|
+
'eval code',
|
|
117
|
+
'eval@[native code]',
|
|
118
|
+
'http://localhost:59464/main.js:1399:5',
|
|
119
|
+
'__webpack_require__@http://localhost:59464/main.js:790:34',
|
|
120
|
+
'http://localhost:59464/main.js:857:37',
|
|
121
|
+
'global code@http://localhost:59464/main.js:858:12',
|
|
122
|
+
])
|
|
123
|
+
|
|
124
|
+
expect(getCallFrame(errorOne)).toBe(
|
|
125
|
+
'./test/msw-api/setup-worker/listHandlers.mocks.ts@http://localhost:59464/main.js:1376:5',
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
const errorTwo = new ErrorWithStack([
|
|
129
|
+
'getCallFrame',
|
|
130
|
+
'graphQLRequestHandler',
|
|
131
|
+
'eval code',
|
|
132
|
+
'eval@[native code]',
|
|
133
|
+
'./test/msw-api/setup-worker/listHandlers.mocks.ts@http://localhost:56460/main.js:1376:5', // <-- this one
|
|
134
|
+
'__webpack_require__@http://localhost:56460/main.js:790:34',
|
|
135
|
+
'fn@http://localhost:56460/main.js:101:39',
|
|
136
|
+
'eval code',
|
|
137
|
+
'eval@[native code]',
|
|
138
|
+
'http://localhost:56460/main.js:1399:5',
|
|
139
|
+
'__webpack_require__@http://localhost:56460/main.js:790:34',
|
|
140
|
+
'http://localhost:56460/main.js:857:37',
|
|
141
|
+
'global code@http://localhost:56460/main.js:858:12',
|
|
142
|
+
])
|
|
143
|
+
|
|
144
|
+
expect(getCallFrame(errorTwo)).toBe(
|
|
145
|
+
'./test/msw-api/setup-worker/listHandlers.mocks.ts@http://localhost:56460/main.js:1376:5',
|
|
146
|
+
)
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
test('handles the undefined stack trace', () => {
|
|
150
|
+
expect(() => getCallFrame(new ErrorWithStack(undefined))).not.toThrow(
|
|
151
|
+
TypeError,
|
|
152
|
+
)
|
|
153
|
+
expect(() => getCallFrame(new ErrorWithStack(null))).not.toThrow(TypeError)
|
|
154
|
+
})
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Ignore the source files traces for local testing.
|
|
2
|
+
const SOURCE_FRAME = /[/\\]msw[/\\]src[/\\](.+)/
|
|
3
|
+
|
|
4
|
+
const BUILD_FRAME =
|
|
5
|
+
/(node_modules)?[/\\]lib[/\\](core|browser|node|native|iife)[/\\]|^[^/\\]*$/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Return the stack trace frame of a function's invocation.
|
|
9
|
+
*/
|
|
10
|
+
export function getCallFrame(error: Error) {
|
|
11
|
+
// In <IE11, new Error may return an undefined stack
|
|
12
|
+
const stack = error.stack
|
|
13
|
+
|
|
14
|
+
if (!stack) {
|
|
15
|
+
return
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const frames: string[] = stack.split('\n').slice(1)
|
|
19
|
+
|
|
20
|
+
// Get the first frame that doesn't reference the library's internal trace.
|
|
21
|
+
// Assume that frame is the invocation frame.
|
|
22
|
+
const declarationFrame = frames.find((frame) => {
|
|
23
|
+
return !(SOURCE_FRAME.test(frame) || BUILD_FRAME.test(frame))
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
if (!declarationFrame) {
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Extract file reference from the stack frame.
|
|
31
|
+
const declarationPath = declarationFrame
|
|
32
|
+
.replace(/\s*at [^()]*\(([^)]+)\)/, '$1')
|
|
33
|
+
.replace(/^@/, '')
|
|
34
|
+
return declarationPath
|
|
35
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { hasRefCounted } from './hasRefCounted'
|
|
2
|
+
|
|
3
|
+
it('returns true for objects with ref and unref methods', () => {
|
|
4
|
+
expect(
|
|
5
|
+
hasRefCounted({
|
|
6
|
+
ref() {},
|
|
7
|
+
unref() {},
|
|
8
|
+
}),
|
|
9
|
+
).toBe(true)
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
it('returns false for a non-refcounted object', () => {
|
|
13
|
+
expect(hasRefCounted({})).toBe(false)
|
|
14
|
+
expect(hasRefCounted({ ref() {} })).toBe(false)
|
|
15
|
+
expect(hasRefCounted({ unref() {} })).toBe(false)
|
|
16
|
+
})
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { GraphQLHandler } from '../../handlers/GraphQLHandler'
|
|
2
|
+
import { HttpHandler } from '../../handlers/HttpHandler'
|
|
3
|
+
import { RequestHandler } from '../../handlers/RequestHandler'
|
|
4
|
+
import { WebSocketHandler } from '../../handlers/WebSocketHandler'
|
|
5
|
+
import { isHandlerKind } from './isHandlerKind'
|
|
6
|
+
|
|
7
|
+
it('returns true if expected a request handler and given a request handler', () => {
|
|
8
|
+
expect(
|
|
9
|
+
isHandlerKind('RequestHandler')(new HttpHandler('*', '*', () => {})),
|
|
10
|
+
).toBe(true)
|
|
11
|
+
|
|
12
|
+
expect(
|
|
13
|
+
isHandlerKind('RequestHandler')(
|
|
14
|
+
new GraphQLHandler('all', '*', '*', () => {}),
|
|
15
|
+
),
|
|
16
|
+
).toBe(true)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('returns true if expected a request handler and given a custom request handler', () => {
|
|
20
|
+
class MyHandler extends RequestHandler {
|
|
21
|
+
constructor() {
|
|
22
|
+
super({ info: { header: '*' }, resolver: () => {} })
|
|
23
|
+
}
|
|
24
|
+
predicate = () => false
|
|
25
|
+
log() {}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
expect(isHandlerKind('RequestHandler')(new MyHandler())).toBe(true)
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('returns false if expected a request handler but given event handler', () => {
|
|
32
|
+
expect(isHandlerKind('RequestHandler')(new WebSocketHandler('*'))).toBe(false)
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('returns false if expected a request handler but given arbitrary object', () => {
|
|
36
|
+
expect(isHandlerKind('RequestHandler')(undefined)).toBe(false)
|
|
37
|
+
expect(isHandlerKind('RequestHandler')(null)).toBe(false)
|
|
38
|
+
expect(isHandlerKind('RequestHandler')({})).toBe(false)
|
|
39
|
+
expect(isHandlerKind('RequestHandler')([])).toBe(false)
|
|
40
|
+
expect(isHandlerKind('RequestHandler')(123)).toBe(false)
|
|
41
|
+
expect(isHandlerKind('RequestHandler')('hello')).toBe(false)
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('returns true if expected an event handler and given an event handler', () => {
|
|
45
|
+
expect(isHandlerKind('EventHandler')(new WebSocketHandler('*'))).toBe(true)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('returns true if expected an event handler and given a custom event handler', () => {
|
|
49
|
+
class MyEventHandler extends WebSocketHandler {
|
|
50
|
+
constructor() {
|
|
51
|
+
super('*')
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
expect(isHandlerKind('EventHandler')(new MyEventHandler())).toBe(true)
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
it('returns false if expected an event handler but given arbitrary object', () => {
|
|
58
|
+
expect(isHandlerKind('EventHandler')(undefined)).toBe(false)
|
|
59
|
+
expect(isHandlerKind('EventHandler')(null)).toBe(false)
|
|
60
|
+
expect(isHandlerKind('EventHandler')({})).toBe(false)
|
|
61
|
+
expect(isHandlerKind('EventHandler')([])).toBe(false)
|
|
62
|
+
expect(isHandlerKind('EventHandler')(123)).toBe(false)
|
|
63
|
+
expect(isHandlerKind('EventHandler')('hello')).toBe(false)
|
|
64
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { HandlerKind } from '../../handlers/common'
|
|
2
|
+
import type { RequestHandler } from '../../handlers/RequestHandler'
|
|
3
|
+
import type { WebSocketHandler } from '../../handlers/WebSocketHandler'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A filter function that ensures that the provided argument
|
|
7
|
+
* is a handler of the given kind. This helps differentiate
|
|
8
|
+
* between different kinds of handlers, e.g. request and event handlers.
|
|
9
|
+
*/
|
|
10
|
+
export function isHandlerKind<K extends HandlerKind>(kind: K) {
|
|
11
|
+
return (
|
|
12
|
+
input: unknown,
|
|
13
|
+
): input is K extends 'EventHandler' ? WebSocketHandler : RequestHandler => {
|
|
14
|
+
return (
|
|
15
|
+
input != null &&
|
|
16
|
+
typeof input === 'object' &&
|
|
17
|
+
'__kind' in input &&
|
|
18
|
+
input.__kind === kind
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { isIterable } from './isIterable'
|
|
2
|
+
|
|
3
|
+
test('returns true given an iterator', () => {
|
|
4
|
+
expect(
|
|
5
|
+
isIterable(
|
|
6
|
+
(function* () {
|
|
7
|
+
yield 2
|
|
8
|
+
})(),
|
|
9
|
+
),
|
|
10
|
+
).toEqual(true)
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
test('returns false given a regular function', () => {
|
|
14
|
+
expect(
|
|
15
|
+
isIterable(
|
|
16
|
+
(function () {
|
|
17
|
+
return null
|
|
18
|
+
})(),
|
|
19
|
+
),
|
|
20
|
+
).toEqual(false)
|
|
21
|
+
|
|
22
|
+
expect(isIterable((() => null)())).toEqual(false)
|
|
23
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the same as TypeScript's `Iterable`, but with all three type parameters.
|
|
3
|
+
* @todo Remove once TypeScript 5.6 is the minimum.
|
|
4
|
+
*/
|
|
5
|
+
export interface Iterable<T, TReturn, TNext> {
|
|
6
|
+
[Symbol.iterator](): Iterator<T, TReturn, TNext>
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* This is the same as TypeScript's `AsyncIterable`, but with all three type parameters.
|
|
11
|
+
* @todo Remove once TypeScript 5.6 is the minimum.
|
|
12
|
+
*/
|
|
13
|
+
export interface AsyncIterable<T, TReturn, TNext> {
|
|
14
|
+
[Symbol.asyncIterator](): AsyncIterator<T, TReturn, TNext>
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Determines if the given function is an iterator.
|
|
19
|
+
*/
|
|
20
|
+
export function isIterable<IteratorType>(
|
|
21
|
+
fn: any,
|
|
22
|
+
): fn is
|
|
23
|
+
| Iterable<IteratorType, IteratorType, IteratorType>
|
|
24
|
+
| AsyncIterable<IteratorType, IteratorType, IteratorType> {
|
|
25
|
+
if (!fn) {
|
|
26
|
+
return false
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
Reflect.has(fn, Symbol.iterator) || Reflect.has(fn, Symbol.asyncIterator)
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { isObject } from './isObject'
|
|
2
|
+
|
|
3
|
+
test('returns true given an object', () => {
|
|
4
|
+
expect(isObject({})).toBe(true)
|
|
5
|
+
expect(isObject({ a: 1 })).toBe(true)
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
test('returns false given a non-object value', () => {
|
|
9
|
+
expect(isObject(1)).toBe(false)
|
|
10
|
+
expect(isObject('string')).toBe(false)
|
|
11
|
+
expect(isObject([])).toBe(false)
|
|
12
|
+
expect(
|
|
13
|
+
isObject(function () {
|
|
14
|
+
return 2
|
|
15
|
+
}),
|
|
16
|
+
).toBe(false)
|
|
17
|
+
expect(isObject(false)).toBe(false)
|
|
18
|
+
expect(isObject(undefined)).toBe(false)
|
|
19
|
+
expect(isObject(null)).toBe(false)
|
|
20
|
+
})
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { isStringEqual } from './isStringEqual'
|
|
2
|
+
|
|
3
|
+
describe('isStringEqual', () => {
|
|
4
|
+
describe('given two uppercase strings', () => {
|
|
5
|
+
describe('and the strings are equal', () => {
|
|
6
|
+
it('should return true', () => {
|
|
7
|
+
expect(isStringEqual('GET', 'GET')).toBe(true)
|
|
8
|
+
})
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
describe('and the strings are not equal', () => {
|
|
12
|
+
it('should return false', () => {
|
|
13
|
+
expect(isStringEqual('GET', 'POST')).toBe(false)
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
describe('given two lowercase strings', () => {
|
|
19
|
+
describe('and the strings are equal', () => {
|
|
20
|
+
it('should return true', () => {
|
|
21
|
+
expect(isStringEqual('get', 'get')).toBe(true)
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
describe('and the strings are not equal', () => {
|
|
26
|
+
it('should return false', () => {
|
|
27
|
+
expect(isStringEqual('get', 'post')).toBe(false)
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
describe('given two strings cased differently', () => {
|
|
33
|
+
describe('and the strings are equal', () => {
|
|
34
|
+
it('should return true', () => {
|
|
35
|
+
expect(isStringEqual('get', 'GET')).toBe(true)
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
describe('and the strings are not equal', () => {
|
|
40
|
+
it('should return false', () => {
|
|
41
|
+
expect(isStringEqual('get', 'POST')).toBe(false)
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsonParse } from './jsonParse'
|
|
2
|
+
|
|
3
|
+
test('parses a given valid JSON string', () => {
|
|
4
|
+
expect(jsonParse(`{"property":"value"}`)).toEqual({
|
|
5
|
+
property: 'value',
|
|
6
|
+
})
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
test('returns undefined without an error given an invalid JSON string', () => {
|
|
10
|
+
const parse = () => jsonParse(`{"property:val"ue$}`)
|
|
11
|
+
expect(parse).not.toThrow()
|
|
12
|
+
expect(parse()).toBeUndefined()
|
|
13
|
+
})
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses a given value into a JSON.
|
|
3
|
+
* Does not throw an exception on an invalid JSON string.
|
|
4
|
+
*/
|
|
5
|
+
export function jsonParse<ValueType extends Record<string, any>>(
|
|
6
|
+
value: any,
|
|
7
|
+
): ValueType | undefined {
|
|
8
|
+
try {
|
|
9
|
+
return JSON.parse(value)
|
|
10
|
+
} catch {
|
|
11
|
+
return undefined
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { mergeRight } from './mergeRight'
|
|
2
|
+
|
|
3
|
+
test('shallowly merges two given objects', () => {
|
|
4
|
+
expect(mergeRight({ a: 1, b: 2 }, { b: 3, c: 4 })).toEqual({
|
|
5
|
+
a: 1,
|
|
6
|
+
b: 3,
|
|
7
|
+
c: 4,
|
|
8
|
+
})
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
test('deeply merges two given objects', () => {
|
|
12
|
+
expect(
|
|
13
|
+
mergeRight(
|
|
14
|
+
{
|
|
15
|
+
a: 'string',
|
|
16
|
+
b: [1, 2],
|
|
17
|
+
c: {
|
|
18
|
+
d: 2,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
a: 'another-string',
|
|
23
|
+
b: [3],
|
|
24
|
+
c: {
|
|
25
|
+
e: 'five',
|
|
26
|
+
f: {
|
|
27
|
+
g: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
),
|
|
32
|
+
).toEqual({
|
|
33
|
+
a: 'another-string',
|
|
34
|
+
b: [1, 2, 3],
|
|
35
|
+
c: {
|
|
36
|
+
d: 2,
|
|
37
|
+
e: 'five',
|
|
38
|
+
f: {
|
|
39
|
+
g: true,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
})
|
|
43
|
+
})
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { isObject } from './isObject'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Deeply merges two given objects with the right one
|
|
5
|
+
* having a priority during property assignment.
|
|
6
|
+
*/
|
|
7
|
+
export function mergeRight(
|
|
8
|
+
left: Record<string, any>,
|
|
9
|
+
right: Record<string, any>,
|
|
10
|
+
) {
|
|
11
|
+
return Object.entries(right).reduce(
|
|
12
|
+
(result, [key, rightValue]) => {
|
|
13
|
+
const leftValue = result[key]
|
|
14
|
+
|
|
15
|
+
if (Array.isArray(leftValue) && Array.isArray(rightValue)) {
|
|
16
|
+
result[key] = leftValue.concat(rightValue)
|
|
17
|
+
return result
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (isObject(leftValue) && isObject(rightValue)) {
|
|
21
|
+
result[key] = mergeRight(leftValue, rightValue)
|
|
22
|
+
return result
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
result[key] = rightValue
|
|
26
|
+
return result
|
|
27
|
+
},
|
|
28
|
+
Object.assign({}, left),
|
|
29
|
+
)
|
|
30
|
+
}
|