mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-28 15:27:43 +00:00
Replace all the process_value
functions with a helper from utilities. Hide creative tags on the channel page.
This commit is contained in:
parent
7d35b5c8c3
commit
91051d2a11
15 changed files with 197 additions and 339 deletions
|
@ -328,9 +328,13 @@ module.exports = FFZ.utils = {
|
|||
|
||||
// Other Stuff
|
||||
|
||||
process_int: function(default_value) {
|
||||
process_int: function(default_value, false_value, true_value) {
|
||||
return function(val) {
|
||||
if ( typeof val === "string" ) {
|
||||
if ( val === false && false_value !== undefined )
|
||||
val = false_value;
|
||||
else if ( val === true && true_value !== undefined )
|
||||
val = true_value;
|
||||
else if ( typeof val === "string" ) {
|
||||
val = parseInt(val);
|
||||
if ( isNaN(val) || ! isFinite(val) )
|
||||
val = default_value;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue