Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for es6 workflow #62

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
es6
8 changes: 4 additions & 4 deletions and.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

/**
* @module 101/and
*/
Expand All @@ -9,8 +11,6 @@
* @param {*} b - any value
* @return {*} a && b
*/
module.exports = and;

function and (a, b) {
module.exports = function (a, b) {
return a && b;
}
};
12 changes: 12 additions & 0 deletions es6/and.es6
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @module 101/and
*/

/**
* Functional version of &&
* @function module:101/and
* @param {*} a - any value
* @param {*} b - any value
* @return {*} a && b
*/
export default (a, b) => a && b;
13 changes: 13 additions & 0 deletions es6/or.es6
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* @module 101/or
*/

/**
* Functional version of ||
* @function module:101/or
* @param {*} a - any value
* @param {*} b - any value
* @return {*} a || b
*/

export default (a, b) => a || b;
8 changes: 4 additions & 4 deletions or.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"use strict";

/**
* @module 101/or
*/
Expand All @@ -10,8 +12,6 @@
* @return {*} a || b
*/

module.exports = or;

function or (a, b) {
module.exports = function (a, b) {
return a || b;
}
};
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"description": "common javascript utils that can be required selectively that assume es5+",
"main": "index.js",
"scripts": {
"test": "lab -c -t 100 test",
"test-watch": "nodemon --exec lab -c test"
"test": "npm run-script to5; lab -c -t 100 test",
"test-watch": "npm run-script to5; nodemon --exec lab -c test",
"to5": "babel es6/*.es6 --out-dir ./; mv es6/*.js ./"
},
"repository": {
"type": "git",
Expand All @@ -30,6 +31,7 @@
},
"homepage": "https://github.com/tjmehta/101",
"devDependencies": {
"babel": "^4.0.1",
"coveralls": "^2.11.2",
"lab": "^4.6.2"
},
Expand Down