Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 27dadd9

Browse files
committed
use browser as default value for platform
1 parent 76ee898 commit 27dadd9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎Plugins/PackageToJS/Sources/PackageToJSPlugin.swift‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,10 @@ private func printStderr(_ message: String) {
442442

443443
extension ArgumentExtractor {
444444
mutating func extractPlatformOption(named name: String) throws -> PackageToJS.PackageOptions.Platform {
445-
let stringValue : String? = self.extractOption(named: name).last
446-
guard let stringValue else {
447-
throw PackageToJSError("Missing value for option --\(name)")
445+
guard let stringValue = self.extractOption(named: name).last else {
446+
return .browser
448447
}
448+
449449
guard let platform = PackageToJS.PackageOptions.Platform(rawValue: stringValue) else {
450450
throw PackageToJSError(
451451
"Invalid platform: \(stringValue), expected one of \(PackageToJS.PackageOptions.Platform.allCases.map(\.rawValue).joined(separator: ", "))"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /