Skip to content

Commit

Permalink
refactor: fix typos (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
grdsdev authored Dec 5, 2024
1 parent 595277b commit 2824f14
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 43 deletions.
8 changes: 4 additions & 4 deletions Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
793895CC2954ABFF0044F2B8 /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 793895CB2954ABFF0044F2B8 /* RootView.swift */; };
793895CE2954AC000044F2B8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 793895CD2954AC000044F2B8 /* Assets.xcassets */; };
793895D22954AC000044F2B8 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 793895D12954AC000044F2B8 /* Preview Assets.xcassets */; };
793E03092B2CED5D00AC7DED /* Contants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 793E03082B2CED5D00AC7DED /* Contants.swift */; };
793E03092B2CED5D00AC7DED /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 793E03082B2CED5D00AC7DED /* Constants.swift */; };
793E030B2B2CEDDA00AC7DED /* ActionState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 793E030A2B2CEDDA00AC7DED /* ActionState.swift */; };
793E030D2B2DAB5700AC7DED /* SignInWithApple.swift in Sources */ = {isa = PBXBuildFile; fileRef = 793E030C2B2DAB5700AC7DED /* SignInWithApple.swift */; };
79401F332BC6FEAE004C9C0F /* SignInWithOAuth.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79401F322BC6FEAE004C9C0F /* SignInWithOAuth.swift */; };
Expand Down Expand Up @@ -86,7 +86,7 @@
793895CD2954AC000044F2B8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
793895CF2954AC000044F2B8 /* Examples.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Examples.entitlements; sourceTree = "<group>"; };
793895D12954AC000044F2B8 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
793E03082B2CED5D00AC7DED /* Contants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Contants.swift; sourceTree = "<group>"; };
793E03082B2CED5D00AC7DED /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
793E030A2B2CEDDA00AC7DED /* ActionState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionState.swift; sourceTree = "<group>"; };
793E030C2B2DAB5700AC7DED /* SignInWithApple.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInWithApple.swift; sourceTree = "<group>"; };
79401F322BC6FEAE004C9C0F /* SignInWithOAuth.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInWithOAuth.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -226,7 +226,7 @@
794EF1232955F3DE008C9526 /* TodoListRow.swift */,
796298982AEBBA77000AA957 /* MFAFlow.swift */,
79AF04852B2CE586008761AD /* Debug.swift */,
793E03082B2CED5D00AC7DED /* Contants.swift */,
793E03082B2CED5D00AC7DED /* Constants.swift */,
793E030A2B2CEDDA00AC7DED /* ActionState.swift */,
79E2B55B2B97A2310042CD21 /* UIApplicationExtensions.swift */,
797EFB672BABD90500098D6B /* Stringfy.swift */,
Expand Down Expand Up @@ -507,7 +507,7 @@
79401F332BC6FEAE004C9C0F /* SignInWithOAuth.swift in Sources */,
79B1C80E2BAC017C00D991AA /* AnyJSONView.swift in Sources */,
79E2B5552B9788BF0042CD21 /* GoogleSignInSDKFlow.swift in Sources */,
793E03092B2CED5D00AC7DED /* Contants.swift in Sources */,
793E03092B2CED5D00AC7DED /* Constants.swift in Sources */,
794C61D62BAD1E12000E6B0F /* UserIdentityList.swift in Sources */,
793895CC2954ABFF0044F2B8 /* RootView.swift in Sources */,
7956406A2955AFBD0088A06F /* ErrorText.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Contants.swift
// Constants.swift
// Examples
//
// Created by Guilherme Souza on 15/12/23.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// Contants.swift
// Constants.swift
//
//
// Created by Guilherme Souza on 22/05/24.
Expand All @@ -21,7 +21,7 @@ extension HTTPField.Name {
}

let apiVersions: [APIVersion.Name: APIVersion] = [
._20240101: ._20240101,
._20240101: ._20240101
]

struct APIVersion {
Expand All @@ -33,9 +33,9 @@ struct APIVersion {
}

static func date(for name: Name) -> Date {
let formattar = ISO8601DateFormatter()
formattar.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
return formattar.date(from: "\(name.rawValue)T00:00:00.0Z")!
let formatter = ISO8601DateFormatter()
formatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
return formatter.date(from: "\(name.rawValue)T00:00:00.0Z")!
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ final class PostgrestFilterTests: XCTestCase {
configuration: PostgrestClient.Configuration(
url: URL(string: "\(DotEnv.SUPABASE_URL)/rest/v1")!,
headers: [
"apikey": DotEnv.SUPABASE_ANON_KEY,
"apikey": DotEnv.SUPABASE_ANON_KEY
],
logger: nil
)
)

func testNot() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("status")
.not("status", operator: .eq, value: "OFFLINE")
.execute()
Expand All @@ -44,7 +45,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testOr() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("status,username")
.or("status.eq.OFFLINE,username.eq.supabot")
.execute()
Expand All @@ -66,7 +68,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testEq() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("username")
.eq("username", value: "supabot")
.execute()
Expand All @@ -83,7 +86,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testNeq() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("username")
.neq("username", value: "supabot")
.execute()
Expand All @@ -106,7 +110,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testGt() async throws {
let res = try await client.from("messages")
let res =
try await client.from("messages")
.select("id")
.gt("id", value: 1)
.execute()
Expand All @@ -123,7 +128,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testGte() async throws {
let res = try await client.from("messages")
let res =
try await client.from("messages")
.select("id")
.gte("id", value: 1)
.execute()
Expand All @@ -143,7 +149,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testLe() async throws {
let res = try await client.from("messages")
let res =
try await client.from("messages")
.select("id")
.lt("id", value: 2)
.execute()
Expand All @@ -160,7 +167,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testLte() async throws {
let res = try await client.from("messages")
let res =
try await client.from("messages")
.select("id")
.lte("id", value: 2)
.execute()
Expand All @@ -180,7 +188,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testLike() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("username")
.like("username", pattern: "%supa%")
.execute()
Expand All @@ -197,7 +206,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testLikeAllOf() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("username")
.likeAllOf("username", patterns: ["%supa%", "%bot%"])
.execute()
Expand All @@ -214,7 +224,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testLikeAnyOf() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("username")
.likeAnyOf("username", patterns: ["%supa%", "%kiwi%"])
.execute()
Expand All @@ -234,7 +245,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testIlike() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("username")
.ilike("username", pattern: "%SUPA%")
.execute()
Expand All @@ -251,7 +263,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testIlikeAllOf() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("username")
.iLikeAllOf("username", patterns: ["%SUPA%", "%bot%"])
.execute()
Expand All @@ -268,7 +281,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testIlikeAnyOf() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("username")
.iLikeAnyOf("username", patterns: ["%supa%", "%KIWI%"])
.execute()
Expand All @@ -288,7 +302,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testIs() async throws {
let res = try await client.from("users").select("data").is("data", value: nil)
let res =
try await client.from("users").select("data").is("data", value: nil)
.execute()
.value as AnyJSON

Expand All @@ -314,7 +329,8 @@ final class PostgrestFilterTests: XCTestCase {

func testIn() async throws {
let statuses = ["ONLINE", "OFFLINE"]
let res = try await client.from("users").select("status").in("status", values: statuses)
let res =
try await client.from("users").select("status").in("status", values: statuses)
.execute()
.value as AnyJSON

Expand All @@ -339,7 +355,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testContains() async throws {
let res = try await client.from("users").select("age_range").contains("age_range", value: "[1,2)")
let res =
try await client.from("users").select("age_range").contains("age_range", value: "[1,2)")
.execute()
.value as AnyJSON

Expand All @@ -355,7 +372,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testContainedBy() async throws {
let res = try await client.from("users").select("age_range").containedBy("age_range", value: "[1,2)")
let res =
try await client.from("users").select("age_range").containedBy("age_range", value: "[1,2)")
.execute()
.value as AnyJSON

Expand All @@ -371,7 +389,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testRangeLt() async throws {
let res = try await client.from("users").select("age_range").rangeLt("age_range", range: "[2,25)")
let res =
try await client.from("users").select("age_range").rangeLt("age_range", range: "[2,25)")
.execute()
.value as AnyJSON

Expand All @@ -387,7 +406,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testRangeGt() async throws {
let res = try await client.from("users").select("age_range").rangeGt("age_range", range: "[2,25)")
let res =
try await client.from("users").select("age_range").rangeGt("age_range", range: "[2,25)")
.execute()
.value as AnyJSON

Expand All @@ -406,7 +426,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testRangeLte() async throws {
let res = try await client.from("users").select("age_range").rangeLte("age_range", range: "[2,25)")
let res =
try await client.from("users").select("age_range").rangeLte("age_range", range: "[2,25)")
.execute()
.value as AnyJSON

Expand All @@ -422,7 +443,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testRangeGte() async throws {
let res = try await client.from("users").select("age_range").rangeGte("age_range", range: "[2,25)")
let res =
try await client.from("users").select("age_range").rangeGte("age_range", range: "[2,25)")
.execute()
.value as AnyJSON

Expand All @@ -444,7 +466,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testRangeAdjacent() async throws {
let res = try await client.from("users").select("age_range").rangeAdjacent("age_range", range: "[2,25)")
let res =
try await client.from("users").select("age_range").rangeAdjacent("age_range", range: "[2,25)")
.execute()
.value as AnyJSON

Expand All @@ -466,7 +489,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testOverlaps() async throws {
let res = try await client.from("users").select("age_range").overlaps("age_range", value: "[2,25)")
let res =
try await client.from("users").select("age_range").overlaps("age_range", value: "[2,25)")
.execute()
.value as AnyJSON

Expand All @@ -482,7 +506,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testTextSearch() async throws {
let res = try await client.from("users").select("catchphrase")
let res =
try await client.from("users").select("catchphrase")
.textSearch("catchphrase", query: "'fat' & 'cat'", config: "english")
.execute()
.value as AnyJSON
Expand All @@ -499,7 +524,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testTextSearchWithPlain() async throws {
let res = try await client.from("users").select("catchphrase")
let res =
try await client.from("users").select("catchphrase")
.textSearch("catchphrase", query: "'fat' & 'cat'", config: "english", type: .plain)
.execute()
.value as AnyJSON
Expand All @@ -516,7 +542,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testTextSearchWithPhrase() async throws {
let res = try await client.from("users").select("catchphrase")
let res =
try await client.from("users").select("catchphrase")
.textSearch("catchphrase", query: "cat", config: "english", type: .phrase)
.execute()
.value as AnyJSON
Expand All @@ -536,7 +563,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testTextSearchWithWebsearch() async throws {
let res = try await client.from("users").select("catchphrase")
let res =
try await client.from("users").select("catchphrase")
.textSearch("catchphrase", query: "'fat' & 'cat'", config: "english", type: .websearch)
.execute()
.value as AnyJSON
Expand All @@ -553,7 +581,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testMultipleFilters() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select()
.eq("username", value: "supabot")
.is("data", value: nil)
Expand All @@ -579,7 +608,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testFilter() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("username")
.filter("username", operator: "eq", value: "supabot")
.execute()
Expand All @@ -597,7 +627,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testMatch() async throws {
let res = try await client.from("users")
let res =
try await client.from("users")
.select("username,status")
.match(["username": "supabot", "status": "ONLINE"])
.execute()
Expand All @@ -616,7 +647,8 @@ final class PostgrestFilterTests: XCTestCase {
}

func testFilterOnRpc() async throws {
let res = try await client.rpc("get_username_and_status", params: ["name_param": "supabot"])
let res =
try await client.rpc("get_username_and_status", params: ["name_param": "supabot"])
.neq("status", value: "ONLINE")
.execute()
.value as AnyJSON
Expand Down

0 comments on commit 2824f14

Please sign in to comment.