@percy/core 1.0.5 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/snapshot.js +3 -17
  2. package/package.json +6 -6
package/dist/snapshot.js CHANGED
@@ -120,24 +120,10 @@ export async function gatherSnapshots(percy, options) {
120
120
  // other invalid options which are also scrubbed from the returned migrated options.
121
121
 
122
122
  export function validateSnapshotOptions(options) {
123
- let schema; // decide which schema to validate against
124
-
125
- if ('domSnapshot' in options) {
126
- schema = '/snapshot/dom';
127
- } else if ('url' in options) {
128
- schema = '/snapshot';
129
- } else if ('sitemap' in options) {
130
- schema = '/snapshot/sitemap';
131
- } else if ('serve' in options) {
132
- schema = '/snapshot/server';
133
- } else if ('snapshots' in options) {
134
- schema = '/snapshot/list';
135
- } else {
136
- schema = '/snapshot';
137
- }
138
-
123
+ // decide which schema to validate against
124
+ let schema = ['domSnapshot', 'dom-snapshot', 'dom_snapshot'].some(k => k in options) && '/snapshot/dom' || 'url' in options && '/snapshot' || 'sitemap' in options && '/snapshot/sitemap' || 'serve' in options && '/snapshot/server' || 'snapshots' in options && '/snapshot/list' || '/snapshot';
139
125
  let {
140
- // migrate and remove certain properties from validating
126
+ // normalize, migrate, and remove certain properties from validating
141
127
  clientInfo,
142
128
  environmentInfo,
143
129
  snapshots,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/core",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,10 +39,10 @@
39
39
  "test:types": "tsd"
40
40
  },
41
41
  "dependencies": {
42
- "@percy/client": "1.0.5",
43
- "@percy/config": "1.0.5",
44
- "@percy/dom": "1.0.5",
45
- "@percy/logger": "1.0.5",
42
+ "@percy/client": "1.0.8",
43
+ "@percy/config": "1.0.8",
44
+ "@percy/dom": "1.0.8",
45
+ "@percy/logger": "1.0.8",
46
46
  "content-disposition": "^0.5.4",
47
47
  "cross-spawn": "^7.0.3",
48
48
  "extract-zip": "^2.0.1",
@@ -53,5 +53,5 @@
53
53
  "rimraf": "^3.0.2",
54
54
  "ws": "^8.0.0"
55
55
  },
56
- "gitHead": "7cf12904abb316ab7348332e68c8c0ef68d78097"
56
+ "gitHead": "86c0b8916ed78205d3044f29b0384a25a5a93214"
57
57
  }