-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03ea48e
commit dfb9ed9
Showing
45 changed files
with
1,410 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
// | ||
// CharacterSet+numbers.swift | ||
// | ||
// StudentVue | ||
// | ||
// Created by TheMoonThatRises on 3/18/23. | ||
// | ||
|
||
import Foundation | ||
|
||
extension CharacterSet { | ||
public static let numbers = CharacterSet(charactersIn: "0123456789").inverted | ||
/// A `CharacterSet` disallowing all numerical values. | ||
internal static let numbers = CharacterSet(charactersIn: "0123456789").inverted | ||
|
||
public static let numbersextended = CharacterSet(charactersIn: "0123456789/-.").inverted | ||
/// A `CharacterSet` disallowing all numerical values along with some other symbols. | ||
internal static let numbersextended = CharacterSet(charactersIn: "0123456789/-.").inverted | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
// | ||
// String+PercentEncoding.swift | ||
// | ||
// StudentVue | ||
// | ||
// Created by TheMoonThatRises on 3/9/23. | ||
// | ||
|
||
import Foundation | ||
|
||
extension String { | ||
/// Percent encode if possible | ||
/// Percent encode `String.self` for an input of valid characters if possible. | ||
/// | ||
/// - Parameters: | ||
/// - withAllowedCharacters: Set of characters to encode | ||
/// - Parameter withAllowedCharacters: Set of characters to encode. | ||
/// | ||
/// - Returns: String percent encoded with character set | ||
func percentEncoding(withAllowedCharacters: CharacterSet) -> String { | ||
/// - Returns: String percent encoded with character set. | ||
internal func percentEncoding(withAllowedCharacters: CharacterSet) -> String { | ||
self.addingPercentEncoding(withAllowedCharacters: withAllowedCharacters) ?? self | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
// | ||
// String+unescape.swift | ||
// | ||
// StudentVue | ||
// | ||
// Created by TheMoonThatRises on 4/11/23. | ||
// | ||
|
||
import Foundation | ||
|
||
extension String { | ||
/// Unescapes left and right angle brackets | ||
var unescape: String { | ||
/// Unescapes left and right angle brackets. | ||
internal var unescape: String { | ||
let characters = [ | ||
// "&": "&", | ||
"<": "<", | ||
">": ">" | ||
// """: "\\\"", | ||
// "'": "'" | ||
] | ||
|
||
var str = self | ||
|
||
for (escaped, unescaped) in characters { | ||
str = str.replacingOccurrences(of: escaped, with: unescaped, options: .literal, range: nil) | ||
} | ||
|
||
return str | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.