Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

playwright-msw

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

playwright-msw - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

CHANGELOG.md

4

lib/index.d.ts

@@ -1,2 +0,2 @@

export * from './fixture';
export { MockServiceWorker } from './worker';
export { createWorkerFixture } from './fixture';
export { MockServiceWorker, createWorker } from './worker';
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./fixture"), exports);
exports.createWorker = exports.createWorkerFixture = void 0;
var fixture_1 = require("./fixture");
Object.defineProperty(exports, "createWorkerFixture", { enumerable: true, get: function () { return fixture_1.createWorkerFixture; } });
var worker_1 = require("./worker");
Object.defineProperty(exports, "createWorker", { enumerable: true, get: function () { return worker_1.createWorker; } });

@@ -9,2 +9,2 @@ import { Path, RequestHandler } from 'msw';

export declare const getHandlerPath: (handler: RequestHandler, config: Config) => Path;
export declare const convertMswPathToPlaywrightUrl: (path: Path) => string | RegExp;
export declare const convertMswPathToPlaywrightUrl: (path: Path) => RegExp;

@@ -32,7 +32,14 @@ "use strict";

}
const transformedPath = path.replace(/\/:[^/]+/g, '/*').replace(/\?.+/, '');
return transformedPath.endsWith('*')
? transformedPath
: `${transformedPath}*`;
const originRegex = /(\w+:\/\/[^/]+)/u;
return new RegExp([
'^',
originRegex.test(path) ? '' : `${originRegex.source}?`,
path
.replace(/\?.*$/, '')
.replace(/:[^/]+(\/|\?)?/g, '[^/]+$1'),
'\\/?',
'(\\?.*)?',
'$',
].join(''));
};
exports.convertMswPathToPlaywrightUrl = convertMswPathToPlaywrightUrl;
{
"name": "playwright-msw",
"version": "2.0.1",
"version": "2.0.2",
"description": "A Mock Service Worker API for Playwright.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc