Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakubpetrik/isnotempty
IsNotEmpty
https://github.com/jakubpetrik/isnotempty
Last synced: about 7 hours ago
JSON representation
IsNotEmpty
- Host: GitHub
- URL: https://github.com/jakubpetrik/isnotempty
- Owner: jakubpetrik
- Created: 2020-11-19T09:43:09.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2020-11-19T10:16:09.000Z (about 4 years ago)
- Last Synced: 2024-11-19T08:08:05.636Z (2 months ago)
- Language: Swift
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# IsNotEmpty
```swift
import Foundationextension Collection {
var isNotEmpty: Bool { !isEmpty }
}extension Optional where Wrapped: Collection {
var isNotEmpty: Bool {
switch self {
case .none:
return false
case .some(let collection):
return collection.isNotEmpty
}
}
}```