|
|
@ -167,6 +167,16 @@ export const find = (arr, test) => { |
|
|
return result; |
|
|
return result; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
export const escape = (str = '') => { |
|
|
|
|
|
return `${str}` |
|
|
|
|
|
.replace(/&/g, '&') |
|
|
|
|
|
.replace(/</g, '<') |
|
|
|
|
|
.replace(/>/g, '>') |
|
|
|
|
|
.replace(/"/g, '"') |
|
|
|
|
|
.replace(/'/g, ''') |
|
|
|
|
|
.replace(/`/g, '`'); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Ensure to fetch the model from the input argument |
|
|
* Ensure to fetch the model from the input argument |
|
|
* @param {HTMLElement|Component} el Component or HTML element |
|
|
* @param {HTMLElement|Component} el Component or HTML element |
|
|
|