From 5c390ab98df35e0c2e22aeb7af88e7287d3d1730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Bou=C3=A7as?= Date: Thu, 20 Jun 2024 12:57:59 +0100 Subject: [PATCH] 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. --- src/function/v2.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/function/v2.ts b/src/function/v2.ts index 45ddc4c2..55f6f258 100644 --- a/src/function/v2.ts +++ b/src/function/v2.ts @@ -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. @@ -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 /**