Skip to content

Commit fce9e2c

Browse files
committed
first commit
0 parents  commit fce9e2c

File tree

7 files changed

+101
-0
lines changed

7 files changed

+101
-0
lines changed

.editorconfig

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# editorconfig.org
2+
root = true
3+
4+
[*]
5+
end_of_line = lf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 4

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
node_modules

.jscsrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"validateIndentation": 4
3+
}

.jshintrc

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
// Enforcing options
3+
"eqeqeq": false,
4+
"forin": true,
5+
"indent": 4,
6+
"noarg": true,
7+
"undef": true,
8+
"unused": true,
9+
"trailing": true,
10+
"evil": true,
11+
"laxcomma": true,
12+
13+
// Relaxing options
14+
"onevar": false,
15+
"asi": false,
16+
"eqnull": true,
17+
"expr": false,
18+
"loopfunc": true,
19+
"sub": true,
20+
"browser": true,
21+
"node": true,
22+
"globals": {
23+
"self": true,
24+
"define": true,
25+
"describe": true,
26+
"context": true,
27+
"it": true
28+
}
29+
}

README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# async.util.filter
2+
3+
![Last version](https://img.shields.io/github/tag/async-js/filter.svg?style=flat-square)
4+
[![Build Status](http://img.shields.io/travis/async-js/filter/master.svg?style=flat-square)](https://travis-ci.org/async-js/filter)
5+
[![Dependency status](http://img.shields.io/david/async-js/filter.svg?style=flat-square)](https://david-dm.org/async-js/filter)
6+
[![Dev Dependencies Status](http://img.shields.io/david/dev/async-js/filter.svg?style=flat-square)](https://david-dm.org/async-js/filter#info=devDependencies)
7+
[![NPM Status](http://img.shields.io/npm/dm/filter.svg?style=flat-square)](https://www.npmjs.org/package/filter)
8+
[![Donate](https://img.shields.io/badge/donate-paypal-blue.svg?style=flat-square)](https://paypal.me/kikobeats)
9+
10+
> async filter helper method as module.
11+
12+
This module is used internally by [async](https://github.com/async-js/async).
13+
14+
## License
15+
16+
MIT © [async-js](https://github.com/async-js)

index.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
'use strict';
2+
3+
var map = require('async.util.map');
4+
5+
module.exports = function filter(eachfn, arr, iterator, cb) {
6+
var results = [];
7+
eachfn(arr, function(x, index, cb) {
8+
iterator(x, function(v) {
9+
if (v) {
10+
results.push({
11+
index: index,
12+
value: x
13+
});
14+
}
15+
cb();
16+
});
17+
}, function() {
18+
cb(map(results.sort(function(a, b) {
19+
return a.index - b.index;
20+
}), function(x) {
21+
return x.value;
22+
}));
23+
});
24+
};

package.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "async.util.filter",
3+
"description": "async filterhelper method as module.",
4+
"main": "./index.js",
5+
"repository": "async-js/async.util",
6+
"author": {
7+
"email": "josefrancisco.verdu@gmail.com",
8+
"name": "Kiko Beats",
9+
"url": "https://github.com/Kikobeats"
10+
},
11+
"version": "0.3.0",
12+
"license": "MIT",
13+
"keywords": [
14+
"async.util",
15+
"filter"
16+
]
17+
}

0 commit comments

Comments
 (0)