-
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.
Convert code to es2015, es2016 using babel, swap jshint with eslint, …
…swap testing tools with jest
- Loading branch information
Showing
17 changed files
with
4,970 additions
and
93 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,3 @@ | ||
{ | ||
"presets": ["es2015", "es2016"] | ||
} |
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,10 @@ | ||
# top-most EditorConfig file | ||
root = true | ||
|
||
[*] | ||
insert_final_newline = true | ||
|
||
[*.{js,json}] | ||
charset = utf-8 | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "airbnb", | ||
"parser": "babel-eslint", | ||
"rules": { | ||
"no-underscore-dangle": 0, | ||
"global-require": 0, | ||
"import/no-dynamic-require": 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
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 @@ | ||
src/ |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- "4.1" | ||
- "4.0" | ||
- "4.8" | ||
- "6.11" | ||
sudo: false | ||
script: "npm run-script test-ci" | ||
script: "npm run test-ci" | ||
after_script: "npm install coveralls@2.11.4 && cat ./coverage/lcov.info | coveralls" |
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
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 |
---|---|---|
@@ -1,39 +1,60 @@ | ||
"use strict"; | ||
|
||
const _ = require('lodash'); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
|
||
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); | ||
|
||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
|
||
/** | ||
* HuglaConfig - config module for hugla web framework's node back-end | ||
*/ | ||
class HuglaConfig { | ||
constructor() { | ||
var HuglaConfig = function () { | ||
function HuglaConfig() { | ||
_classCallCheck(this, HuglaConfig); | ||
|
||
this.config = {}; | ||
} | ||
|
||
/** | ||
* Merges given object into config | ||
* @param {object} config Configuration object to merge | ||
*/ | ||
addConfig(config) { | ||
this.config = _.merge(this.config, config); | ||
} | ||
|
||
/** | ||
* Merges env variables into config | ||
*/ | ||
addEnv() { | ||
this.config = _.merge(this.config, process.env); | ||
} | ||
|
||
/** | ||
* Merges given js or json file contents into config | ||
* | ||
* @param {string} path Path to config file (json or js) | ||
*/ | ||
addFile(path) { | ||
const fileConfig = require(path); | ||
this.config = _.merge(this.config, fileConfig); | ||
} | ||
} | ||
_createClass(HuglaConfig, [{ | ||
key: "addConfig", | ||
value: function addConfig(config) { | ||
this.config = Object.assign(this.config, config); | ||
} | ||
|
||
/** | ||
* Merges env variables into config | ||
*/ | ||
|
||
}, { | ||
key: "addEnv", | ||
value: function addEnv() { | ||
this.config = Object.assign(this.config, process.env); | ||
} | ||
|
||
/** | ||
* Merges given js or json file contents into config | ||
* | ||
* @param {string} path Path to config file (json or js) | ||
*/ | ||
|
||
}, { | ||
key: "addFile", | ||
value: function addFile(path) { | ||
var fileConfig = require(path); | ||
this.config = Object.assign(this.config, fileConfig); | ||
} | ||
}]); | ||
|
||
return HuglaConfig; | ||
}(); | ||
|
||
module.exports = HuglaConfig; | ||
exports.default = HuglaConfig; |
Oops, something went wrong.