Skip to content

Commit

Permalink
Bump to 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
simc committed Nov 29, 2021
1 parent 4dca258 commit 4d3102f
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 59 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.0.0
- Promote to stable version
- Remove deprecated extensions

## 0.8.0

- [PR-136](https://github.com/leisim/dartx/pull/136) New: Multiple extensions for `Map`. `all()`, `any()`, `count()`, `filter()`, `filterKeys()`, `filterNot`, `filterValues`, `getOrElse()`, `mapEntries()`, `mapKeys()`, `mapValues()`, `maxBy()`, `maxWith()`, `minBy()`, `minWith`, `none()`, `toList()`, `toMap()`, `orEmpty()`
Expand Down
22 changes: 0 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,6 @@ final word = 'abcd'.capitalize(); // Abcd
final anotherWord = 'Abcd'.capitalize(); // Abcd
```

### .chars - DEPRECATED

Use `.characters` from the official characters package.

Get a list of single character strings from a string. Supports emojis.

```dart
final chars = 'family👨‍👨‍👧‍👦'.chars; // ['f', 'a', 'm', 'i', 'l', 'y', '👨‍👨‍👧‍👦']
```

### .decapitalize

Returns a copy of the string having its first letter lowercased, or the original string, if it's empty or already starts with a lower case letter.
Expand Down Expand Up @@ -366,18 +356,6 @@ for (final i in 10.rangeTo(2).step(2)) {

## Function

### .invoke() - DEPRECATED

Use `call()` instead. This is very useful for `null` checks.

```dart
final func = (String value) {
print(value);
}
func?.call('hello world');
```

### .partial(), .partial2() ...

Applies some of the required arguments to a function and returns a function which takes the remaining arguments.
Expand Down
6 changes: 0 additions & 6 deletions lib/src/function.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ typedef Function2<A, B, R> = R Function(A a, B b);
typedef Function3<A, B, C, R> = R Function(A a, B b, C c);
typedef Function4<A, B, C, D, R> = R Function(A a, B b, C c, D d);

extension Function0InvokeExtension<R> on Function0<R> {
/// Invokes this function and returns it's return value.
@Deprecated('Use `call()`')
R invoke() => this();
}

extension Function1InvokeExtensions<A, R> on Function1<A, R> {
/// Invokes this function and returns it's return value.
R invoke(A first) => this(first);
Expand Down
12 changes: 0 additions & 12 deletions lib/src/string.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@ part of dartx;
const _ascii = 0x007f;
const _latin1 = 0x00ff;

extension StringCharsExtension on String {
/// The characters of a string.
///
/// A character is a Unicode Grapheme cluster represented by a substring of
/// the original string.
///
/// Please use [StringCharacters].characters
/// https://github.com/dart-lang/characters/blob/10527437926f1b454edf9912fe700aa2506b1c3d/lib/src/extensions.dart#L9
@Deprecated('Use .characters from the official characters package')
Iterable<String> get chars => characters.Characters(this);
}

extension StringCapitalizeExtension on String {
/// Returns a copy of this string having its first letter uppercased, or the
/// original string, if it's empty or already starts with an upper case
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dartx
description: Superpowers for Dart. Collection of useful static extension methods.
version: 0.8.0
version: 1.0.0
homepage: https://github.com/leisim/dartx

environment:
Expand Down
9 changes: 0 additions & 9 deletions test/function_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ import 'package:test/test.dart';

void main() {
group('Function', () {
group('Function0X', () {
final func = () => 5;

test('.invoke', () {
// ignore: deprecated_member_use_from_same_package
expect(func.invoke(), 5);
});
});

group('Function1X', () {
final func = (String s) => s;

Expand Down
9 changes: 0 additions & 9 deletions test/string_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ import 'package:test/test.dart';

void main() {
group('StringX', () {
test('.chars', () {
// ignore: deprecated_member_use_from_same_package
expect('test12'.chars, ['t', 'e', 's', 't', '1', '2']);
expect('test12'.characters, ['t', 'e', 's', 't', '1', '2']);
// ignore: deprecated_member_use_from_same_package
expect('ഐ⌛酪Б👨‍👨‍👧‍👦'.chars, ['ഐ', '⌛', '酪', 'Б', '👨‍👨‍👧‍👦']);
expect('ഐ⌛酪Б👨‍👨‍👧‍👦'.characters, ['ഐ', '⌛', '酪', 'Б', '👨‍👨‍👧‍👦']);
});

test('.capitalize()', () {
expect(''.capitalize(), '');
expect('123'.capitalize(), '123');
Expand Down

0 comments on commit 4d3102f

Please sign in to comment.