Skip to content

Commit

Permalink
Merge pull request #29 from mtsgi/feature/rev
Browse files Browse the repository at this point in the history
Feature/rev
  • Loading branch information
mtsgi committed Jun 28, 2021
2 parents c2a36fa + 5d7c714 commit 5837037
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -10,7 +10,7 @@
"parser": "babel-eslint",
"extends": "standard",
"rules": {
"semi": "error",
"semi": "warn",
"no-extend-native": "off"
}
}
5 changes: 5 additions & 0 deletions docs/index.html
Expand Up @@ -183,6 +183,11 @@ <h3>Array#find_all, select</h3>
<pre>[null, 3, 0, '', undefined, 'Q'].select(x => !x)<span>// => [null, 0, '', undefined]</span></pre>
</section>

<section>
<h3>Array#rev</h3>
<pre>[1, 2, 3, 4].rev<span>// => [4, 3, 2, 1]</span></pre>
</section>

<section>
<h3>Example</h3>
<pre>[3, 3, 4, null].compact.uniq.sum<span>// => 7</span></pre>
Expand Down
3 changes: 2 additions & 1 deletion index.js
Expand Up @@ -44,7 +44,8 @@ export default class Bury {
max_by (f) { return this.reduce((a, b) => f(a) > f(b) ? a : b) },
find_all (f) { return this.filter(f) },
select (f) { return this.find_all(f) },
count (f) { return this.find_all(f).size }
count (f) { return this.find_all(f).size },
rev () { return [...this].reverse() }
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "buryjs",
"version": "0.4.0",
"version": "0.4.1",
"description": "Ruby-like methods for JavaScript.",
"module": "index.js",
"main": "index.js",
Expand Down

0 comments on commit 5837037

Please sign in to comment.