Module: class Disable

A feature flag tool to disable a script or a setting via a URL param
Source:

Methods

(inner) constructor()

initializing Disable constructor
Parameters:
Name Type Description
properties.disable Boolean Default file-based trigger for turning this on or off on instantiation
properties.control String Name given to this calling script so it can be used as a URL param
Source:

(inner) find(findDisabled, param) → {Boolean}

Search all cases of dexter:disable in the search params and match them with the control name.
Parameters:
Name Type Description
findDisabled Array List of disabled params
param String Control name to search for
Source:
Returns:
True or False if it's matched the param
Type
Boolean

(inner) isDisabled() → {Boolean}

Returns a Boolean value for calling scripts to take action to disable a script or setting
Source:
Returns:
Returns this.options.disabled
Type
Boolean

(inner) setStatus(properties, inUrl, hasControl) → {Boolean}

Checks the conditions to which we should disable the feature
Parameters:
Name Type Description
properties Object List of disabled params
inUrl Boolean If this.param was found in the URL
hasControl Boolean if properties.control was properly set
Source:
Returns:
True or False if we're disabling the feature
Type
Boolean