Sha256: 725e5b906a14114c700cd4295a19a9b5d9966800e9119c319fd7d63b928aea01

Contents?: true

Size: 1.04 KB

Versions: 26

Compression:

Stored size: 1.04 KB

Contents

{"version":3,"sources":["../../../../src/core/utils/matching/normalizePath.ts"],"sourcesContent":["import type { Path } from './matchRequestUrl'\nimport { cleanUrl } from '../url/cleanUrl'\nimport { getAbsoluteUrl } from '../url/getAbsoluteUrl'\n\n/**\n * Normalizes a given request handler path:\n * - Preserves RegExp.\n * - Removes query parameters and hashes.\n * - Rebases relative URLs against the \"baseUrl\" or the current location.\n * - Preserves relative URLs in Node.js, unless specified otherwise.\n * - Preserves optional path parameters.\n */\nexport function normalizePath(path: Path, baseUrl?: string): Path {\n  // RegExp paths do not need normalization.\n  if (path instanceof RegExp) {\n    return path\n  }\n\n  const maybeAbsoluteUrl = getAbsoluteUrl(path, baseUrl)\n\n  return cleanUrl(maybeAbsoluteUrl)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAyB;AACzB,4BAA+B;AAUxB,SAAS,cAAc,MAAY,SAAwB;AAEhE,MAAI,gBAAgB,QAAQ;AAC1B,WAAO;AAAA,EACT;AAEA,QAAM,uBAAmB,sCAAe,MAAM,OAAO;AAErD,aAAO,0BAAS,gBAAgB;AAClC;","names":[]}

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.25 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.24 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.23 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.22 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.21 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.20 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.19 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.18 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.17 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.16 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.15 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.14 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.13 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.12 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.11 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.10 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.9 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.8 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map
clapton-0.0.7 lib/clapton/javascripts/node_modules/msw/lib/core/utils/matching/normalizePath.js.map