feat(secret-ref): updated reference corner cases of trailing slashes

This commit is contained in:
akhilmhdh
2023-07-06 22:15:10 +05:30
parent 5aba0c60b8
commit 8a237af4ac
2 changed files with 10 additions and 4 deletions
@@ -45,7 +45,14 @@ const schema = yup.object({
.array(
yup.object({
environment: yup.string().max(50).required().label("Environment"),
secretPath: yup.string().required().default("/").label("Secret Path")
secretPath: yup
.string()
.required()
.default("/")
.label("Secret Path")
.transform((val) =>
typeof val === "string" && val.at(-1) === "/" && val.length > 1 ? val.slice(0, -1) : val
)
})
)
.min(1)