tweb/public/28.6667bb68e660e626d453.chu...

1 line
1.9 KiB
Plaintext

{"version":3,"sources":["webpack:///./src/helpers/peerIdPolyfill.ts"],"names":["String","prototype","toUserId","this","toChatId","toPeerId","isChat","isPeerId","test","toString","Number","Math","abs","undefined"],"mappings":"sFAAA,OAMAA,OAAOC,UAAUC,SAAW,WAC1B,QAASC,MAAMD,YAGjBF,OAAOC,UAAUG,SAAW,WAC1B,QAASD,MAAMC,YAGjBJ,OAAOC,UAAUI,SAAW,SAASC,GACnC,QAASH,MAAME,SAASC,IAG1BN,OAAOC,UAAUM,SAAW,WAC1B,MAAO,SAASC,KAAKL,KAAKM,aAG5BC,OAAOT,UAAUC,SAAW,WAC1B,OAAOC,MAGTO,OAAOT,UAAUG,SAAW,WAC1B,OAAOO,KAAKC,IAAIT,OAGlBO,OAAOT,UAAUI,SAAW,SAASC,GACnC,YAAkBO,IAAXP,EAAuBH,KAAkBG,GAAUK,KAAKC,IAAIT,MAAkBA,MAGvFO,OAAOT,UAAUM,SAAW,WAC1B,OAAO","file":"28.6667bb68e660e626d453.chunk.js","sourcesContent":["/*\n * https://github.com/morethanwords/tweb\n * Copyright (C) 2019-2021 Eduard Kuzmenko\n * https://github.com/morethanwords/tweb/blob/master/LICENSE\n */\n\nString.prototype.toUserId = function() {\n return (+this).toUserId();\n};\n\nString.prototype.toChatId = function() {\n return (+this).toChatId();\n};\n\nString.prototype.toPeerId = function(isChat?: boolean) {\n return (+this).toPeerId(isChat);\n};\n\nString.prototype.isPeerId = function() {\n return /^[\\d-]/.test(this.toString());\n};\n\nNumber.prototype.toUserId = function() {\n return this as any;\n};\n\nNumber.prototype.toChatId = function() {\n return Math.abs(this as any);\n};\n\nNumber.prototype.toPeerId = function(isChat?: boolean) {\n return isChat === undefined ? this as number : (isChat ? -Math.abs(this as number) : this as number);\n};\n\nNumber.prototype.isPeerId = function() {\n return true;\n};\n\ndeclare global {\n interface String {\n toUserId(): UserId;\n toChatId(): ChatId;\n toPeerId(isChat?: boolean): PeerId;\n isPeerId(): this is string;\n }\n\n interface Number {\n toUserId(): UserId;\n toChatId(): ChatId;\n toPeerId(isChat?: boolean): PeerId;\n isPeerId(): this is PeerId;\n }\n}\n\nexport {};\n"],"sourceRoot":""}