Skip to content

Commit e690efb

Browse files
committed
initial commit
0 parents  commit e690efb

13 files changed

+275
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
charset = utf-8
7+
8+
[*]
9+
end_of_line = lf
10+
insert_final_newline = true
11+
indent_style = space
12+
indent_size = 2

.gitignore

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#### joe made this: https://goel.io/joe
2+
3+
#####=== Node ===#####
4+
5+
# Logs
6+
logs
7+
*.log
8+
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21+
.grunt
22+
23+
# node-waf configuration
24+
.lock-wscript
25+
26+
# Compiled binary addons (http://nodejs.org/api/addons.html)
27+
build/Release
28+
29+
# Dependency directory
30+
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
31+
node_modules
32+
33+
# Debug log from npm
34+
npm-debug.log
35+
36+
#####=== OSX ===#####
37+
.DS_Store
38+
.AppleDouble
39+
.LSOverride
40+
41+
# Icon must end with two \r
42+
Icon
43+
44+
# Thumbnails
45+
._*
46+
47+
# Files that might appear on external disk
48+
.Spotlight-V100
49+
.Trashes
50+
51+
# Directories potentially created on remote AFP share
52+
.AppleDB
53+
.AppleDesktop
54+
Network Trash Folder
55+
Temporary Items
56+
.apdisk
57+

.jshintrc

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"node": true,
3+
"esnext": true,
4+
"bitwise": true,
5+
"curly": true,
6+
"eqeqeq": true,
7+
"eqnull": true,
8+
"immed": true,
9+
"latedef": "nofunc",
10+
"newcap": false,
11+
"noarg": true,
12+
"undef": true,
13+
"strict": false,
14+
"trailing": true,
15+
"smarttabs": true,
16+
"indent": 2,
17+
"white": false,
18+
"quotmark": "single",
19+
"laxbreak": true,
20+
"globals" : {
21+
"describe" : false,
22+
"expect" : false,
23+
"it" : false,
24+
"before" : false,
25+
"beforeEach" : false,
26+
"after" : false,
27+
"afterEach" : false
28+
}
29+
}

.travis.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
language: node_js
2+
before_install:
3+
- "export DISPLAY=:99.0"
4+
- "sh -e /etc/init.d/xvfb start"
5+
node_js:
6+
- '0.10'

CONTRIBUTING.markdown

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Contributing
2+
3+
- Always add tests
4+
- Update documentation if needed
5+
- run `gulp test` before submitting
6+
7+
## Bug fixes
8+
9+
Always add a test for the bug in a separate commit so we can easily cherry pick
10+
it for verification.
11+
12+
## New features
13+
14+
It's recommended to open an issue before sending a pull request to avoid
15+
unnecessary work.

LICENSE

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 hemanth.hm
4+
Copyright (c) 2015 stoeffel
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the "Software"), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in all
14+
copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
SOFTWARE.
23+

README.markdown

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# fj-typeof
2+
3+
[![Build Status](https://travis-ci.org/fp-js/fj-typeof.svg)](https://travis-ci.org/fp-js/fj-typeof) [![npm version](https://badge.fury.io/js/fj-typeof.svg)](http://badge.fury.io/js/fj-typeof)
4+
> FP-style typeof
5+
6+
## Installation
7+
8+
`npm install fj-typeof --save`
9+
10+
## Usage
11+
12+
```js
13+
var typeOf = require('fj-typeof');
14+
15+
typeOf('function', typeOf); // => true
16+
typeOf('string')('foo'); // => true
17+
typeOf('object')({}); // => true
18+
typeOf('undefined')(undefined); // => true
19+
```

gulpfile.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
var gulp = require('gulp'),
2+
watch = require('gulp-watch'),
3+
run = require('gulp-run'),
4+
sourcemaps = require('gulp-sourcemaps'),
5+
rename = require('gulp-rename'),
6+
mochify = require('mochify'),
7+
to5 = require('gulp-6to5');
8+
9+
gulp.task('6to5', function() {
10+
return gulp.src('**/*.es6')
11+
.pipe(sourcemaps.init())
12+
.pipe(to5({
13+
experimental: true,
14+
loose: 'all'
15+
}))
16+
.pipe(sourcemaps.write())
17+
.pipe(rename({
18+
extname: '.js'
19+
}))
20+
.pipe(gulp.dest('./'));
21+
});
22+
23+
gulp.task('test', ['6to5'], function() {
24+
mochify('./test.js', {
25+
reporter: 'tap'
26+
}).bundle();
27+
});
28+
29+
gulp.task('default', ['test'], function() {
30+
gulp.watch('**/*.es6', ['test']);
31+
});

index.es6

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { curry2 } from 'fj-curry';
2+
3+
4+
const _typeof = (type, obj) => typeof obj === type;
5+
6+
export default curry2(_typeof);

index.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"use strict";
2+
3+
var curry2 = require("fj-curry").curry2;
4+
5+
6+
7+
var _typeof = function (type, obj) {
8+
return typeof obj === type;
9+
};
10+
11+
module.exports = curry2(_typeof);

package.json

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "fj-typeof",
3+
"version": "1.0.0",
4+
"description": "FP-style typeof",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "gulp test"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/fp-js/fj-typeof.git"
12+
},
13+
"keywords": [
14+
"fp-dom",
15+
"fp",
16+
"dom"
17+
],
18+
"contributors": [
19+
"hemanth.hm <[email protected]> (http://www.h3manth.com)",
20+
"stoeffel <[email protected]> (http://www.schtoeffel.ch)"
21+
],
22+
"license": "MIT",
23+
"bugs": {
24+
"url": "https://github.com/fp-js/fj-typeof/issues"
25+
},
26+
"homepage": "https://github.com/fp-js/fj-typeof",
27+
"devDependencies": {
28+
"fj-curry": "^1.0.0",
29+
"gulp": "^3.8.10",
30+
"gulp-6to5": "^3.0.0",
31+
"gulp-rename": "^1.2.0",
32+
"gulp-run": "^1.6.6",
33+
"gulp-sourcemaps": "^1.3.0",
34+
"gulp-watch": "^4.1.0",
35+
"mochify": "^2.2.0"
36+
}
37+
}

test.es6

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import assert from 'assert';
2+
import typeOf from './';
3+
4+
5+
it('fj-typeof', () => {
6+
assert.equal(typeof typeOf, 'function');
7+
assert(typeOf('function', typeOf));
8+
assert(typeOf('string')('foo'));
9+
assert(typeOf('object')({}));
10+
assert(typeOf('undefined')(undefined));
11+
});

test.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"use strict";
2+
3+
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
4+
5+
var assert = _interopRequire(require("assert"));
6+
7+
var typeOf = _interopRequire(require("./"));
8+
9+
10+
11+
12+
it("fj-typeof", function () {
13+
assert.equal(typeof typeOf, "function");
14+
assert(typeOf("function", typeOf));
15+
assert(typeOf("string")("foo"));
16+
assert(typeOf("object")({}));
17+
assert(typeOf("undefined")(undefined));
18+
});

0 commit comments

Comments
 (0)