{"version":3,"file":"isPossiblePhoneNumber.test.js","names":["_isPossiblePhoneNumber","metadata","type","oldMetadata","isPossiblePhoneNumber","parameters","push","apply","describe","it","should","equal","defaultCountry","expect","to"],"sources":["../source/isPossiblePhoneNumber.test.js"],"sourcesContent":["import _isPossiblePhoneNumber from './isPossiblePhoneNumber.js'\r\nimport metadata from '../metadata.min.json' assert { type: 'json' }\r\nimport oldMetadata from '../test/metadata/1.0.0/metadata.min.json' assert { type: 'json' }\r\n\r\nfunction isPossiblePhoneNumber(...parameters) {\r\n\tparameters.push(metadata)\r\n\treturn _isPossiblePhoneNumber.apply(this, parameters)\r\n}\r\n\r\ndescribe('isPossiblePhoneNumber', () => {\r\n\tit('should detect whether a phone number is possible', () => {\r\n\t\tisPossiblePhoneNumber('8 (800) 555 35 35', 'RU').should.equal(true)\r\n\t\tisPossiblePhoneNumber('8 (800) 555 35 35 0', 'RU').should.equal(false)\r\n\t\tisPossiblePhoneNumber('Call: 8 (800) 555 35 35', 'RU').should.equal(false)\r\n\t\tisPossiblePhoneNumber('8 (800) 555 35 35', { defaultCountry: 'RU' }).should.equal(true)\r\n\t\tisPossiblePhoneNumber('+7 (800) 555 35 35').should.equal(true)\r\n\t\tisPossiblePhoneNumber('+7 1 (800) 555 35 35').should.equal(false)\r\n\t\tisPossiblePhoneNumber(' +7 (800) 555 35 35').should.equal(false)\r\n\t\tisPossiblePhoneNumber(' ').should.equal(false)\r\n\t})\r\n\r\n\tit('should detect whether a phone number is possible when using old metadata', () => {\r\n\t\texpect(() => _isPossiblePhoneNumber('8 (800) 555 35 35', 'RU', oldMetadata))\r\n\t\t\t.to.throw('Missing \"possibleLengths\" in metadata.')\r\n\t\t_isPossiblePhoneNumber('+888 123 456 78901', oldMetadata).should.equal(true)\r\n\t})\r\n})"],"mappings":"AAAA,OAAOA,sBAAP,MAAmC,4BAAnC;AACA,OAAOC,QAAP,MAAqB,sBAArB,UAAqDC,IAAI,EAAE,MAA3D;AACA,OAAOC,WAAP,MAAwB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