JohT / JohT/data-restructor-js

Option to remove empty fields

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
good first issue optimization priority: should (2)
Dominant language
JavaScript
Stars
3
Forks
0
Avg merge
4h 25m
Merged PRs (30d)
13

Description

**Describe the solution you'd like**

To further optimize the output structure and get it as small as possible, these fields could be removed if they are empty by setting a new option:

- Fields that are used for advanced cases:
- category
- type
- Optional fields that may be not used at all:
- abbreviation
- image
- Fields that are only used for grouping and could be removed afterwards:
- index

These mandatory fields shouldn't be affected by the new option. They should remain even if their value is empty:
- displayName
- fieldName
- value

The new option could be placed inside the `Transform` object like `setRemoveDuplicationAboveRecursionDepth` and could be named `setRemoveEmptyOptionalFields(true/false)` whereas the default value should be `false` to not change the current behavior.

**Describe alternatives you've considered**
The removal could be build outside the module but would be less efficient, especially if it would be possible to remove those fields in an earlier stage or even skip them at all.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.