You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds key mapping support for use in destination plugins. (#38)
* Adds key mapping support for use in destination plugins.
* Slight cleanup.
* Added array processing to tests.
Co-authored-by: Brandon Sneed <[email protected]>
Copy file name to clipboardExpand all lines: Sources/Segment/Utilities/JSON.swift
+64Lines changed: 64 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -267,9 +267,73 @@ extension JSON {
267
267
}
268
268
}
269
269
270
+
// MARK: - Mapping
271
+
272
+
extensionJSON{
273
+
/// Maps keys supplied, in the format of ["Old": "New"]. Gives an optional value transformer that can be used to transform values based on the final key name.
274
+
/// - Parameters:
275
+
/// - keys: A dictionary containing key mappings, in the format of ["Old": "New"].
276
+
/// - valueTransform: An optional value transform closure. Key represents the new key name.
0 commit comments