Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add excludedPath property #509

Merged
merged 1 commit into from
Jun 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/function/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ interface BaseConfig {
}

interface ConfigWithPath extends BaseConfig {
/**
* One or more URL paths for which the function will not run, even if they
* match a path defined with the `path` property. Paths must begin with a
* forward slash.
*
* {@link} https://ntl.fyi/func-routing
*/
excludedPath?: Path | Path[]

/**
* One or more URL paths for which the function will run. Paths must begin
* with a forward slash.
Expand All @@ -38,10 +47,21 @@ interface ConfigWithPath extends BaseConfig {
*/
path?: Path | Path[]

/**
* The `schedule` property cannot be used when `path` is used.
*/
schedule?: never
}

interface ConfigWithSchedule extends BaseConfig {
/**
* The `excludedPath` property cannot be used when `schedule` is used.
*/
excludedPath?: never

/**
* The `path` property cannot be used when `schedule` is used.
*/
path?: never

/**
Expand Down
Loading