-
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
b7ad2e4
commit 09282ee
Showing
4 changed files
with
90 additions
and
0 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,32 @@ | ||
/** | ||
* Handlebars Array Helpers | ||
* | ||
* @source https://github.com/helpers/handlebars-helpers | ||
* | ||
* @package kzarshenas/crazyphp | ||
* @author kekefreedog <[email protected]> | ||
* @copyright 2022-2023 Kévin Zarshenas | ||
*/ | ||
|
||
/** | ||
* Length | ||
* | ||
* Returns the length of the given string or array. | ||
* | ||
* @param any value | ||
* @param Object options | ||
* | ||
* @return number | ||
*/ | ||
module.exports = (value, options) => { | ||
|
||
// Check if array or string | ||
if(typeof value === 'number') | ||
|
||
// Return lenght | ||
return Math.round(value); | ||
|
||
// Return 0 | ||
return value; | ||
|
||
} |
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