Clone this repo:
  1. 24635df Bump actions/checkout from 4.1.1 to 4.1.2 (#57) by dependabot[bot] · 3 weeks ago master
  2. be88351 Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (#56) by dependabot[bot] · 3 months ago
  3. caea8d4 Require Dart 3.1, bump and fix lints, use switch expressions (#55) by Kevin Moore · 6 months ago
  4. 7f523c3 Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (#53) by dependabot[bot] · 6 months ago
  5. 1ed2941 Bump actions/checkout from 4.1.0 to 4.1.1 (#54) by dependabot[bot] · 6 months ago

Dart Pub Package package publisher

The boolean_selector package defines a simple and flexible syntax for boolean expressions. It can be used for filtering based on user-defined expressions. For example, the test package uses boolean selectors to allow users to define what platforms their tests support.

The boolean selector syntax is based on a simplified version of Dart's expression syntax. Selectors can contain identifiers, parentheses, and boolean operators, including ||, &&, !, and ? :. Any valid Dart identifier is allowed, and identifiers may also contain hyphens. For example, chrome, chrome || content-shell, and js || (vm && linux) are all valid boolean selectors.

A boolean selector is parsed from a string using BooleanSelector.parse(), and evaluated against a set of variables using BooleanSelector.evaluate(). The variables are supplied as a function that takes a variable name and returns its value. For example:

import 'package:boolean_selector/boolean_selector.dart';

void main(List<String> args) {
  var selector = BooleanSelector.parse("(x && y) || z");
  print(selector.evaluate((variable) => args.contains(variable)));
}

Versioning

If this package adds new features to the boolean selector syntax, it will increment its major version number. This ensures that packages that expose the syntax to their users will be able to update their own minor versions, so their users can indicate that they rely on the new syntax.