Updates
This commit is contained in:
@@ -6,7 +6,7 @@ import _ from "lodash";
|
||||
* @description this function takes in a text(or number) and returns a sanitized
|
||||
* text, usually without spaces
|
||||
*/
|
||||
function sanitizeSql(text: any, spaces: boolean, regex?: RegExp | null): any {
|
||||
function sanitizeSql(text: any, spaces?: boolean, regex?: RegExp | null): any {
|
||||
if (!text) return "";
|
||||
if (typeof text == "number" || typeof text == "boolean") return text;
|
||||
if (typeof text == "string" && !text?.toString()?.match(/./)) return "";
|
||||
@@ -55,7 +55,7 @@ function sanitizeSql(text: any, spaces: boolean, regex?: RegExp | null): any {
|
||||
*
|
||||
* @returns {object}
|
||||
*/
|
||||
function sanitizeObjects(object: any, spaces: boolean): object {
|
||||
function sanitizeObjects(object: any, spaces?: boolean): object {
|
||||
/** @type {any} */
|
||||
let objectUpdated: any = { ...object };
|
||||
const keys = Object.keys(objectUpdated);
|
||||
@@ -92,7 +92,7 @@ function sanitizeObjects(object: any, spaces: boolean): object {
|
||||
*/
|
||||
function sanitizeArrays(
|
||||
array: any[],
|
||||
spaces: boolean
|
||||
spaces?: boolean
|
||||
): string[] | number[] | object[] {
|
||||
let arrayUpdated = _.cloneDeep(array);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user