@netlify/config 20.6.1 → 20.6.2

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.
@@ -18,6 +18,12 @@ export const validations = [
18
18
  message: '"path" and "pattern" are mutually exclusive.',
19
19
  example: () => ({ edge_functions: [{ path: '/hello', function: 'hello' }] }),
20
20
  },
21
+ {
22
+ property: 'edge_functions.*',
23
+ check: (edgeFunction) => !(edgeFunction.excludedPath !== undefined && edgeFunction.excludedPattern !== undefined),
24
+ message: '"excludedPath" and "excludedPattern" are mutually exclusive.',
25
+ example: () => ({ edge_functions: [{ path: '/hello/*', function: 'hello', excludedPath: '/hello/no' }] }),
26
+ },
21
27
  {
22
28
  property: 'edge_functions.*',
23
29
  check: (edgeFunction) => edgeFunction.function !== undefined,
@@ -38,14 +44,6 @@ export const validations = [
38
44
  edge_functions: [{ path: '/products/*', excludedPath: ['/products/*.jpg'], function: 'customise' }],
39
45
  }),
40
46
  },
41
- {
42
- property: 'edge_functions.*',
43
- check: (value) => value.excludedPath === undefined || value.path !== undefined,
44
- message: '"excludedPath" can only be specified together with "path".',
45
- example: () => ({
46
- edge_functions: [{ path: '/products/*', excludedPath: ['/products/*.jpg'], function: 'customise' }],
47
- }),
48
- },
49
47
  {
50
48
  property: 'edge_functions.*.pattern',
51
49
  check: isString,
@@ -57,15 +55,7 @@ export const validations = [
57
55
  check: (value) => isString(value) || (Array.isArray(value) && value.every(isString)),
58
56
  message: 'must be a string or array of strings.',
59
57
  example: () => ({
60
- edge_functions: [{ path: '/products/(.*)', excludedPath: ['/products/(.*)\\.jpg'], function: 'customise' }],
61
- }),
62
- },
63
- {
64
- property: 'edge_functions.*.excludedPattern',
65
- check: (value) => value.excludedPattern === undefined || value.pattern !== undefined,
66
- message: '"excludedPattern" can only be specified together with "pattern".',
67
- example: () => ({
68
- edge_functions: [{ path: '/products/(.*)', excludedPath: ['/products/(.*)\\.jpg'], function: 'customise' }],
58
+ edge_functions: [{ path: '/products/(.*)', excludedPattern: ['^/products/(.*)\\.jpg$'], function: 'customise' }],
69
59
  }),
70
60
  },
71
61
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/config",
3
- "version": "20.6.1",
3
+ "version": "20.6.2",
4
4
  "description": "Netlify config module",
5
5
  "type": "module",
6
6
  "exports": "./lib/index.js",
@@ -94,5 +94,5 @@
94
94
  "engines": {
95
95
  "node": "^14.16.0 || >=16.0.0"
96
96
  },
97
- "gitHead": "955ef6d9b44d9dd92cef78ba80b15f416044bfc9"
97
+ "gitHead": "487f1b282fed53beeb3ea17db151a741535ba8fc"
98
98
  }