isValidNumberForRegion.test.js.map 2.6 KB

1
  1. {"version":3,"file":"isValidNumberForRegion.test.js","names":["metadata","type","isValidNumberForRegionCustom","_isValidNumberForRegion","isValidNumberForRegion","parameters","push","apply","describe","it","should","equal","expect","phone","country","to"],"sources":["../../source/legacy/isValidNumberForRegion.test.js"],"sourcesContent":["import metadata from '../../metadata.min.json' assert { type: 'json' }\r\nimport isValidNumberForRegionCustom from './isValidNumberForRegion.js'\r\nimport _isValidNumberForRegion from './isValidNumberForRegion_.js'\r\n\r\nfunction isValidNumberForRegion(...parameters) {\r\n\tparameters.push(metadata)\r\n\treturn isValidNumberForRegionCustom.apply(this, parameters)\r\n}\r\n\r\ndescribe('isValidNumberForRegion', () => {\r\n\tit('should detect if is valid number for region', () => {\r\n\t\tisValidNumberForRegion('07624369230', 'GB').should.equal(false)\r\n\t\tisValidNumberForRegion('07624369230', 'IM').should.equal(true)\r\n\t})\r\n\r\n\tit('should validate arguments', () => {\r\n\t\texpect(() => isValidNumberForRegion({ phone: '7624369230', country: 'GB' })).to.throw('number must be a string')\r\n\t\texpect(() => isValidNumberForRegion('7624369230')).to.throw('country must be a string')\r\n\t})\r\n\r\n\tit('should work in edge cases', () => {\r\n\t\t// Not a \"viable\" phone number.\r\n\t\tisValidNumberForRegion('7', 'GB').should.equal(false)\r\n\r\n\t\t// `options` argument `if/else` coverage.\r\n\t\t_isValidNumberForRegion('07624369230', 'GB', {}, metadata).should.equal(false)\r\n\t})\r\n})"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,yBAArB,UAAwDC,IAAI,EAAE,MAA9D;AACA,OAAOC,4BAAP,MAAyC,6BAAzC;AACA,OAAOC,uBAAP,MAAoC,8BAApC;;AAEA,SAASC,sBAAT,GAA+C;EAAA,kCAAZC,UAAY;IAAZA,UAAY;EAAA;;EAC9CA,UAAU,CAACC,IAAX,CAAgBN,QAAhB;EACA,OAAOE,4BAA4B,CAACK,KAA7B,CAAmC,IAAnC,EAAyCF,UAAzC,CAAP;AACA;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