Skip to content

Commit

Permalink
Merge pull request #49643 from callstack-internal/add-babel-plugin-tr…
Browse files Browse the repository at this point in the history
…ansform-object-rest-spread

[NoQA] feat:add babel plugin-transform-object-rest-spread
  • Loading branch information
mountiny authored Sep 24, 2024
2 parents 1df30bc + 434fd68 commit 9e5887d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const defaultPlugins = [

'@babel/transform-runtime',
'@babel/plugin-proposal-class-properties',
['@babel/plugin-transform-object-rest-spread', {useBuiltIns: true, loose: true}],

// We use `@babel/plugin-transform-class-properties` for transforming ReactNative libraries and do not use it for our own
// source code transformation as we do not use class property assignment.
Expand Down
8 changes: 5 additions & 3 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,11 @@ function getAllReportErrors(report: OnyxEntry<Report>, reportActions: OnyxEntry<
reportActionErrors.smartscan = ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('iou.error.genericSmartscanFailureMessage');
}
// All error objects related to the report. Each object in the sources contains error messages keyed by microtime
// Use Object.assign to merge all error objects into one since it is faster and uses less memory than spread operator
// eslint-disable-next-line prefer-object-spread
const errorSources = Object.assign({}, reportErrors, reportErrorFields, reportActionErrors);
const errorSources = {
reportErrors,
...reportErrorFields,
...reportActionErrors,
};

// Combine all error messages keyed by microtime into one object
const errorSourcesArray = Object.values(errorSources ?? {});
Expand Down

0 comments on commit 9e5887d

Please sign in to comment.