Skip to content

Commit

Permalink
A small renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
sidepelican committed Oct 28, 2024
1 parent 21d65e9 commit 390bcfa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/MockoloFramework/Operations/Generator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public func generate(sourceDirs: [String],
// nameOverride does not work correctly but it giving up.
return (typeName, "\(typeName)Mock()")
}
SwiftType.customTypeMap = [String: String](typeKeyList, uniquingKeysWith: { $1 })
SwiftType.customDefaultValueMap = [String: String](typeKeyList, uniquingKeysWith: { $1 })

signpost_begin(name: "Generate models")
log("Resolve inheritance and generate unique entity models...", level: .info)
Expand Down
10 changes: 5 additions & 5 deletions Sources/MockoloFramework/Utils/TypeParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ public final class SwiftType {
return cachedDefaultVal
}

// There is no "existential any" to the customTypeMap key.
if let val = SwiftType.customTypeMap?[typeName.removingExistentialAny] {
// There is no "existential any" to the customDefaultValueMap key.
if let val = SwiftType.customDefaultValueMap?[typeName.removingExistentialAny] {
cachedDefaultVal = val
return val
}
Expand Down Expand Up @@ -466,7 +466,7 @@ public final class SwiftType {
return "\(arg.typeName)()"
}

if let val = SwiftType.defaultTypeValueMap[arg.typeName] {
if let val = SwiftType.defaultValueMap[arg.typeName] {
return val
}
return nil
Expand Down Expand Up @@ -640,7 +640,7 @@ public final class SwiftType {
}
}

public static var customTypeMap: [String: String]?
public static var customDefaultValueMap: [String: String]?

private let bracketPrefixTypes = ["Array", "Set", "Dictionary"]
private let rxTypes = [String.publishSubject : "()",
Expand All @@ -656,7 +656,7 @@ public final class SwiftType {
}


private static let defaultTypeValueMap =
private static let defaultValueMap =
["Int": "0",
"Int8": "0",
"Int16": "0",
Expand Down

0 comments on commit 390bcfa

Please sign in to comment.