Skip to Content
⚠️Active Development Notice: TimeTiles is under active development. Information may be placeholder content or not up-to-date.

web


web / lib/jobs/utils/data-parsing

lib/jobs/utils/data-parsing

Provides utility functions for parsing data from CSV and Excel files.

This module contains functions to read and parse different file formats into a consistent JSON-like structure (an array of objects). It also includes safe object property accessors to prevent prototype pollution vulnerabilities.

Functions

setObjectProperty()

setObjectProperty(obj, key, value): void

Parameters

obj

Record<string, unknown>

key

string

value

unknown

Returns

void


getObjectProperty()

getObjectProperty(obj, key): unknown

Parameters

obj

Record<string, unknown>

key

string

Returns

unknown


parseCSVFile()

parseCSVFile(filePath, logger): Record<string, unknown>[]

Parameters

filePath

string

logger

Logger<never>

Returns

Record<string, unknown>[]


parseExcelFile()

parseExcelFile(filePath, logger): Record<string, unknown>[]

Parameters

filePath

string

logger

Logger<never>

Returns

Record<string, unknown>[]


parseFileByType()

parseFileByType(filePath, fileType, logger): Record<string, unknown>[]

Parameters

filePath

string

fileType

"csv" | "xlsx"

logger

Logger<never>

Returns

Record<string, unknown>[]

Last updated on