summaryrefslogtreecommitdiff
path: root/cli/schemas
diff options
context:
space:
mode:
authorMarvin Hagemeister <marvin@deno.com>2024-09-05 09:50:04 +0200
committerGitHub <noreply@github.com>2024-09-05 09:50:04 +0200
commit4554ab6aefb158f2d0a8a5ae5bb3d748e123fb00 (patch)
tree3b0435c62e125e34b4d16e20943dde6d58e0bad3 /cli/schemas
parent49e3ee010c7d4423fbab89bf12749235e156c9be (diff)
fix(config): validate export names (#25436)
The property names of the `exports` field in `deno.json` was never validated. The `patternProperties` only validates values, whose property name matches the regex. It doesn't validate the property names themselves. That's what `propertyNames` is for. Related https://github.com/denoland/deno/issues/25435
Diffstat (limited to 'cli/schemas')
-rw-r--r--cli/schemas/config-file.v1.json5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/schemas/config-file.v1.json b/cli/schemas/config-file.v1.json
index cc2c1eb6f..df8177af2 100644
--- a/cli/schemas/config-file.v1.json
+++ b/cli/schemas/config-file.v1.json
@@ -622,6 +622,11 @@
{
"type": "object",
"description": "A map of package exports to files in this JSR package.",
+ "propertyNames": {
+ "description": "Package export name",
+ "examples": [".", "./foo", "./bar"],
+ "pattern": "^\\.(/.*)?$"
+ },
"patternProperties": {
"^\\.(/.*)?$": {
"type": "string",