# Simple Basics Development Tools
### sbdt it´s a very simple module with some very useful functions.

## Installation
This is a Node.js module available through the npm registry.
Before installing, it´s necesary to install Node.js
to install use the npm install command:
```
$ npm install sbdt
```
## Functions
### There are many functions that you can use with this module.
1. [arrayToCSV](#arrayToCSV)
2. [castToBoolean](#castToBoolean)
3. [combineObjects](#combineObjects)
4. [csvToArray](#csvToArray)
5. [isArray](#isArray)
6. [isEmptyArray](#isEmptyArray)
7. [isEmptyObject](#isEmptyObject)
8. [isFunction](#isFunction)
9. [isNotArray](#isNotArray)
10. [isNotEmptyArray](#isNotEmptyArray)
11. [isNotEmptyObject](#isNotEmptyObject)
12. [isNotFunction](#isNotFunction)
13. [isNotNull](#isNotNull)
14. [isNotObject](#isNotObject)
15. [isNotPromise](#isNotPromise)
16. [isNull](#isNull)
17. [isObject](#isObject)
18. [isPromise](#isPromise)
19. [safeExtract](#safeExtract)
20. [safeIsNotNull](#safeIsNotNull)
21. [safeIsNull](#safeIsNull)
22. [isBigInt](#isBigInt)
23. [isBoolean](#isBoolean)
24. [isDate](#isDate)
25. [isNotBigInt](#isNotBigInt)
26. [isNotBoolean](#isNotBoolean)
27. [isNotDate](#isNotDate)
28. [isNotNumber](#isNotNumber)
29. [isNotString](#isNotString)
30. [isNotSymbol](#isNotSymbol)
31. [isNumber](#isNumber)
32. [isString](#isString)
33. [isSymbol](#isSymbol)
34. [toArray](#toArray)
35. [toBoolean](#toBoolean)
36. [toDate](#toDate)
37. [toLowerCase](#toLowerCase)
38. [toNumber](#toNumber)
39. [toString](#toString)
40. [toTimestamp](#toTimestamp)
41. [toTitleCase](#toTitleCase)
42. [toUpperCase](#toUpperCase)
43. [getRandomString](#getRandomString)
44. [getRandomNumberString](#getRandomNumberString)
45. [isUndefined](#isUndefined)
46. [isNotUndefined](#isNotUndefined)

## <a id="arrayToCSV">Arrat To CSV</a>
`arrayToCSV()` Receives an array of either numbers or texts and returns a csv text
```JavaScript
arrayToCSV([1,2,3,4]);              // 1, 2, 3, 4
arrayToCSV(['Hello', 'World']);     // Hello, World
```

## <a id="castToBoolean">Cast To Boolean</a>
`castToBoolean()` cast a variable to boolean
```JavaScript
castToBoolean("true");      // true
castToBoolean("1");         // true
castToBoolean(1);           // true
castToBoolean("false");     // false
castToBoolean("0");         // false
castToBoolean(0);           // false
castToBoolean({});          // false
castToBoolean(undefined);   // false
```

## <a id="combineObjects">Combine Objects</a>
`combineObjects()` Receives a list or lists of objects and combines them
```JavaScript
combineObjects([{a:1,b:2,c:3},{d:4,e:5,f:6}]);          // { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6 }

combineObjects([{a:11,b:12,c:13},{c:14,d:15,e:16}]);    // { a: 11, b: 12, c: 14, d: 15, e: 16 }
```

## <a id="csvToArray">CSV To Array</a>
`csvToArray()` It convert a csv to an array
```JavaScript
csvToArray('1,2,3,4');          // [ '1', '2', '3', '4' ]
csvToArray('Hello,World');      // [ 'Hello', 'World' ]
csvToArray('CSV,|ARRAY','|')    // [ 'CSV,', 'ARRAY' ]
```

## <a id="isArray">Is Array</a>
`isArray()` Evaluate if a value is an array
```JavaScript
isArray([1,2,3,4]);  // true
isArray([]);         // true
isArray({});         // false
isArray(1);          // false
```

## <a id="isEmptyArray">Is Empty Array</a>
`isEmptyArray()` It validate if a variable is an empty array
```JavaScript
isEmptyArray([]);       // true
isEmptyArray([1,2,3]);  // false
```

## <a id="isEmptyObject">Is Empty Object</a>
`isEmptyObject()` it Verify if a variable is an empty object
```JavaScript
isEmptyObject({});      // true
isEmptyObject({a:1});   // false
```

## <a id="isFunction">Is Function</a>
`isFunction()` It validate if a variable is a function
```JavaScript
isFunction(()=>null);   // true
isFunction(1);          // false
```

## <a id="isNotArray">Is Not Array</a>
`isNotArray()` Evaluate if a value is not an array
```JavaScript
isNotArray([]); // false
isNotArray(1);  // true
```

## <a id="isNotEmptyArray">Is Not Empty Array</a>
`isNotEmptyArray()` It validate if a variable isn't an empty array
```JavaScript
isNotEmptyArray([]);        // false
isNotEmptyArray([1,2,3]);   // true
```

## <a id="isNotEmptyObject">Is Not Empty Object</a>
`isNotEmptyObject()` It Verify if a variable is not an empty object
```JavaScript
isNotEmptyObject({});       // false
isNotEmptyObject({a:1});    // true
```

## <a id="isNotFunction">Is Not Function</a>
`isNotFunction()` It validate if a variable isn't a function
```JavaScript
isNotFunction(()=>null);    // false
isNotFunction(1);           // true
```

## <a id="isNotNull">Is Not Null</a>
`isNotNull()` Validates if a variable is not null or undefined
```JavaScript
isNotNull(undefined);   // false
isNotNull(null);        // false
isNotNull(1);           // true
```

## <a id="isNotObject">Is Not Object</a>
`isNotObject()` It validate if a variable isn't an object
```JavaScript
isNotObject({});    // true
isNotObject([]);    // false
```

## <a id="isNotPromise">Is Not Promise</a>
`isNotPromise()` it validates if a variable is not a promise
```JavaScript
isNotPromise(new Promise((resolve)=>resolve(1)));   // false
isNotPromise([]);                                   // true
```

## <a id="isNull">Is Null</a></a>
`isNull()` Validates if a variable is null or undefined
```JavaScript
isNull(undefined);  // true
isNull(null);       // true
isNull(1);          // true
```

## <a id="isObject">Is Object</a>
`isObject()` It validate if a variable is an object
```JavaScript
isObject({});   // true
isObject([]);   // false
```

## <a id="isPromise">Is Promise</a>
`isPromise()` It validates if a variable is a promise
```JavaScript
isPromise(new Promise((resolve)=>resolve(1)));  // true
isPromise([]);                                  // false
```
## <a id="safeExtract">Safe Extract</a>
`safeExtract()` It extract at attribute from a variable if it exists in some "level", it´s a great way to extract if a key exists without throw errors
```JavaScript
const extractor = {a:{parameter: 1}};
safeExtract(extractor, ['a']);              // { parameter: 1 }
safeExtract(extractor, ['b']);              // undefined
safeExtract(extractor, ['a', 'parameter']); // 1
safeExtract(extractor, ['b', 'parameter']); // undefined
```
## <a id="safeIsNotNull">Safe Is Not Null</a>
`safeIsNotNull()` It validate if a variable (object) contains an attribute, it can be in differents "levels"
```JavaScript
const extractor = {a:{parameter: 1}};
safeIsNotNull(extractor, ['a']);                // true
safeIsNotNull(extractor, ['b']);                // false
safeIsNotNull(extractor, ['a', 'parameter']);   // true
safeIsNotNull(extractor, ['b', 'parameter']);   // false
```
## <a id="safeIsNull">Safe Is Null</a>
`safeIsNull()` It validate if a variable (object) not contains an attribute, it can be in differents "levels"
```JavaScript
const extractor = {a:{parameter: 1}};
safeIsNull(extractor, ['a']);               // false
safeIsNull(extractor, ['b']);               // true
safeExtract(extractor, ['a', 'parameter']); // false
safeExtract(extractor, ['b', 'parameter']); // true
```

## <a id="isBigInt">Is Big Int</a>
`isBigInt()` It let you know if a variable is a BigInt
```JavaScript
isBigInt(1n);   // true
isBigInt(1);    // false
```
## <a id="isBoolean">Is Boolean</a>
`isBoolean()` It help you to know if a variable is a boolean
```JavaScript
isBoolean(true);    // true
isBoolean(1);       // false
isBoolean(false);   // true
isBoolean(0);       // false
```
## <a id="isDate">Is Date</a>
`isDate()` It help you to know if a variable is a Date \( Date class \).
```JavaScript
isDate(new Date()); // true
isDate(1);          // false
```
## <a id="isNotBigInt">Is Not Big Int</a>
`isNotBigInt()` It let you know if a variable is not a BigInt.
```JavaScript
isBigInt(1n);   // false
isBigInt(1);    // true
```
## <a id="isNotBoolean">Is Not Boolean</a>
`isNotBoolean()` It help you to know if a variable isn't a boolean.
```JavaScript
isBoolean(true);    // false
isBoolean(1);       // true
isBoolean(false);   // false
isBoolean(0);       // true
```
## <a id="isNotDate">Is Not Date</a>
`isNotDate()` It help you to know if a variable isn't a Date \( Date class \)
```JavaScript
isDate(new Date()); // false
isDate(1);          // true
```

## <a id="isNotNumber">Is Not Number</a>
`isNotNumber()` Help you to know if a variable isn't a number
```JavaScript
isNotNumber(1);     // false
isNotNumber('a');   //  true
```

## <a id="isNotString">Is Not String</a>
`isNotString()` It help you to know if a variable isn't a String
```JavaScript
isNotNumber(1);     // true
isNotNumber('a');   // false
```
## <a id="isNotSymbol">Is Not Symbol</a>
`isNotSymbol()` Help you to know if a variable isn't a symbol
```JavaScript
isNotSymbol(Symbol('id')); // false
isNotSymbol('id');         // true
```

## <a id="isNumber">Is Number</a>
`isNumber()` Help you to know if a variable is a number
```JavaScript
isNumber(1);    // true
isNumber('1');  // false
```
## <a id="isString">Is String</a>
`isString()` It help you to know if a variable is a String
```JavaScript
isString(1);    // false
isString('1');  // true
```
## <a id="isSymbol">Is Symbol</a>
`isSymbol()` Help you to know if a variable is a symbol
```JavaScript
isSymbol(Symbol('id')); // false
isSymbol('id');         // true
```

## <a id="toArray">To Array</a>
`toArray()` Help you to get a array from any type of variable if the variable is an array already it will return the same array
```JavaScript
toArray(1);             // [ 1 ]
toArray('1');           // [ '1' ]
toArray(['1', '2']);    // [ '1', '2' ]
toArray({a:1});         // [ { a: 1 } ]
toArray(undefined);     // []
```

## <a id="toBoolean">To Boolean</a>
`toBoolean()` It cast a variable to boolean
```JavaScript
toBoolean("true");      // true
toBoolean("1");         // true
toBoolean(1);           // true
toBoolean("false");     // false
toBoolean("0");         // false
toBoolean(0);           // false
toBoolean({});          // false
toBoolean(undefined);   // false
```

## <a id="toDate">To Date</a>
`toDate()` Help you to get a Date variable form a string variable
```JavaScript
toDate('07-30-2000');   // 964933200000
```
## <a id="toLowerCase">To Low Case</a>
`toLowerCase()` Help you to convert a string or variable to a lower case string
```JavaScript
toLowerCase('Hello World'); // hello world
toLowerCase('HELLO WORLD'); // hello world
```

## <a id="toNumber">To Number</a>
`toNumber()` Help you to cast a variable to a Number
```JavaScript
toNumber('1231');   // 1231
toNumber('32.12');  // 32.12 
toNumber(1n);       // 1
toNumber(4);        // 4
```

## <a id="toString">To String</a>
`toString()` Cast an any variable to a String
```JavaScript
toString('Hello World');    // "Hello World"
toString(321);              // "321"
toString({a:1});            //  "{\"a\":1}"
toString([1,2,3]);          //  "[1,2,3]"
```

## <a id="toTimestamp">To Timestamp</a>
`toTimestamp()` Help you to cast a variable to a Timestamp number, it can be Date or String
```JavaScript
toTimestamp(new Date());    // 1684000479.627
toTimestamp('01-01-2020');  // 1577858400
```

## <a id="toTitleCase">To Title Case</a>
`toTitleCase()` Help you to cast a variable or a String to a Title case
```JavaScript
toTitleCase('hello world'); // Hello World
toTitleCase('HELLO WORLD'); // Hello World
```

## <a id="toUpperCase">To Upper Case</a>
`toUpperCase()` Help you to cast a variable to a String
```JavaScript
toUpperCase('hello world'); // HELLO WORLD
toUpperCase('Hello World'); // HELLO WORLD
```

## <a id="getRandomString">Get Random String</a>
`getRandomString()` Help you to get a random string with numbers
```JavaScript
getRandomString(4);     // MJWh
getRandomString(10);    // ehQNovk4cI
```

## <a id="getRandomNumberString">Get Random Number String</a>
`getRandomNumberString()` Help you to get a random string of numbers
```JavaScript
getRandomString(4);     // 4761
getRandomString(10);    // 8960631952
```

## <a id="isUndefined">Is Undefined</a>
`isUndefined()` Validates if a variable is undefined
```JavaScript
isUndefined(4);         // false
isUndefined(null);      // false
isUndefined(undefined); // true
```

## <a id="isNotUndefined">Is Not Undefined</a>
`isNotUndefined()` Validates if a variable is not undefined
```JavaScript
isNotUndefined(4);         // true
isNotUndefined(null);      // true
isNotUndefined(undefined); // false
```