File

src/utils/Utils.ts

Index

Properties
Methods

Properties

Static browserShortcutsOverridden
Type : Keys[]
Default value : [ Keys.control + Keys.k, Keys.control + Keys.shift + Keys.p ]

List of browser shortcuts that need to be overridden.

Methods

Static fromHtmlEntities
fromHtmlEntities(text: any)
Parameters :
Name Type Optional
text any No
Returns : any
Static isDefaultValue
isDefaultValue(property: any, defaultValue: any)

Returns the default value of the property if it is null or undefined.

Parameters :
Name Type Optional Description
property any No

property to be evaluated.

defaultValue any No

default value of the property.

Returns : any
Static preventDefaultBrowserShortcuts
preventDefaultBrowserShortcuts(event: any)

Calls the event preventDefault if the key combination is a browser shortcut.

Parameters :
Name Type Optional
event any No
Returns : void
Static preventPropagation
preventPropagation(event: any)

Method prevents propagation of the same event from being called outside. Use shouldAllowPreventDefault to enable the preventDefault behavior

Parameters :
Name Type Optional Description
event any No

object with the information Use shouldAllowPreventDefault to enable the preventDefault behavior

Returns : void
Private Static regexReDosReplaceMaskRules
regexReDosReplaceMaskRules(regex: any)

Replace mask rules for respective regex representation.

Parameters :
Name Type Optional Description
regex any No

Mask regex to be replaced with regex representation of mask rules.

Returns : any
Static regexReDosValidation
regexReDosValidation(regex: any, isMask: boolean)

Validates if regex could produce a ReDoS vulnerability and generate performance degradation.

Parameters :
Name Type Optional Description
regex any No

Regular expression to be validated of DoS could be produced.

isMask boolean No

Boolean value used to apply a mask rules replaced to represent a regex.

Returns : void
Static removeLabelSpecial
removeLabelSpecial(value: string, underline?: boolean)

Removes ampersand entiti

Parameters :
Name Type Optional
value string No
underline boolean Yes
Returns : string

{string}

Static replaceNewLines
replaceNewLines(text: any)

Return a new string where the new line characters are replaced with the
HTML element.

Parameters :
Name Type Optional Description
text any No

string with values to replace

Returns : any

new string with replaced characters

Static setTimeoutFunctionExecution
setTimeoutFunctionExecution(functionToExecute: () => void, timeout: number)

Executes the given function inside the setTimeout. You can specify the timeout value, the default is 0.

Parameters :
Name Type Optional Default value
functionToExecute function No
timeout number No 0
Returns : any

Returns the timeoutId.

Static toHtmlEntities
toHtmlEntities(text: any)

Return a new string where the white space and < and > is replaced for the html entities

Parameters :
Name Type Optional Description
text any No

string with values to replace

Returns : any

new string with entities

Static validateTabOrder
validateTabOrder(model: any, tabIndexInput: any)

Validates TabIndex model property and tabindex input to determine TabOrder value returns -1 if both values are undefined

Parameters :
Name Type Optional Description
model any No

Component model

tabIndexInput any No

Tab index Angular input

Returns : number

tab order if it exists in model or angular input, returns -1 if both values are undefined

results matching ""

    No results matching ""