tiny_invariant 1.0.0+2 copy "tiny_invariant: ^1.0.0+2" to clipboard
tiny_invariant: ^1.0.0+2 copied to clipboard

A tiny implementation of the invariant function in Dart.

example/tiny_invariant.dart

import 'package:tiny_invariant/tiny_invariant.dart';

void main() {
  final x = 2;
  final y = 2;
  invariant((y + x) == 3, 'x + y is not 3'); // return exception
}
2
likes
135
pub points
0%
popularity

Publisher

unverified uploader

A tiny implementation of the invariant function in Dart.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

More

Packages that depend on tiny_invariant