-
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
9c24333
commit 5fb80da
Showing
6 changed files
with
245 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/** | ||
* Utility | ||
* | ||
* Front TS Scrips for multiple tasks | ||
* | ||
* @package kzarshenas/crazyphp | ||
* @author kekefreedog <kevin.zarshenas@gmail.com> | ||
* @copyright 2022-2024 Kévin Zarshenas | ||
*/ | ||
|
||
/** | ||
* Dependances | ||
*/ | ||
|
||
/** | ||
* Boolean | ||
* | ||
* Methods for manage boolean | ||
* | ||
* @package kzarshenas/crazyphp | ||
* @author kekefreedog <kevin.zarshenas@gmail.com> | ||
* @copyright 2022-2024 Kévin Zarshenas | ||
*/ | ||
export default class Boolean { | ||
|
||
/** Public static methods | ||
****************************************************** | ||
*/ | ||
|
||
/** | ||
* Check | ||
* | ||
* Check in given input of any type is true or false | ||
* | ||
* @param input - The input string. | ||
* @returns A string with duplicate lines removed. | ||
*/ | ||
public static check = (value:any):boolean => { | ||
|
||
// Set result | ||
let result:boolean = true; | ||
|
||
// Check for falsy values or specific strings you want to treat as false | ||
if( | ||
value === false || | ||
value === null || | ||
value === undefined || | ||
value === 0 || | ||
value === "" || | ||
value === "false" || | ||
value === "0" || | ||
value === "off" | ||
) | ||
// set result false | ||
result = false; | ||
|
||
// Return result | ||
return result; | ||
|
||
} | ||
|
||
} |
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
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