Files
portfolio/node_modules/.cache/babel-loader/f4eacd2c5638d3aca9dd2c5df4439785.json
2021-09-20 16:54:47 -04:00

1 line
4.5 KiB
JSON

{"ast":null,"code":"'use strict';\n\nconst inherits = require('inherits');\n\nconst Buffer = require('safer-buffer').Buffer;\n\nconst DERDecoder = require('./der');\n\nfunction PEMDecoder(entity) {\n DERDecoder.call(this, entity);\n this.enc = 'pem';\n}\n\ninherits(PEMDecoder, DERDecoder);\nmodule.exports = PEMDecoder;\n\nPEMDecoder.prototype.decode = function decode(data, options) {\n const lines = data.toString().split(/[\\r\\n]+/g);\n const label = options.label.toUpperCase();\n const re = /^-----(BEGIN|END) ([^-]+)-----$/;\n let start = -1;\n let end = -1;\n\n for (let i = 0; i < lines.length; i++) {\n const match = lines[i].match(re);\n if (match === null) continue;\n if (match[2] !== label) continue;\n\n if (start === -1) {\n if (match[1] !== 'BEGIN') break;\n start = i;\n } else {\n if (match[1] !== 'END') break;\n end = i;\n break;\n }\n }\n\n if (start === -1 || end === -1) throw new Error('PEM section not found for: ' + label);\n const base64 = lines.slice(start + 1, end).join(''); // Remove excessive symbols\n\n base64.replace(/[^a-z0-9+/=]+/gi, '');\n const input = Buffer.from(base64, 'base64');\n return DERDecoder.prototype.decode.call(this, input, options);\n};","map":{"version":3,"sources":["/Users/tylerkoenig/Code/personal/react-scss2/node_modules/asn1.js/lib/asn1/decoders/pem.js"],"names":["inherits","require","Buffer","DERDecoder","PEMDecoder","entity","call","enc","module","exports","prototype","decode","data","options","lines","toString","split","label","toUpperCase","re","start","end","i","length","match","Error","base64","slice","join","replace","input","from"],"mappings":"AAAA;;AAEA,MAAMA,QAAQ,GAAGC,OAAO,CAAC,UAAD,CAAxB;;AACA,MAAMC,MAAM,GAAGD,OAAO,CAAC,cAAD,CAAP,CAAwBC,MAAvC;;AAEA,MAAMC,UAAU,GAAGF,OAAO,CAAC,OAAD,CAA1B;;AAEA,SAASG,UAAT,CAAoBC,MAApB,EAA4B;AAC1BF,EAAAA,UAAU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G,CAApB,EAAuBC,GAAvB,EAA4BO,IAA5B,CAAiC,EAAjC,CAAf,CA9B2D,CA+B3D;;AACAF,EAAAA,MAAM,CAACG,OAAP,CAAe,iBAAf,EAAkC,EAAlC;AAEA,QAAMC,KAAK,GAAG5B,MAAM,CAAC6B,IAAP,CAAYL,MAAZ,EAAoB,QAApB,CAAd;AACA,SAAOvB,UAAU,CAACO,SAAX,CAAqBC,MAArB,CAA4BL,IAA5B,CAAiC,IAAjC,EAAuCwB,KAAvC,EAA8CjB,OAA9C,CAAP;AACD,CApCD","sourcesContent":["'use strict';\n\nconst inherits = require('inherits');\nconst Buffer = require('safer-buffer').Buffer;\n\nconst DERDecoder = require('./der');\n\nfunction PEMDecoder(entity) {\n DERDecoder.call(this, entity);\n this.enc = 'pem';\n}\ninherits(PEMDecoder, DERDecoder);\nmodule.exports = PEMDecoder;\n\nPEMDecoder.prototype.decode = function decode(data, options) {\n const lines = data.toString().split(/[\\r\\n]+/g);\n\n const label = options.label.toUpperCase();\n\n const re = /^-----(BEGIN|END) ([^-]+)-----$/;\n let start = -1;\n let end = -1;\n for (let i = 0; i < lines.length; i++) {\n const match = lines[i].match(re);\n if (match === null)\n continue;\n\n if (match[2] !== label)\n continue;\n\n if (start === -1) {\n if (match[1] !== 'BEGIN')\n break;\n start = i;\n } else {\n if (match[1] !== 'END')\n break;\n end = i;\n break;\n }\n }\n if (start === -1 || end === -1)\n throw new Error('PEM section not found for: ' + label);\n\n const base64 = lines.slice(start + 1, end).join('');\n // Remove excessive symbols\n base64.replace(/[^a-z0-9+/=]+/gi, '');\n\n const input = Buffer.from(base64, 'base64');\n return DERDecoder.prototype.decode.call(this, input, options);\n};\n"]},"metadata":{},"sourceType":"script"}