razorpay / i18nify

One stop solution for all your internationalisation needs.
https://geosmart.razorpay.com/
21 stars 10 forks source link

feat: add new api for masked contact number in phone number module [ATLAS-197] #142

Closed RgnDunes closed 6 months ago

RgnDunes commented 6 months ago

Description

This module adds a new API that returns us a masked contact number as shown below:

// Example: 

// Masking a U.S. phone number completely
console.log(
  getMaskedPhoneNumber({
    countryCode: 'US',
    phoneNumber: '2025550125',
    withDialCode: true,
  }),
);
// Output: +1 xxx-xxx-xxxx

// Partially masking an Indian phone number, hiding the last 6 digits
console.log(
  getMaskedPhoneNumber({
    countryCode: 'IN',
    phoneNumber: '9876543210',
    maskingOptions: {
      maskingStyle: 'suffix',
      maskedDigitsCount: 6,
      maskingChar: '*',
    },
    withDialCode: true,
  }),
);
// Output: +91 9876**-****

// Formatting and completely masking a phone number for Brazil without specifying a phone number
console.log(
  getMaskedPhoneNumber({
    countryCode: 'BR',
  }),
);
// Output: xx xxxx-xxxx

Changes Made

List the main changes made in this pull request.

Title ---
JIRA link https://razorpay.atlassian.net/browse/ATLAS-197
Slack thread (if any) NA
Product spec NA
Tech spec/One-pager NA
Bundle Size Difference NA
Fixes Issue NA

Type of change

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Additional Notes

Any additional information that would be helpful for the reviewer.

Checklist:

Reviewer Checklist


PR Title Format

Format: <type>: <subject>

Types can be as follows:

changeset-bot[bot] commented 6 months ago

🦋 Changeset detected

Latest commit: e4b328b059a32515f1d1e278b16ef7b304947eaa

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages | Name | Type | | ----------------------- | ----- | | @razorpay/i18nify-js | Minor | | @razorpay/i18nify-react | Major |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 4f1dccdf.

rzpcibot commented 6 months ago
Warnings
:warning: Your PR has over 600 lines of code additions :scream: . Try to breakup into separate PRs :+1:

Bundle Size Report

Files

click to expand/collapse
| 🟢 No Change | 🗑 File Deleted | 🆕 New File | 📈 Size Increased | 👍 Size Reduced | | --- | --- | --- | --- | --- |
Parsed (kb)
🚦 File Name Base PR Diff %
📈 cjs/index.js 138.9 146.13 $\textcolor{red}{7.23}$ 5.21
📈 esm/index.min.js 51.45 52.74 $\textcolor{red}{1.29}$ 2.51
📈 umd/index.js 158.85 166.67 $\textcolor{red}{7.82}$ 4.92

Generated by :no_entry_sign: dangerJS against e4b328b059a32515f1d1e278b16ef7b304947eaa

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 21cdd204.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 58340142.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 51f0427c.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 07ae9e38.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit b7c1b9c3.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 516c1499.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 23384b40.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 418cd4c2.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 5983c45f.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 1c53298f.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit a322fec2.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit ebd1ebd6.

github-actions[bot] commented 6 months ago

Unit Test Results

0 files  0 suites   0s :stopwatch: 0 tests 0 :heavy_check_mark: 0 :zzz: 0 :x:

Results for commit 84ef659a.