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

fix: edge case prefix04 #98

Merged
merged 3 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/TorusUtils/Extensions/String+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ extension String {
return hasPrefix("04")
}

func add04Prefix() -> String {
if !hasPrefix("04") {
func add04Prefix(targetLength: Int = 128) -> String {
if self.count == targetLength{
return "04" + self
}
return self
}

func strip04Prefix() -> String {
if hasPrefix("04") {
func strip04Prefix(targetLength: Int = 130) -> String {
if hasPrefix("04") && self.count == targetLength {
let indexStart = index(startIndex, offsetBy: 2)
return String(self[indexStart...])
}
Expand Down
2 changes: 1 addition & 1 deletion Torus-utils.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "Torus-utils"
spec.version = "8.1.0"
spec.version = "8.1.2"
spec.ios.deployment_target = "13.0"
spec.summary = "Retrieve user shares"
spec.homepage = "https://github.com/torusresearch/torus-utils-swift"
Expand Down
Loading