Deprecate slugified string exension
This commit is contained in:
parent
9f9d8e45f2
commit
1f9db1283e
|
@ -14,6 +14,7 @@ This version adjusts the library for Xcode 14 and deprecates some things.
|
|||
* The `IoC` namespace has been deprecated and will be removed in the next major version.
|
||||
* The `Messaging` namespace has been deprecated and will be removed in the next major version.
|
||||
* The `StoreKit` namespace has been deprecated and moved to https://github.com/danielsaidi/StoreKitPlus
|
||||
* `String+Slugified` has been deprecated and moved to https://github.com/danielsaidi/TagKit
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ public extension String {
|
|||
- separator: The separator to use in the slugified string, by default `-`.
|
||||
- allowedCharacters: The characters to allow in the slugified string, by default alphanumerical characters and `-`.
|
||||
*/
|
||||
@available(*, deprecated, message: "This extension has moved to https://github.com/danielsaidi/TagKit")
|
||||
func slugified(
|
||||
separator: String = "-",
|
||||
allowedCharacters: NSCharacterSet = NSCharacterSet(charactersIn: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-")
|
|
@ -1,7 +0,0 @@
|
|||
import XCTest
|
||||
|
||||
import SwiftKitTests
|
||||
|
||||
var tests = [XCTestCaseEntry]()
|
||||
tests += SwiftKitTests.allTests()
|
||||
XCTMain(tests)
|
|
@ -1,28 +0,0 @@
|
|||
//
|
||||
// String+SlugifiedTests.swift
|
||||
// SwiftKitTests
|
||||
//
|
||||
// Created by Daniel Saidi on 2021-04-22.
|
||||
// Copyright © 2021 Daniel Saidi. All rights reserved.
|
||||
//
|
||||
|
||||
import Quick
|
||||
import Nimble
|
||||
import SwiftKit
|
||||
|
||||
class String_SlugifiedTests: QuickSpec {
|
||||
|
||||
override func spec() {
|
||||
|
||||
func result(for string: String) -> String {
|
||||
string.slugified()
|
||||
}
|
||||
|
||||
describe("slugified text") {
|
||||
|
||||
it("removes invalid characters") {
|
||||
expect(result(for: "I'd love an AppleCar!")).to(equal("i-d-love-an-applecar"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,9 +0,0 @@
|
|||
import XCTest
|
||||
|
||||
#if !canImport(ObjectiveC)
|
||||
public func allTests() -> [XCTestCaseEntry] {
|
||||
return [
|
||||
testCase(SwiftKitTests.allTests)
|
||||
]
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue