Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#URL macro #2

Merged
merged 3 commits into from
Mar 6, 2024
Merged

#URL macro #2

merged 3 commits into from
Mar 6, 2024

Conversation

mallexxx
Copy link
Contributor

@mallexxx mallexxx commented Feb 29, 2024

@mallexxx mallexxx requested a review from ayoy February 29, 2024 09:22
@mallexxx mallexxx mentioned this pull request Mar 6, 2024
13 tasks
@mallexxx
Copy link
Contributor Author

mallexxx commented Mar 6, 2024

Updated the comment and opened iOS PR

Comment on lines 21 to 35
/// Compile-time validated OS version independent URL instantiation from String Literal.
///
/// Used to statically validate preset URLs.
/// The idea is to disable any flaky URL conversions like punycode or no-scheme urls, only 1-1 mapped String Literals can be used.
///
/// Usage: `let url = #URL("https://duckduckgo.com")`
///
/// - Note: Strings like "http://💩.la" or "1" are not valid #URL parameter values.
/// To instantiate a parametrized URL use `URL.appendingPathComponent(_:)` or `URL.appendingParameters(_:allowedReservedCharacters:)`
/// To instantiate a URL from a String format, use `URL(string:)`
///
/// - Parameter string: valid URL String Literal with URL scheme and
/// - Returns: URL instance if provided string argument is a valid URL
/// - Throws: Compile-time error if provided string argument is not a valid URL
///
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Contributor

@ayoy ayoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job @mallexxx ! 💪

@mallexxx mallexxx merged commit d51beaf into main Mar 6, 2024
mallexxx added a commit to duckduckgo/BrowserServicesKit that referenced this pull request Mar 7, 2024
mallexxx added a commit to duckduckgo/iOS that referenced this pull request Mar 7, 2024
mallexxx added a commit to duckduckgo/macos-browser that referenced this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants