Skip to content

Commit 5c390ab

Browse files
feat: add excludedPath property (#509)
**Which problem is this pull request solving?** Part of https://linear.app/netlify/issue/COM-724/excludedpath-in-functions-v2.
1 parent 3529a39 commit 5c390ab

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/function/v2.ts

+20
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ interface BaseConfig {
3030
}
3131

3232
interface ConfigWithPath extends BaseConfig {
33+
/**
34+
* One or more URL paths for which the function will not run, even if they
35+
* match a path defined with the `path` property. Paths must begin with a
36+
* forward slash.
37+
*
38+
* {@link} https://ntl.fyi/func-routing
39+
*/
40+
excludedPath?: Path | Path[]
41+
3342
/**
3443
* One or more URL paths for which the function will run. Paths must begin
3544
* with a forward slash.
@@ -38,10 +47,21 @@ interface ConfigWithPath extends BaseConfig {
3847
*/
3948
path?: Path | Path[]
4049

50+
/**
51+
* The `schedule` property cannot be used when `path` is used.
52+
*/
4153
schedule?: never
4254
}
4355

4456
interface ConfigWithSchedule extends BaseConfig {
57+
/**
58+
* The `excludedPath` property cannot be used when `schedule` is used.
59+
*/
60+
excludedPath?: never
61+
62+
/**
63+
* The `path` property cannot be used when `schedule` is used.
64+
*/
4565
path?: never
4666

4767
/**

0 commit comments

Comments
 (0)