Skip to content

Commit 5837037

Browse files
authored
Merge pull request #29 from mtsgi/feature/rev
Feature/rev
2 parents c2a36fa + 5d7c714 commit 5837037

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"parser": "babel-eslint",
1111
"extends": "standard",
1212
"rules": {
13-
"semi": "error",
13+
"semi": "warn",
1414
"no-extend-native": "off"
1515
}
1616
}

docs/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ <h3>Array#find_all, select</h3>
183183
<pre>[null, 3, 0, '', undefined, 'Q'].select(x => !x)<span>// => [null, 0, '', undefined]</span></pre>
184184
</section>
185185

186+
<section>
187+
<h3>Array#rev</h3>
188+
<pre>[1, 2, 3, 4].rev<span>// => [4, 3, 2, 1]</span></pre>
189+
</section>
190+
186191
<section>
187192
<h3>Example</h3>
188193
<pre>[3, 3, 4, null].compact.uniq.sum<span>// => 7</span></pre>

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export default class Bury {
4444
max_by (f) { return this.reduce((a, b) => f(a) > f(b) ? a : b) },
4545
find_all (f) { return this.filter(f) },
4646
select (f) { return this.find_all(f) },
47-
count (f) { return this.find_all(f).size }
47+
count (f) { return this.find_all(f).size },
48+
rev () { return [...this].reverse() }
4849
}
4950
}
5051

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "buryjs",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Ruby-like methods for JavaScript.",
55
"module": "index.js",
66
"main": "index.js",

0 commit comments

Comments
 (0)