tsv2-library 1.0.61-alpha.104 → 1.0.61-alpha.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,4 @@
1
1
  import { FetchResponse } from '../components/v2/DataTable/DataTable.vue.d';
2
- import { ChangelogObject } from '../types/changelog.type';
3
2
  /**
4
3
  * Format the response data from the API to display in the changelog table.
5
4
  * This function formats the date and currency fields in the response data.
@@ -13,7 +12,7 @@ export declare const formatLogResponseData: (data: {
13
12
  data: Record<string, unknown>[];
14
13
  totalRecords?: number | undefined;
15
14
  };
16
- }, object: ChangelogObject) => FetchResponse;
15
+ }) => FetchResponse;
17
16
  /**
18
17
  * Checks if a given value is a valid ISO datetime string.
19
18
  *
@@ -46,6 +45,7 @@ export declare const formatDateValue: (value?: string, withTime?: boolean) => st
46
45
  * @returns {boolean} - `true` if the value is a valid JSON string that contains the 'dataType' key, `false` otherwise.
47
46
  */
48
47
  export declare const hasDataType: (value?: unknown) => boolean;
48
+ export declare const isCurrency: (value?: unknown) => boolean;
49
49
  /**
50
50
  * Formats the 'newValue' and 'oldValue' properties of a given object from ISO datetime strings into human-readable formats.
51
51
  * If the input values are not valid ISO datetime strings, they are left unchanged.
@@ -13179,7 +13179,7 @@ const buildBodyParams = (params) => {
13179
13179
  });
13180
13180
  return result;
13181
13181
  };
13182
- const formatLogResponseData = (data30, object) => {
13182
+ const formatLogResponseData = (data30) => {
13183
13183
  var _a, _b;
13184
13184
  return {
13185
13185
  data: (((_a = data30.data) == null ? void 0 : _a.data) ?? []).map((d) => {
@@ -13190,7 +13190,7 @@ const formatLogResponseData = (data30, object) => {
13190
13190
  if (values.some(hasDataType)) {
13191
13191
  formatDateFieldFromJson(d);
13192
13192
  }
13193
- if (["Asset", "Asset Purchase"].includes(object)) {
13193
+ if (values.some(isCurrency)) {
13194
13194
  d.oldValue = formatCurrencyField(d.oldValue);
13195
13195
  d.newValue = formatCurrencyField(d.newValue);
13196
13196
  }
@@ -13223,6 +13223,7 @@ const formatDateValue = (value, withTime) => {
13223
13223
  return formatDate(value, withTime);
13224
13224
  };
13225
13225
  const hasDataType = (value) => typeof value === "string" && isValidJSONString(value) && value.includes("dataType");
13226
+ const isCurrency = (value) => typeof value === "string" && isValidJSONString(value) && value.includes("currency");
13226
13227
  const formatDateTimeField = (d) => {
13227
13228
  d.newValue = formatDateValue(d.newValue, true);
13228
13229
  d.oldValue = formatDateValue(d.oldValue, true);