Skip to content

Commit

Permalink
Fix typos in internal Structured event constants (#911)
Browse files Browse the repository at this point in the history
  • Loading branch information
mscwilson authored Dec 16, 2024
1 parent c105d9f commit 971d519
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Examples
10 changes: 5 additions & 5 deletions Sources/Core/TrackerConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@ let kSPPageTitle = "page"
let kSPPageRefr = "refr"

// --- Structured Event
let kSPStuctCategory = "se_ca"
let kSPStuctAction = "se_ac"
let kSPStuctLabel = "se_la"
let kSPStuctProperty = "se_pr"
let kSPStuctValue = "se_va"
let kSPStructCategory = "se_ca"
let kSPStructAction = "se_ac"
let kSPStructLabel = "se_la"
let kSPStructProperty = "se_pr"
let kSPStructValue = "se_va"

// --- E-commerce Transaction Event
let kSPEcommId = "tr_id"
Expand Down
10 changes: 5 additions & 5 deletions Sources/Snowplow/Events/Structured.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public class Structured: PrimitiveAbstract {

override var payload: [String : Any] {
var payload: [String : Any] = [:]
payload[kSPStuctCategory] = category
payload[kSPStuctAction] = action
if let label = label { payload[kSPStuctLabel] = label }
if let property = property { payload[kSPStuctProperty] = property }
payload[kSPStructCategory] = category
payload[kSPStructAction] = action
if let label = label { payload[kSPStructLabel] = label }
if let property = property { payload[kSPStructProperty] = property }
if let value = value {
payload[kSPStuctValue] = String(format: "%.17g", value.doubleValue)
payload[kSPStructValue] = String(format: "%.17g", value.doubleValue)
}
return payload
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/Global Contexts/TestGlobalContexts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import XCTest

class GlobalContextGenerator: NSObject, ContextGenerator {
func filter(from event: InspectableEvent) -> Bool {
return "StringToMatch" == event.payload[kSPStuctCategory] as? String
return "StringToMatch" == event.payload[kSPStructCategory] as? String
}

func generator(from event: InspectableEvent) -> [SelfDescribingJson]? {
Expand Down Expand Up @@ -151,7 +151,7 @@ class TestGlobalContexts: XCTestCase {
])
],
filter: { event in
return stringToMatch == event.payload[kSPStuctCategory] as? String
return stringToMatch == event.payload[kSPStructCategory] as? String
})
let filterNotMatchingGC = GlobalContext(staticContexts: [
SelfDescribingJson(schema: "schemaNotMatching", andDictionary: [
Expand Down

0 comments on commit 971d519

Please sign in to comment.