{"version":3,"sources":["../../source/libphonenumber/formatPhoneNumber.test.js"],"names":["call","func","_arguments","args","Array","prototype","slice","push","metadata","apply","formatPhoneNumber","_formatPhoneNumber","arguments","formatPhoneNumberIntl","_formatPhoneNumberIntl","describe","it","expect","to","should","equal","undefined"],"mappings":";;;;AAAA;;AACA;;;;;;;;AAEA,SAASA,IAAT,CAAcC,IAAd,EAAoBC,UAApB,EAAgC;AAC/B,MAAIC,IAAI,GAAGC,KAAK,CAACC,SAAN,CAAgBC,KAAhB,CAAsBN,IAAtB,CAA2BE,UAA3B,CAAX;AACAC,EAAAA,IAAI,CAACI,IAAL,CAAUC,uBAAV;AACA,SAAOP,IAAI,CAACQ,KAAL,CAAW,IAAX,EAAiBN,IAAjB,CAAP;AACA;;AAED,SAASO,iBAAT,GAA6B;AAC5B,SAAOV,IAAI,CAACW,8BAAD,EAAqBC,SAArB,CAAX;AACA;;AAED,SAASC,qBAAT,GAAiC;AAChC,SAAOb,IAAI,CAACc,yCAAD,EAAyBF,SAAzB,CAAX;AACA;;AAEDG,QAAQ,CAAC,mBAAD,EAAsB,YAAM;AACnCC,EAAAA,EAAE,CAAC,6BAAD,EAAgC,YAAM;AACvCC,IAAAA,MAAM,CAAC;AAAA,aAAMP,iBAAiB,EAAvB;AAAA,KAAD,CAAN,CAAkCQ,EAAlC,UAA2C,kBAA3C,EADuC,CAEvC;;AACAR,IAAAA,iBAAiB,CAAC,IAAD,CAAjB,CAAwBS,MAAxB,CAA+BC,KAA/B,CAAqC,EAArC;AACAV,IAAAA,iBAAiB,CAAC,EAAD,CAAjB,CAAsBS,MAAtB,CAA6BC,KAA7B,CAAmC,EAAnC;AACAH,IAAAA,MAAM,CAAC;AAAA,aAAM,oCAAmB,IAAnB,EAAyB,UAAzB,CAAN;AAAA,KAAD,CAAN,CAAmDC,EAAnD,UAA4D,gCAA5D;AACAD,IAAAA,MAAM,CAAC;AAAA,aAAM,oCAAmB,cAAnB,EAAmCI,SAAnC,EAA8Cb,uBAA9C,CAAN;AAAA,KAAD,CAAN,CAAsEU,EAAtE,UAA+E,kBAA/E;AACAD,IAAAA,MAAM,CAAC;AAAA,aAAM,oCAAmB,cAAnB,EAAmC,KAAnC,EAA0CT,uBAA1C,CAAN;AAAA,KAAD,CAAN,CAAkEU,EAAlE,UAA2E,kBAA3E;AACAR,IAAAA,iBAAiB,CAAC,IAAD,EAAO,UAAP,CAAjB,CAAoCS,MAApC,CAA2CC,KAA3C,CAAiD,EAAjD;AACAV,IAAAA,iBAAiB,CAAC,cAAD,EAAiB,UAAjB,CAAjB,CAA8CS,MAA9C,CAAqDC,KAArD,CAA2D,gBAA3D;AACAV,IAAAA,iBAAiB,CAAC,cAAD,CAAjB,CAAkCS,MAAlC,CAAyCC,KAAzC,CAA+C,gBAA/C;AACAV,IAAAA,iBAAiB,CAAC,cAAD,EAAiB,eAAjB,CAAjB,CAAmDS,MAAnD,CAA0DC,KAA1D,CAAgE,iBAAhE,EAXuC,CAYvC;AACA;;AACAV,IAAAA,iBAAiB,CAAC,cAAD,EAAiB,UAAjB,CAAjB,CAA8CS,MAA9C,CAAqDC,KAArD,CAA2D,gBAA3D;AACAV,IAAAA,iBAAiB,CAAC,cAAD,EAAiB,eAAjB,CAAjB,CAAmDS,MAAnD,CAA0DC,KAA1D,CAAgE,iBAAhE;AACA,GAhBC,CAAF;AAkBAJ,EAAAA,EAAE,CAAC,2CAAD,EAA8C,YAAM;AACrDH,IAAAA,qBAAqB,CAAC,cAAD,CAArB,CAAsCM,MAAtC,CAA6CC,KAA7C,CAAmD,iBAAnD;AACA,GAFC,CAAF;AAGA,CAtBO,CAAR","sourcesContent":["import _formatPhoneNumber, { formatPhoneNumberIntl as _formatPhoneNumberIntl } from './formatPhoneNumber'\r\nimport metadata from 'libphonenumber-js/metadata.min.json'\r\n\r\nfunction call(func, _arguments) {\r\n\tvar args = Array.prototype.slice.call(_arguments)\r\n\targs.push(metadata)\r\n\treturn func.apply(this, args)\r\n}\r\n\r\nfunction formatPhoneNumber() {\r\n\treturn call(_formatPhoneNumber, arguments)\r\n}\r\n\r\nfunction formatPhoneNumberIntl() {\r\n\treturn call(_formatPhoneNumberIntl, arguments)\r\n}\r\n\r\ndescribe('formatPhoneNumber', () => {\r\n\tit('should format phone numbers', () => {\r\n\t\texpect(() => formatPhoneNumber()).to.throw('must be a string')\r\n\t\t// formatPhoneNumber().should.equal('')\r\n\t\tformatPhoneNumber(null).should.equal('')\r\n\t\tformatPhoneNumber('').should.equal('')\r\n\t\texpect(() => _formatPhoneNumber('+1', 'NATIONAL')).to.throw('`metadata` argument not passed')\r\n\t\texpect(() => _formatPhoneNumber('+12133734253', undefined, metadata)).to.throw('Unknown \"format\"')\r\n\t\texpect(() => _formatPhoneNumber('+12133734253', '123', metadata)).to.throw('Unknown \"format\"')\r\n\t\tformatPhoneNumber('+1', 'NATIONAL').should.equal('')\r\n\t\tformatPhoneNumber('+12133734253', 'NATIONAL').should.equal('(213) 373-4253')\r\n\t\tformatPhoneNumber('+12133734253').should.equal('(213) 373-4253')\r\n\t\tformatPhoneNumber('+12133734253', 'INTERNATIONAL').should.equal('+1 213 373 4253')\r\n\t\t// Deprecated.\r\n\t\t// Legacy `format`s.\r\n\t\tformatPhoneNumber('+12133734253', 'National').should.equal('(213) 373-4253')\r\n\t\tformatPhoneNumber('+12133734253', 'International').should.equal('+1 213 373 4253')\r\n\t})\r\n\r\n\tit('should format international phone numbers', () => {\r\n\t\tformatPhoneNumberIntl('+12133734253').should.equal('+1 213 373 4253')\r\n\t})\r\n})"],"file":"formatPhoneNumber.test.js"}