@percy/cli-snapshot 1.6.2 → 1.7.0

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 +2 -2
  2. package/package.json +3 -3
package/dist/snapshot.js CHANGED
@@ -147,14 +147,14 @@ function merge(...objs) {
147
147
  async function loadSnapshotFile(file) {
148
148
  let ext = path.extname(file);
149
149
 
150
- if (ext === '.js') {
150
+ if (/\.(c|m)?js$/.test(ext)) {
151
151
  let {
152
152
  default: module
153
153
  } = await import(path.resolve(file));
154
154
  return typeof module === 'function' ? await module() : module;
155
155
  } else if (ext === '.json') {
156
156
  return JSON.parse(fs.readFileSync(file, 'utf-8'));
157
- } else if (ext.match(/\.ya?ml$/)) {
157
+ } else if (/\.ya?ml$/.test(ext)) {
158
158
  let {
159
159
  default: YAML
160
160
  } = await import('yaml');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@percy/cli-snapshot",
3
- "version": "1.6.2",
3
+ "version": "1.7.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,8 +32,8 @@
32
32
  ]
33
33
  },
34
34
  "dependencies": {
35
- "@percy/cli-command": "1.6.2",
35
+ "@percy/cli-command": "1.7.0",
36
36
  "yaml": "^2.0.0"
37
37
  },
38
- "gitHead": "c033d52167cdd5873027d9de2676f3fc9f55ef2d"
38
+ "gitHead": "f1418fb1effdaad2d32c65d1a358282ab1f9ec32"
39
39
  }