@birdseye/snapshot
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -66,3 +66,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var opts, browser, page, rawRoutes, routes; | ||
var opts, browser, page, routes; | ||
return __generator(this, function (_a) { | ||
@@ -87,4 +87,3 @@ switch (_a.label) { | ||
case 4: | ||
rawRoutes = _a.sent(); | ||
routes = rawRoutes.filter(function (route) { var _a; return !((_a = route.snapshot) === null || _a === void 0 ? void 0 : _a.skip); }); | ||
routes = _a.sent(); | ||
return [4 /*yield*/, browser.close()]; | ||
@@ -91,0 +90,0 @@ case 5: |
@@ -51,3 +51,3 @@ "use strict"; | ||
]; | ||
function exposePageContext(page) { | ||
function exposePageContext(page, routeIndex) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -58,3 +58,3 @@ var _this = this; | ||
case 0: return [4 /*yield*/, Promise.all(pageContextKeys.map(function (key) { | ||
return page.exposeFunction(exposedKeyPrefix + key, function (selector) { | ||
return page.exposeFunction(exposedKeyPrefix + key + routeIndex, function (selector) { | ||
var args = []; | ||
@@ -91,6 +91,11 @@ for (var _i = 1; _i < arguments.length; _i++) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, exposePageContext(page)]; | ||
case 0: | ||
// Exposed function must be unique as the one exposed by another catalog can remain | ||
// because there is no page transition between catalog as they are hashed routes. | ||
return [4 /*yield*/, exposePageContext(page, routeIndex)]; | ||
case 1: | ||
// Exposed function must be unique as the one exposed by another catalog can remain | ||
// because there is no page transition between catalog as they are hashed routes. | ||
_a.sent(); | ||
return [4 /*yield*/, page.exposeFunction(exposedCaptureKey, capture)]; | ||
return [4 /*yield*/, page.exposeFunction(exposedCaptureKey + routeIndex, capture)]; | ||
case 2: | ||
@@ -107,6 +112,6 @@ _a.sent(); | ||
Object.defineProperty(pageContext, key, { | ||
get: function () { return window[exposedKeyPrefix + key]; }, | ||
get: function () { return window[exposedKeyPrefix + key + routeIndex]; }, | ||
}); | ||
}); | ||
var captureInPage = window[exposedCaptureKey]; | ||
var captureInPage = window[exposedCaptureKey + routeIndex]; | ||
return captureOption(pageContext, captureInPage); | ||
@@ -113,0 +118,0 @@ }, routeIndex, exposedKeyPrefix, exposedCaptureKey, pageContextKeys)]; |
@@ -7,3 +7,8 @@ "use strict"; | ||
var meta = catalog.toDeclaration().meta; | ||
return acc.concat(meta.patterns.map(function (pattern) { | ||
return acc.concat(meta.patterns | ||
.filter(function (pattern) { | ||
var _a; | ||
return !((_a = pattern.plugins.snapshot) === null || _a === void 0 ? void 0 : _a.skip); | ||
}) | ||
.map(function (pattern) { | ||
return { | ||
@@ -10,0 +15,0 @@ path: "/" + encodeURIComponent(meta.name) + "/" + encodeURIComponent(pattern.name), |
{ | ||
"name": "@birdseye/snapshot", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"author": "katashin", | ||
@@ -80,3 +80,3 @@ "description": "Taking snapshots for Birdseye catalog", | ||
}, | ||
"gitHead": "7438f34dab8e694189b5de704ff1e2b2c42ae8f7" | ||
"gitHead": "5aa7b694fd494377e85ffa0892e96c5e6c74bcaf" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24432
314