js-candy
Some JS syntax-sugar for heavily used expressions
if-exists
The method checks if the variable has a value, essentialy for you to don't use them without it on critical parts, make a cleaner and readable code or/and don't pass a null parameter were it simply doesn't need to be.
Variables
Shortcut for:
variable ? variable : null
Objects
Here's the gold. The method checks if each one of the values exists and returns to you an object with only the values that exists
Usage:
var objectThatIWant = ;
Also, it makes simpler to use the {...object}
ES syntax without having to worry about "falsey" values.
PS: Boolean 'false' values are kept, as they are, in the object (As they are intended to be there).
capital-first
Capitalize the first letter of the string.
The allFirsts parameter
Use the allFirsts parameter if you want to capitalize all the letters after a blank space.
E.g:
; //My String; //My other string; //Another string
Importing to your code
// require module:var capitalFirst = ;var exists = ;// or with ES6 import;;