Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(finance): simplify maskedNumber implementation #2493

Merged
merged 6 commits into from
Oct 28, 2023

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Oct 22, 2023

let template = '';

for (let i = 0; i < length; i++) {
  template = `${template}#`;
}

can be reduced to:

let template = '#'.repeat(length);

That in combination with the transformation:

let template = '#'.repeat(length);
...
template = this.faker.helpers.replaceSymbolWithNumber(template);

can be reduced to:

let template = this.faker.string.numeric({ length });

@ST-DDT ST-DDT added p: 1-normal Nothing urgent c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs m: finance Something is referring to the finance module labels Oct 22, 2023
@ST-DDT ST-DDT added this to the vAnytime milestone Oct 22, 2023
@ST-DDT ST-DDT requested review from a team October 22, 2023 13:42
@ST-DDT ST-DDT self-assigned this Oct 22, 2023
@codecov
Copy link

codecov bot commented Oct 22, 2023

Codecov Report

Merging #2493 (f763eff) into next (fdafaa4) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #2493      +/-   ##
==========================================
- Coverage   99.58%   99.58%   -0.01%     
==========================================
  Files        2823     2823              
  Lines      255503   255497       -6     
  Branches     1104     1100       -4     
==========================================
- Hits       254452   254445       -7     
- Misses       1023     1024       +1     
  Partials       28       28              
Files Coverage Δ
src/modules/finance/index.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@ST-DDT ST-DDT enabled auto-merge (squash) October 28, 2023 20:07
@ST-DDT ST-DDT merged commit 3ab23b5 into next Oct 28, 2023
20 checks passed
@ST-DDT ST-DDT deleted the refactor/finance/maskedNumber branch October 28, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs m: finance Something is referring to the finance module p: 1-normal Nothing urgent
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants