1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-06 17:50:25 +00:00

Rename IsEmpty to IsAPIObjectEmpty

This commit is contained in:
Darren Shepherd
2018-07-13 13:04:31 -07:00
parent c3512e7097
commit c29825b3db
3 changed files with 5 additions and 5 deletions

View File

@@ -108,10 +108,10 @@ func (b *Builder) copyInputs(schema *types.Schema, input map[string]interface{},
}
if op.IsList() && !b.edit && !b.export {
if !convert.IsEmpty(input["type"]) {
if !convert.IsAPIObjectEmpty(input["type"]) {
result["type"] = input["type"]
}
if !convert.IsEmpty(input["id"]) {
if !convert.IsAPIObjectEmpty(input["id"]) {
result["id"] = input["id"]
}
}
@@ -184,7 +184,7 @@ func (b *Builder) dropDefaultsAndReadOnly(schema *types.Schema, result map[strin
continue
}
if convert.IsEmpty(existingVal) {
if convert.IsAPIObjectEmpty(existingVal) {
delete(result, name)
continue
}

View File

@@ -133,7 +133,7 @@ func LowerTitle(input string) string {
return string(runes)
}
func IsEmpty(v interface{}) bool {
func IsAPIObjectEmpty(v interface{}) bool {
if v == nil || v == "" || v == 0 || v == false {
return true
}

View File

@@ -32,7 +32,7 @@ outer:
for _, check := range mapper.CheckFields {
v, ok := data[check]
if !ok || convert.IsEmpty(v) {
if !ok || convert.IsAPIObjectEmpty(v) {
continue outer
}
}