Swiftpack.co -  philprime/Phrase as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
philprime/Phrase
Boolean expression evaluation in Swift
.package(url: "https://github.com/philprime/Phrase.git", from: "0.0.4")

Phrase

CI Documentation codecov

Boolean expression evaluation purely written in Swift for macOS & Linux without any dependencies.

Usage

let expression = try Phrase("list != nil && list.count > 3")
expression.context = [
   "list": [1,2,3,4,5]
]
if try expression.evaluate() {
   ...
} else {
   ...
}

Operators

Prefix-Operators

Operators which require a succeeding node

  • !

Infix-Operators

Operators which require a preceding and a succeeding node

Logical:
  • &&
  • ||
Equaltiy:
  • ==
  • !=
Comparing:
  • >
  • >=
  • <
  • <=

Postfix-Operators

Operators which require a preceeding node

  • count

returns the element count of the preceeding array node

GitHub

link
Stars: 0
Last commit: 2 weeks ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Related Packages

Release Notes

0.0.4
52 weeks ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API