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

Feature Request: Generic Mask Option for JSON #40

Closed
pengxiangg opened this issue Nov 22, 2023 · 6 comments
Closed

Feature Request: Generic Mask Option for JSON #40

pengxiangg opened this issue Nov 22, 2023 · 6 comments

Comments

@pengxiangg
Copy link

I would like to mask multiple fields in JSON but these fields have different requirements for unmaskStart and unmaskEnd characters. However, there is currently only one function with this masking option (password).

The feature request is to allow users to create more masking options (that is based on the password option) for different string fields.
Maybe something like

const jsonMaskConfig = {
  otherOptions: [ 
      { 
           maskOptions: {maskWith: "X", unmaskedStartCharacters: 1, unmaskedEndCharacters: 1},
           fields: [firstName] 
      }, 
      { 
           maskOptions: {maskWith: "X", unmaskedStartCharacters: 2},
           fields: [lastName] 
      }
}
@Sumukha1496
Copy link
Owner

Hi @pengxiangg , Sorry for the delay.. I was on vacation... I will check the issue and get back to you in a few days

@Sumukha1496
Copy link
Owner

Hi @pengxiangg , This is a good to have feature. I will make this change in the upcoming version. Thank you

@Sumukha1496
Copy link
Owner

@pengxiangg , I am working on this change and you can expect it soon

@pengxiangg
Copy link
Author

Hi @Sumukha1496 thank you so much for your hard work! Looking forward to this new feature. Hope you had a great vacation!

@Sumukha1496
Copy link
Owner

Sumukha1496 commented Jan 28, 2024

@pengxiangg , Please check V1.3.1 --> https://www.npmjs.com/package/maskdata?activeTab=readme#json-mask-examples
With this you can extend your usecase to generic strings. If you need more configs here, let me know. Closing this issue for now.

@pengxiangg
Copy link
Author

@Sumukha1496 Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants