@percy/core
Advanced tools
Comparing version 1.30.3-beta.0 to 1.30.3-beta.1
@@ -183,3 +183,3 @@ import fs from 'fs'; | ||
}) | ||
// Recieves events from sdk's. | ||
// Receives events from sdk's. | ||
.route('post', '/percy/events', async (req, res) => { | ||
@@ -186,0 +186,0 @@ var _percy$build2; |
@@ -6,3 +6,3 @@ import logger from '@percy/logger'; | ||
import Queue from './queue.js'; | ||
import { request, hostnameMatches, yieldTo, snapshotLogName, decodeAndEncodeURLWithLogging } from './utils.js'; | ||
import { request, hostnameMatches, yieldTo, snapshotLogName, decodeAndEncodeURLWithLogging, compareObjectTypes } from './utils.js'; | ||
import { JobData } from './wait-for-job.js'; | ||
@@ -424,4 +424,7 @@ | ||
name, | ||
testCase | ||
}, snapshot) => snapshot.testCase === testCase && snapshot.name === name) | ||
testCase, | ||
tag | ||
}, snapshot) => { | ||
return snapshot.testCase === testCase && snapshot.name === name && compareObjectTypes(tag, snapshot.tag); | ||
}) | ||
// when pushed, maybe flush old snapshots or possibly merge with existing snapshots | ||
@@ -428,0 +431,0 @@ .handle('push', (snapshot, existing) => { |
@@ -518,2 +518,13 @@ import EventEmitter from 'events'; | ||
} | ||
; | ||
; | ||
export function compareObjectTypes(obj1, obj2) { | ||
if (obj1 === obj2) return true; // Handles primitives | ||
if (typeof obj1 !== 'object' || typeof obj2 !== 'object' || obj1 === null || obj2 === null) return false; | ||
const keys1 = Object.keys(obj1); | ||
const keys2 = Object.keys(obj2); | ||
if (keys1.length !== keys2.length) return false; | ||
for (const key of keys1) { | ||
if (!keys2.includes(key) || !compareObjectTypes(obj1[key], obj2[key])) return false; | ||
} | ||
return true; | ||
} |
{ | ||
"name": "@percy/core", | ||
"version": "1.30.3-beta.0", | ||
"version": "1.30.3-beta.1", | ||
"license": "MIT", | ||
@@ -46,7 +46,7 @@ "repository": { | ||
"dependencies": { | ||
"@percy/client": "1.30.3-beta.0", | ||
"@percy/config": "1.30.3-beta.0", | ||
"@percy/dom": "1.30.3-beta.0", | ||
"@percy/logger": "1.30.3-beta.0", | ||
"@percy/webdriver-utils": "1.30.3-beta.0", | ||
"@percy/client": "1.30.3-beta.1", | ||
"@percy/config": "1.30.3-beta.1", | ||
"@percy/dom": "1.30.3-beta.1", | ||
"@percy/logger": "1.30.3-beta.1", | ||
"@percy/webdriver-utils": "1.30.3-beta.1", | ||
"content-disposition": "^0.5.4", | ||
@@ -64,3 +64,3 @@ "cross-spawn": "^7.0.3", | ||
}, | ||
"gitHead": "8f5a9cb4b287900c4b053302452ea6f84d20c2f1" | ||
"gitHead": "ef0d87e52a4010b4a59eb5e0161319826f34f97b" | ||
} |
413220
5581
+ Added@percy/client@1.30.3-beta.1(transitive)
+ Added@percy/config@1.30.3-beta.1(transitive)
+ Added@percy/dom@1.30.3-beta.1(transitive)
+ Added@percy/env@1.30.3-beta.1(transitive)
+ Added@percy/logger@1.30.3-beta.1(transitive)
+ Added@percy/sdk-utils@1.30.3-beta.1(transitive)
+ Added@percy/webdriver-utils@1.30.3-beta.1(transitive)
- Removed@percy/client@1.30.3-beta.0(transitive)
- Removed@percy/config@1.30.3-beta.0(transitive)
- Removed@percy/dom@1.30.3-beta.0(transitive)
- Removed@percy/env@1.30.3-beta.0(transitive)
- Removed@percy/logger@1.30.3-beta.0(transitive)
- Removed@percy/sdk-utils@1.30.3-beta.0(transitive)
- Removed@percy/webdriver-utils@1.30.3-beta.0(transitive)
Updated@percy/client@1.30.3-beta.1
Updated@percy/config@1.30.3-beta.1
Updated@percy/dom@1.30.3-beta.1
Updated@percy/logger@1.30.3-beta.1