Skip to content

Commit

Permalink
remove fixed. release 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
webNeat committed Jul 17, 2018
1 parent 8e74c6f commit 24fea94
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ composer.lock
*.sublime-*
/about
/node_modules
build
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
[![Build Status](https://travis-ci.org/tarsana/functional.svg?branch=master)](https://travis-ci.org/tarsana/functional)
[![Coverage Status](https://coveralls.io/repos/github/tarsana/functional/badge.svg?branch=master)](https://coveralls.io/github/tarsana/functional?branch=master)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/tarsana/functional/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/tarsana/functional/?branch=master)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/webneat)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://github.com/tarsana/functional/blob/master/LICENSE)

Functional programming library for Tarsana
Functional programming library for PHP.

# Table of Contents

Expand Down Expand Up @@ -181,6 +182,10 @@ Please consider reading the [Contribution Guide](https://github.com/tarsana/func

# Changes Log

**Version 2.2.1**

- Bug fixed on `remove`.

**Version 2.2.0**

- [compose](https://github.com/tarsana/functional/blob/master/docs/functions.md#compose) function added as requested [here](https://github.com/tarsana/functional/issues/4).
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tarsana/functional",
"description": "functional programming library for Tarsana",
"description": "functional programming library for PHP",
"type": "library",
"license": "MIT",
"authors": [
Expand Down
1 change: 1 addition & 0 deletions docs/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ F\remove(-1, $items); //=> ['Foo', 'Bar']
F\remove(5, $items); //=> []
F\remove(6, 'Hello World'); //=> 'World'
F\remove(-6, 'Hello World'); //=> 'Hello'
F\remove(3, 'a'); //=> ''
```

# removeWhile
Expand Down
104 changes: 104 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/list.php
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ function takeLastUntil() {
* F\remove(5, $items); //=> []
* F\remove(6, 'Hello World'); //=> 'World'
* F\remove(-6, 'Hello World'); //=> 'Hello'
* F\remove(3, 'a'); //=> ''
* ```
*
* @stream
Expand All @@ -702,10 +703,9 @@ function takeLastUntil() {
function remove() {
static $remove = false;
$remove = $remove ?: curry(function($count, $list) {
// ...
$length = length($list);
if ($count > $length || $count < -$length)
return [];
return is_string($list) ? '' : [];
$count = ($count > 0)
? $count - $length
: $count + $length;
Expand Down
1 change: 1 addition & 0 deletions tests/ListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public function test_remove() {
$this->assertEquals([], F\remove(5, $items));
$this->assertEquals('World', F\remove(6, 'Hello World'));
$this->assertEquals('Hello', F\remove(-6, 'Hello World'));
$this->assertEquals('', F\remove(3, 'a'));
}

public function test_removeWhile() {
Expand Down

0 comments on commit 24fea94

Please sign in to comment.