@percy/client
Advanced tools
Comparing version 1.28.0 to 1.28.1-beta.0
@@ -5,3 +5,3 @@ import fs from 'fs'; | ||
import logger from '@percy/logger'; | ||
import { pool, request, formatBytes, sha256hash, base64encode, getPackageJSON, waitForTimeout } from './utils.js'; | ||
import { pool, request, formatBytes, sha256hash, base64encode, getPackageJSON, waitForTimeout, validateTiles } from './utils.js'; | ||
@@ -58,2 +58,4 @@ // Default client API URL can be set with an env var for API development | ||
this.addEnvironmentInfo(environmentInfo); | ||
this.buildType = null; | ||
this.screenshotFlow = null; | ||
} | ||
@@ -556,2 +558,5 @@ | ||
async sendComparison(buildId, options) { | ||
if (!validateTiles(options.tiles)) { | ||
throw new Error('sha, filepath or content should be present in tiles object'); | ||
} | ||
let snapshot = await this.createSnapshot(buildId, options); | ||
@@ -558,0 +563,0 @@ let comparison = await this.createComparison(snapshot.data.id, options); |
@@ -226,2 +226,10 @@ import os from 'os'; | ||
} | ||
export function validateTiles(tiles) { | ||
for (const tile of tiles) { | ||
if (!tile.filepath && !tile.content && !tile.sha) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
export { hostnameMatches, ProxyHttpAgent, ProxyHttpsAgent, proxyAgentFor } from './proxy.js'; |
{ | ||
"name": "@percy/client", | ||
"version": "1.28.0", | ||
"version": "1.28.1-beta.0", | ||
"license": "MIT", | ||
@@ -12,3 +12,3 @@ "repository": { | ||
"access": "public", | ||
"tag": "latest" | ||
"tag": "beta" | ||
}, | ||
@@ -36,6 +36,6 @@ "engines": { | ||
"dependencies": { | ||
"@percy/env": "1.28.0", | ||
"@percy/logger": "1.28.0" | ||
"@percy/env": "1.28.1-beta.0", | ||
"@percy/logger": "1.28.1-beta.0" | ||
}, | ||
"gitHead": "9d95f18e45e37aa3683e5b8276fd85cf07dba8cb" | ||
"gitHead": "648f81742ebf8c6f29ccdfdff77df124e4e1668d" | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
47442
1104
2
+ Added@percy/env@1.28.1-beta.0(transitive)
+ Added@percy/logger@1.28.1-beta.0(transitive)
- Removed@percy/env@1.28.0(transitive)
- Removed@percy/logger@1.28.0(transitive)
Updated@percy/env@1.28.1-beta.0
Updated@percy/logger@1.28.1-beta.0