-
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
eb433f6
commit f601d64
Showing
7 changed files
with
217 additions
and
1 deletion.
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,22 @@ | ||
/** | ||
* Handlebars Comparaison Helpers | ||
* | ||
* @source https://github.com/helpers/handlebars-helpers | ||
* | ||
* @package kzarshenas/crazyphp | ||
* @author kekefreedog <[email protected]> | ||
* @copyright 2022-2023 Kévin Zarshenas | ||
*/ | ||
|
||
/** | ||
* Gt | ||
* | ||
* Block helper that renders a block if a is greater than b. | ||
* If an inverse block is specified it will be rendered when falsy. You may optionally use the compare="" hash argument for the second value. | ||
* | ||
* @param a Value to compare | ||
* @param b Value to compare with | ||
* | ||
* @return boolean | ||
*/ | ||
module.exports = (a, b, options) => (a > b) ? options.fn(this) : options.inverse(this); |
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,25 @@ | ||
/** | ||
* Handlebars Comparaison Helpers | ||
* | ||
* @source https://github.com/helpers/handlebars-helpers | ||
* | ||
* @package kzarshenas/crazyphp | ||
* @author kekefreedog <[email protected]> | ||
* @copyright 2022-2023 Kévin Zarshenas | ||
*/ | ||
|
||
/** | ||
* Gte | ||
* | ||
* Block helper that renders a block if `a` is **greater than or | ||
* equal to** `b`. | ||
* If an inverse block is specified it will be rendered when falsy. | ||
* You may optionally use the `compare=""` hash argument for the | ||
* second value. | ||
* | ||
* @param a Value to compare | ||
* @param b Value to compare with | ||
* | ||
* @return boolean | ||
*/ | ||
module.exports = (a, b, options) => (a >= b) ? options.fn(this) : options.inverse(this); |
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,24 @@ | ||
/** | ||
* Handlebars Comparaison Helpers | ||
* | ||
* @source https://github.com/helpers/handlebars-helpers | ||
* | ||
* @package kzarshenas/crazyphp | ||
* @author kekefreedog <[email protected]> | ||
* @copyright 2022-2023 Kévin Zarshenas | ||
*/ | ||
|
||
/** | ||
* Lt | ||
* | ||
* Block helper that renders a block if `a` is **less than** `b`. | ||
* If an inverse block is specified it will be rendered when falsy. | ||
* You may optionally use the `compare=""` hash argument for the | ||
* second value. | ||
* | ||
* @param a Value to compare | ||
* @param b Value to compare with | ||
* | ||
* @return boolean | ||
*/ | ||
module.exports = (a, b, options) => (a < b) ? options.fn(this) : options.inverse(this); |
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,25 @@ | ||
/** | ||
* Handlebars Comparaison Helpers | ||
* | ||
* @source https://github.com/helpers/handlebars-helpers | ||
* | ||
* @package kzarshenas/crazyphp | ||
* @author kekefreedog <[email protected]> | ||
* @copyright 2022-2023 Kévin Zarshenas | ||
*/ | ||
|
||
/** | ||
* Lte | ||
* | ||
* Block helper that renders a block if `a` is **less than or | ||
* equal to** `b`. | ||
* If an inverse block is specified it will be rendered when falsy. | ||
* You may optionally use the `compare=""` hash argument for the | ||
* second value. | ||
* | ||
* @param a Value to compare | ||
* @param b Value to compare with | ||
* | ||
* @return boolean | ||
*/ | ||
module.exports = (a, b, options) => (a <= b) ? options.fn(this) : options.inverse(this); |
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,20 @@ | ||
/** | ||
* Handlebars String Helpers | ||
* | ||
* @source https://github.com/helpers/handlebars-helpers | ||
* | ||
* @package kzarshenas/crazyphp | ||
* @author kekefreedog <[email protected]> | ||
* @copyright 2022-2023 Kévin Zarshenas | ||
*/ | ||
|
||
/** | ||
* Replace | ||
* | ||
* Replace all occurrences of substring `a` with substring `b`. | ||
* | ||
* @param a Object to stringify | ||
* | ||
* @return string | ||
*/ | ||
module.exports = (str, a, b, options) => (typeof str === "string" && typeof a === "string" && typeof b === "string") ? str.split(a).join(b) : str; |
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