Skip to content

Commit

Permalink
Merge branch 'master' into row-252
Browse files Browse the repository at this point in the history
  • Loading branch information
RgnDunes authored Jul 25, 2024
2 parents a75fe67 + b341faa commit fe66808
Show file tree
Hide file tree
Showing 147 changed files with 23,693 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe('currency - convertToMajorUnit', () => {
];

testCases.forEach(({ amount, currency, expectedResult }) => {
it(`should correctly convert ${amount} of minor unit ${String(currency)} to ${expectedResult}`, () => {
it(`should correctly convert ${amount} of minor unit ${String(
currency,
)} to ${expectedResult}`, () => {
const result = convertToMajorUnit(amount, { currency: currency });
expect(result).toBe(expectedResult);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ describe('currency - convertToMinorUnit', () => {
];

testCases.forEach(({ amount, currency, expectedResult }) => {
it(`should correctly convert ${amount} of minor unit ${String(currency)} to ${expectedResult}`, () => {
it(`should correctly convert ${amount} of minor unit ${String(
currency,
)} to ${expectedResult}`, () => {
const result = convertToMinorUnit(amount, { currency: currency });
expect(result).toBe(expectedResult);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ function generateOptionsString(
) {
const { locale, intlOptions } = options;
const intlOptionsString = JSON.stringify(intlOptions || {});
return `'${date}', { locale: '${locale || ''}', intlOptions: ${intlOptionsString} }`;
return `'${date}', { locale: '${
locale || ''
}', intlOptions: ${intlOptionsString} }`;
}

test.describe('parseDateTime', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const getFlagsForAllCountries = (): {

// Loop through each country code in the list
LIST_OF_ALL_COUNTRIES.map((countryCode: CountryCodeType) => {
let lowerCasedCountryCode = countryCode.toLowerCase() as CountryCodeType;
const lowerCasedCountryCode = countryCode.toLowerCase() as CountryCodeType;
// Construct the flag image URL and assign it to the corresponding country code in the map
flagsForAllCountriesMap[countryCode] = {
original: `${FLAG_BASE_PATH}/${lowerCasedCountryCode}.svg`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('getPhoneNumberWithoutDialCode', () => {
test('should correctly remove the dial code from a phone number', () => {
const phoneNumber = '+1-800-123-4567';
const result = getPhoneNumberWithoutDialCode(phoneNumber);

expect(result).toBe('8001234567');
});

Expand All @@ -23,6 +23,6 @@ describe('getPhoneNumberWithoutDialCode', () => {
test('should process numbers with unusual dial codes', () => {
const phoneNumber = '+91-9876543210';
const result = getPhoneNumberWithoutDialCode(phoneNumber);
expect(result).toBe('9876543210');
expect(result).toBe('9876543210');
});
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {matchesEntirely} from '../utils';
import { matchesEntirely } from '../utils';

describe('matchesEntirely', () => {
test('should return true for exact match', () => {
Expand Down Expand Up @@ -43,7 +43,6 @@ describe('matchesEntirely', () => {
expect(matchesEntirely(text, regex)).toBe(true);
});


test('should return false for regex that does not cover the entire string', () => {
const text = 'hello 123 world';
const regex = '\\d{3}';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const getMaskedPhoneNumber = ({
: updatedPhoneNumber;

// Get the phone number formatting template based on the country code
let formattingTemplate =
const formattingTemplate =
PHONE_FORMATTER_MAPPER[updatedCountryCode] ||
phoneNumber.replace(/\d/g, 'x');

Expand Down Expand Up @@ -108,7 +108,10 @@ const getMaskedPhoneNumber = ({

// Include the dial code in the masked phone number if requested
if (withDialCode) {
return `${dialCode} ${maskedContactNumber.replace(/x/g, maskingChar)}`.trim();
return `${dialCode} ${maskedContactNumber.replace(
/x/g,
maskingChar,
)}`.trim();
} else {
return maskedContactNumber.trim().replace(/x/g, maskingChar);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/i18nify-js/src/modules/phoneNumber/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export interface PhoneNumberMockEntry {

export interface PhoneNumbersMockData {
[countryCode: string]: PhoneNumberMockEntry[];
}
}
4 changes: 2 additions & 2 deletions packages/i18nify-js/src/modules/phoneNumber/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const suffixMasking = (
n: number,
): string => {
// Convert the source string into an array of characters for easy manipulation
let result: string[] = source.split('');
const result: string[] = source.split('');
let replaceIndex: number = 0;
let replacementsDone: number = 0;

Expand Down Expand Up @@ -134,7 +134,7 @@ export const prefixMasking = (
n: number,
): string => {
// Convert the source string into an array of characters for easy manipulation
let result: string[] = source.split('');
const result: string[] = source.split('');
let replaceIndex: number = replacement.length - 1;
let replacementsDone: number = 0;

Expand Down
36 changes: 36 additions & 0 deletions packages/i18nify-playground/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# production
.next
.swc
_static
out
dist
build

# environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# misc
.DS_Store
.vercel
.netlify
.unimportedrc.json
tsconfig.tsbuildinfo
.vscode

npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 1 addition & 0 deletions packages/i18nify-playground/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
geosmart.razorpay.com
21 changes: 21 additions & 0 deletions packages/i18nify-playground/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Minimal UI ([https://minimals.cc/](https://minimals.cc/))

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions packages/i18nify-playground/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# i18nify Playground
49 changes: 49 additions & 0 deletions packages/i18nify-playground/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="theme-color" content="#000000" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<link rel="manifest" href="/manifest.json" />

<!-- Favicon -->
<link
rel="icon"
href="https://razorpay.com/build/browser/static/favicon-default.9e0f1b99.png"
/>

<!-- Google Font -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Inter:[email protected]&display=swap"
rel="stylesheet"
/>

<title>I18nify Playground</title>
<meta
name="description"
content="The starting point for your next project with I18nify Playground, built on the newest version of Material-UI ©, ready to be customized to your style"
/>
<meta name="keywords" content="react,material,kit,application,dashboard,admin,template" />
<meta name="author" content="I18nify Playground" />
<style rel="stylesheet">
@font-face {
font-family: 'TASA Orbiter';
src: url('/assets/fonts/tasa-orbiter.woff2') format('woff2-variations');
font-weight: 125 950;
font-stretch: 75% 125%;
font-style: normal;
font-display: swap;
}
</style>
</head>

<body>
<div id="root"></div>
<script>
const global = globalThis;
</script>
<script type="module" src="/src/main.jsx"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions packages/i18nify-playground/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"baseUrl": "."
}
}
Loading

0 comments on commit fe66808

Please sign in to comment.