-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b82c32a
Showing
13 changed files
with
277 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# EditorConfig is awesome: http://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
charset = utf-8 | ||
|
||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"node": true, | ||
"esnext": true, | ||
"bitwise": true, | ||
"curly": true, | ||
"eqeqeq": true, | ||
"eqnull": true, | ||
"immed": true, | ||
"latedef": "nofunc", | ||
"newcap": false, | ||
"noarg": true, | ||
"undef": true, | ||
"strict": false, | ||
"trailing": true, | ||
"smarttabs": true, | ||
"indent": 2, | ||
"white": false, | ||
"quotmark": "single", | ||
"laxbreak": true, | ||
"globals" : { | ||
"describe" : false, | ||
"expect" : false, | ||
"it" : false, | ||
"before" : false, | ||
"beforeEach" : false, | ||
"after" : false, | ||
"afterEach" : false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
language: node_js | ||
before_install: | ||
- "export DISPLAY=:99.0" | ||
- "sh -e /etc/init.d/xvfb start" | ||
node_js: | ||
- '0.10' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Contributing | ||
|
||
- Always add tests | ||
- Update documentation if needed | ||
- run `gulp test` before submitting | ||
|
||
## Bug fixes | ||
|
||
Always add a test for the bug in a separate commit so we can easily cherry pick | ||
it for verification. | ||
|
||
## New features | ||
|
||
It's recommended to open an issue before sending a pull request to avoid | ||
unnecessary work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 hemanth.hm | ||
Copyright (c) 2015 stoeffel | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# fj-apply | ||
|
||
[](https://travis-ci.org/fp-js/fj-apply) [](http://badge.fury.io/js/fj-apply) | ||
> `apply` in functional style! | ||
|
||
## Installation | ||
|
||
`npm install fj-apply --save` | ||
|
||
## Usage | ||
|
||
```js | ||
var apply = require('fj-apply'); | ||
apply(Math.min,[-1,1,2,42,0]); // -1 | ||
``` | ||
|
||
## API | ||
|
||
``` | ||
(*... -> a) -> [*]-> a | ||
``` | ||
|
||
* `fn` (madatory) function to applied. | ||
|
||
* `arg` (madatory) arguments with which `fn` should be called. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var gulp = require('gulp'), | ||
watch = require('gulp-watch'), | ||
run = require('gulp-run'), | ||
sourcemaps = require('gulp-sourcemaps'), | ||
rename = require('gulp-rename'), | ||
mochify = require('mochify'), | ||
to5 = require('gulp-babel'); | ||
|
||
gulp.task('babel', function() { | ||
return gulp.src('**/*.es6') | ||
.pipe(sourcemaps.init()) | ||
.pipe(to5({ | ||
stage: 0, | ||
loose: 'all' | ||
})) | ||
.pipe(sourcemaps.write()) | ||
.pipe(rename({ | ||
extname: '.js' | ||
})) | ||
.pipe(gulp.dest('./')); | ||
}); | ||
|
||
gulp.task('test', ['babel'], function() { | ||
mochify('./test.js', { | ||
reporter: 'tap' | ||
}).bundle(); | ||
}); | ||
|
||
gulp.task('default', ['test'], function() { | ||
gulp.watch('**/*.es6', ['test']); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import {curry2} from 'fj-curry'; | ||
|
||
// Don't use arrow function here. | ||
var _apply = function (fn, args) { | ||
return fn.apply(this, args); | ||
} | ||
|
||
module.exports = curry2(_apply); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "fj-apply", | ||
"version": "0.0.0", | ||
"description": "`apply` in functional style!", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "gulp test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/fp-js/fj-apply.git" | ||
}, | ||
"keywords": [ | ||
"fp-dom", | ||
"fp", | ||
"dom" | ||
], | ||
"contributors": [ | ||
"hemanth.hm <[email protected]> (http://www.h3manth.com)", | ||
"stoeffel <[email protected]> (http://www.schtoeffel.ch)" | ||
], | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/fp-js/fj-apply/issues" | ||
}, | ||
"homepage": "https://github.com/fp-js/fj-apply", | ||
"devDependencies": { | ||
"gulp": "^3.8.10", | ||
"gulp-rename": "^1.2.0", | ||
"gulp-babel": "^5.0.0", | ||
"gulp-run": "^1.6.6", | ||
"gulp-sourcemaps": "^1.3.0", | ||
"gulp-watch": "^4.1.0", | ||
"mochify": "^2.2.0" | ||
}, | ||
"dependencies": { | ||
"fj-curry": "^1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import assert from 'assert'; | ||
import apply from './'; | ||
|
||
it('fj-apply', () => { | ||
assert.equal(apply(Math.min, [-1,1,0,2,42]), -1); | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.