From ac97ec77ef34046a2f443b2797fc6c13642db08b Mon Sep 17 00:00:00 2001 From: Myzel394 Date: Thu, 29 May 2025 20:22:57 +0200 Subject: [PATCH] fix(server): Improve namin --- server/doc-values/value-path.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/server/doc-values/value-path.go b/server/doc-values/value-path.go index 6be9e88..6d28552 100644 --- a/server/doc-values/value-path.go +++ b/server/doc-values/value-path.go @@ -50,13 +50,13 @@ func (v PathValue) DeprecatedCheckIsValid(value string) []*InvalidValue { } } - fileRequired := (v.RequiredType & PathTypeFile) == PathTypeFile - directoryRequired := (v.RequiredType & PathTypeDirectory) == PathTypeDirectory + fileExpected := (v.RequiredType & PathTypeFile) == PathTypeFile + directoryExpected := (v.RequiredType & PathTypeDirectory) == PathTypeDirectory isValid := true // If file is expected - if fileRequired { + if fileExpected { // and exists isValid = isValid && utils.IsPathFile(value) // file not expected @@ -66,7 +66,7 @@ func (v PathValue) DeprecatedCheckIsValid(value string) []*InvalidValue { } // if directory - if directoryRequired { + if directoryExpected { // and exists isValid = isValid && utils.IsPathDirectory(value) // directory not expected @@ -79,21 +79,21 @@ func (v PathValue) DeprecatedCheckIsValid(value string) []*InvalidValue { return nil } - if fileRequired && directoryRequired { + if fileExpected && directoryExpected { return []*InvalidValue{{ Err: errors.New("This must be either a file or a directory"), Start: 0, End: uint32(len(value)), }} } - if fileRequired { + if fileExpected { return []*InvalidValue{{ Err: errors.New("This must be a file"), Start: 0, End: uint32(len(value)), }} } - if directoryRequired { + if directoryExpected { return []*InvalidValue{{ Err: errors.New("This must be a directory"), Start: 0,