Something went wrong. Try again.
A comprehensive digital solution dedicated to bridging the gap between those offering services and those seeking them, providing a centrali… gigwork.co.in
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041
// Remove fields from objectexport const removeFields = (obj: any, fields: string[]) => { if (Array.isArray(obj)) { return obj.map(item => removeFields(item, fields)); } else if (obj && typeof obj === 'object') { return Object.keys(obj).reduce((newObj, key) => { if (!fields.includes(key)) { newObj[key] = removeFields(obj[key], fields); } return newObj; }, {} as any); } return obj;};
// Secure text by replacing characters with *export const secureText = (text: string, start: number) => { const end = text.length - 4; return text.split('').map((char, index) => { if (index >= start && index < end) { return '*'; } return char; }).join('');};
// Clean the content by trimming whitespace and normalizing line breaksexport const cleanUpContent = (content: string): string => { return content .trim() .replace(/\r\n|\r|\n/g, " ");};