@dpgradio/creative 5.9.1 → 5.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpgradio/creative",
3
- "version": "5.9.1",
3
+ "version": "5.9.2",
4
4
  "description": "Support package for standalone Javascript applications",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -13,6 +13,12 @@ describe('removing explicitly given prefixes', () => {
13
13
 
14
14
  expect(result).toBe('+33634542211')
15
15
  })
16
+
17
+ test('it does not fail when the given number is null', () => {
18
+ const result = removePhoneNumberCountryPrefix(null, '+31')
19
+
20
+ expect(result).toBeNull()
21
+ })
16
22
  })
17
23
 
18
24
  jest.mock('../../config/config.js', () => ({
@@ -6,6 +6,10 @@ const prefixes = {
6
6
  }
7
7
 
8
8
  export const removePhoneNumberCountryPrefix = (phoneNumber, prefix = null) => {
9
+ if (!phoneNumber) {
10
+ return phoneNumber
11
+ }
12
+
9
13
  prefix ||= prefixes[config('country_code')]
10
14
 
11
15
  if (prefix) {