Skip to content

Commit d3b1f40

Browse files
Format Swift code
1 parent f633ef2 commit d3b1f40

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ public class ExportSwift {
5555
}
5656
return (
5757
outputSwift: outputSwift,
58-
outputSkeleton: ExportedSkeleton(moduleName: moduleName, functions: exportedFunctions, classes: exportedClasses)
58+
outputSkeleton: ExportedSkeleton(
59+
moduleName: moduleName,
60+
functions: exportedFunctions,
61+
classes: exportedClasses
62+
)
5963
)
6064
}
6165

Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,24 +253,24 @@ struct BridgeJSLink {
253253
private func renderSwiftClassWrappers() -> [String] {
254254
var wrapperLines: [String] = []
255255
var modulesByName: [String: [ExportedClass]] = [:]
256-
256+
257257
// Group classes by their module name
258258
for skeleton in exportedSkeletons {
259259
if skeleton.classes.isEmpty { continue }
260-
260+
261261
if modulesByName[skeleton.moduleName] == nil {
262262
modulesByName[skeleton.moduleName] = []
263263
}
264264
modulesByName[skeleton.moduleName]?.append(contentsOf: skeleton.classes)
265265
}
266-
266+
267267
// Generate wrapper functions for each module
268268
for (moduleName, classes) in modulesByName {
269269
wrapperLines.append("// Wrapper functions for module: \(moduleName)")
270270
wrapperLines.append("if (!importObject[\"\(moduleName)\"]) {")
271271
wrapperLines.append(" importObject[\"\(moduleName)\"] = {};")
272272
wrapperLines.append("}")
273-
273+
274274
for klass in classes {
275275
let wrapperFunctionName = "bjs_\(klass.name)_wrap"
276276
wrapperLines.append("importObject[\"\(moduleName)\"][\"\(wrapperFunctionName)\"] = function(pointer) {")
@@ -279,7 +279,7 @@ struct BridgeJSLink {
279279
wrapperLines.append("};")
280280
}
281281
}
282-
282+
283283
return wrapperLines
284284
}
285285

@@ -770,7 +770,9 @@ struct BridgeJSLink {
770770

771771
init(moduleName: String) {
772772
self.moduleName = moduleName
773-
importedLines.append("const \(moduleName) = importObject[\"\(moduleName)\"] = importObject[\"\(moduleName)\"] || {};")
773+
importedLines.append(
774+
"const \(moduleName) = importObject[\"\(moduleName)\"] = importObject[\"\(moduleName)\"] || {};"
775+
)
774776
}
775777

776778
func assignToImportObject(name: String, function: [String]) {

0 commit comments

Comments
 (0)