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): deprecate maskedNumber for removal #3201

Merged
merged 10 commits into from
Nov 12, 2024

Conversation

ST-DDT
Copy link
Member

@ST-DDT ST-DDT commented Oct 20, 2024

Fixes #2504


The masking of important information is usually implemented in the application itself, so there is no need for us to provide a method ourselves.
This is especially true, since the method has lots of options and would need even more to actually represent real masked data.

As a workaround, you can use the following:

  • faker.finance.creditCardNumber().replaceAll(/(?<=.{4}).(?=.{2})/g, '*')
  • faker.finance.iban().replaceAll(/(?<=.{4})\w(?=.{2})/g, '*')

Popularity-Data from #3215

  • faker.finance.maskedNumber: 59

@ST-DDT ST-DDT added c: chore PR that doesn't affect the runtime behavior p: 1-normal Nothing urgent m: finance Something is referring to the finance module deprecation A deprecation was made in the PR labels Oct 20, 2024
@ST-DDT ST-DDT added this to the v9.x milestone Oct 20, 2024
@ST-DDT ST-DDT requested review from a team October 20, 2024 17:22
@ST-DDT ST-DDT self-assigned this Oct 20, 2024
Copy link

netlify bot commented Oct 20, 2024

Deploy Preview for fakerjs ready!

Name Link
🔨 Latest commit 2f7b0aa
🔍 Latest deploy log https://app.netlify.com/sites/fakerjs/deploys/67330bd2b7589d00084ebac7
😎 Deploy Preview https://deploy-preview-3201.fakerjs.dev
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Oct 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.96%. Comparing base (9abaed1) to head (2f7b0aa).
Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next    #3201      +/-   ##
==========================================
- Coverage   99.96%   99.96%   -0.01%     
==========================================
  Files        2805     2805              
  Lines      217129   217136       +7     
  Branches      976      973       -3     
==========================================
+ Hits       217055   217059       +4     
- Misses         74       77       +3     
Files with missing lines Coverage Δ
src/modules/finance/index.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@ST-DDT ST-DDT changed the title chore(finance): deprecate maskedNumber for removal refactor(finance): deprecate maskedNumber for removal Oct 20, 2024
@ST-DDT ST-DDT added c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs has workaround Workaround provided or linked and removed c: chore PR that doesn't affect the runtime behavior labels Oct 20, 2024
@xDivisionByZerox
Copy link
Member

Dispite my comment in #3202, I think deprecating this method is valid:

  1. Proofen low to none actual use
  2. The utility this method provides is arguably confusing and niche

@ST-DDT ST-DDT requested review from xDivisionByZerox and a team November 3, 2024 21:23
src/modules/finance/index.ts Outdated Show resolved Hide resolved
@ST-DDT ST-DDT requested review from matthewmayer, xDivisionByZerox and a team November 10, 2024 17:18
@ST-DDT ST-DDT enabled auto-merge (squash) November 12, 2024 08:14
@ST-DDT ST-DDT disabled auto-merge November 12, 2024 08:14
@ST-DDT ST-DDT merged commit cb4b77c into next Nov 12, 2024
23 checks passed
@ST-DDT ST-DDT deleted the deprecate/finance/maskedNumber branch November 12, 2024 08:15
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 deprecation A deprecation was made in the PR has workaround Workaround provided or linked 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.

Deprecate finance.maskedNumber for removal
3 participants