Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fbf7fa0e5 | ||
|
|
af0bba313a |
No files matched your search
@@ -12,19 +12,25 @@ describe('E164Parser.fromJid', () => {
|
||||
expect(E164Parser.fromJid('@s.whatsapp.net')).toBeNull();
|
||||
});
|
||||
|
||||
it('applies Brazil DDD + add-9 rule when local has 8 digits and not starting with 9', () => {
|
||||
// +55 <DDD:2> <local:8> and local does not start with 9
|
||||
it('applies Brazil add-9 rule when local has 8 digits (any first digit)', () => {
|
||||
// +55 <DDD:2> <local:8>
|
||||
expect(E164Parser.fromJid('553188888888@s.whatsapp.net')).toBe(
|
||||
'+5531988888888',
|
||||
);
|
||||
});
|
||||
|
||||
it('does not add 9 when local already starts with 9 (Brazil)', () => {
|
||||
it('554999111111 => 5549999111111', () => {
|
||||
expect(E164Parser.fromJid('554999111111@s.whatsapp.net')).toBe(
|
||||
'+5549999111111',
|
||||
);
|
||||
});
|
||||
|
||||
it('adds 9 even when local already starts with 9 (Brazil)', () => {
|
||||
expect(E164Parser.fromJid('553198888888@s.whatsapp.net')).toBe(
|
||||
'+553198888888',
|
||||
'+5531998888888',
|
||||
);
|
||||
expect(E164Parser.fromJid('553199999999@s.whatsapp.net')).toBe(
|
||||
'+553199999999',
|
||||
'+5531999999999',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -53,12 +53,10 @@ export class PhoneJidNormalizer {
|
||||
}
|
||||
|
||||
const RULES = [
|
||||
// Brazil - add 9 before Direct Distance Dialing
|
||||
// +55 <DDD:2> <local:8>, not already starting with 9
|
||||
// +553188888888 => +5531988888888
|
||||
// Brazil - ensure mobile numbers have 9 digits after DDD
|
||||
{
|
||||
name: 'br-add-9-after-ddd',
|
||||
re: /^\+55(\d{2})(?!9)(\d{8})$/,
|
||||
re: /^\+55(\d{2})(\d{8})$/,
|
||||
replace: '+55$19$2',
|
||||
},
|
||||
];
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ export function getWAHAVersion(): WAHAVersion {
|
||||
}
|
||||
|
||||
export const VERSION: WAHAEnvironment = {
|
||||
version: '2025.9.6',
|
||||
version: '2025.9.7',
|
||||
engine: getEngineName(),
|
||||
tier: getWAHAVersion(),
|
||||
browser:
|
||||
|
||||
Reference in new issue
Block a user