-
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
1 parent
cc2e3e9
commit 4a53a44
Showing
5 changed files
with
31 additions
and
37 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
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 was deleted.
Oops, something went wrong.
This file was deleted.
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,29 @@ | ||
/* -------------------- | ||
* pluggi module | ||
* utils | ||
* ------------------*/ | ||
|
||
'use strict'; | ||
|
||
// Exports | ||
|
||
module.exports = { | ||
/** | ||
* Convert snake case to camel case | ||
* e.g. 'my-module-name' -> 'myModuleName' | ||
* @param {string} str - Snake case string | ||
* @returns {string} - Camel case string | ||
*/ | ||
snakeToCamel: function(str) { | ||
return str.replace(/-(.)/g, (m, c) => c.toUpperCase()); // jshint ignore:line | ||
}, | ||
|
||
/** | ||
* Identify if input is an object | ||
* @param {*} obj - Input | ||
* @returns {boolean} - `true` if is an object, `false` if not | ||
*/ | ||
isObject: function(obj) { | ||
return obj !== null && typeof obj == 'object'; | ||
} | ||
}; |