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

1 line
17 KiB
JSON

{"ast":null,"code":"/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n'use strict';\n\nvar Store = require('./store').Store;\n\nvar permuteDomain = require('./permuteDomain').permuteDomain;\n\nvar pathMatch = require('./pathMatch').pathMatch;\n\nvar util = require('util');\n\nfunction MemoryCookieStore() {\n Store.call(this);\n this.idx = {};\n}\n\nutil.inherits(MemoryCookieStore, Store);\nexports.MemoryCookieStore = MemoryCookieStore;\nMemoryCookieStore.prototype.idx = null; // Since it's just a struct in RAM, this Store is synchronous\n\nMemoryCookieStore.prototype.synchronous = true; // force a default depth:\n\nMemoryCookieStore.prototype.inspect = function () {\n return \"{ idx: \" + util.inspect(this.idx, false, 2) + ' }';\n}; // Use the new custom inspection symbol to add the custom inspect function if\n// available.\n\n\nif (util.inspect.custom) {\n MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect;\n}\n\nMemoryCookieStore.prototype.findCookie = function (domain, path, key, cb) {\n if (!this.idx[domain]) {\n return cb(null, undefined);\n }\n\n if (!this.idx[domain][path]) {\n return cb(null, undefined);\n }\n\n return cb(null, this.idx[domain][path][key] || null);\n};\n\nMemoryCookieStore.prototype.findCookies = function (domain, path, cb) {\n var results = [];\n\n if (!domain) {\n return cb(null, []);\n }\n\n var pathMatcher;\n\n if (!path) {\n // null means \"all paths\"\n pathMatcher = function matchAll(domainIndex) {\n for (var curPath in domainIndex) {\n var pathIndex = domainIndex[curPath];\n\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n };\n } else {\n pathMatcher = function matchRFC(domainIndex) {\n //NOTE: we should use path-match algorithm from S5.1.4 here\n //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)\n Object.keys(domainIndex).forEach(function (cookiePath) {\n if (pathMatch(path, cookiePath)) {\n var pathIndex = domainIndex[cookiePath];\n\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n });\n };\n }\n\n var domains = permuteDomain(domain) || [domain];\n var idx = this.idx;\n domains.forEach(function (curDomain) {\n var domainIndex = idx[curDomain];\n\n if (!domainIndex) {\n return;\n }\n\n pathMatcher(domainIndex);\n });\n cb(null, results);\n};\n\nMemoryCookieStore.prototype.putCookie = function (cookie, cb) {\n if (!this.idx[cookie.domain]) {\n this.idx[cookie.domain] = {};\n }\n\n if (!this.idx[cookie.domain][cookie.path]) {\n this.idx[cookie.domain][cookie.path] = {};\n }\n\n this.idx[cookie.domain][cookie.path][cookie.key] = cookie;\n cb(null);\n};\n\nMemoryCookieStore.prototype.updateCookie = function (oldCookie, newCookie, cb) {\n // updateCookie() may avoid updating cookies that are identical. For example,\n // lastAccessed may not be important to some stores and an equality\n // comparison could exclude that field.\n this.putCookie(newCookie, cb);\n};\n\nMemoryCookieStore.prototype.removeCookie = function (domain, path, key, cb) {\n if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {\n delete this.idx[domain][path][key];\n }\n\n cb(null);\n};\n\nMemoryCookieStore.prototype.removeCookies = function (domain, path, cb) {\n if (this.idx[domain]) {\n if (path) {\n delete this.idx[domain][path];\n } else {\n delete this.idx[domain];\n }\n }\n\n return cb(null);\n};\n\nMemoryCookieStore.prototype.removeAllCookies = function (cb) {\n this.idx = {};\n return cb(null);\n};\n\nMemoryCookieStore.prototype.getAllCookies = function (cb) {\n var cookies = [];\n var idx = this.idx;\n var domains = Object.keys(idx);\n domains.forEach(function (domain) {\n var paths = Object.keys(idx[domain]);\n paths.forEach(function (path) {\n var keys = Object.keys(idx[domain][path]);\n keys.forEach(function (key) {\n if (key !== null) {\n cookies.push(idx[domain][path][key]);\n }\n });\n });\n }); // Sort by creationIndex so deserializing retains the creation order.\n // When implementing your own store, this SHOULD retain the order too\n\n cookies.sort(function (a, b) {\n return (a.creationIndex || 0) - (b.creationIndex || 0);\n });\n cb(null, cookies);\n};","map":{"version":3,"sources":["/Users/tylerkoenig/Code/personal/react-scss2/node_modules/request/node_modules/tough-cookie/lib/memstore.js"],"names":["Store","require","permuteDomain","pathMatch","util","MemoryCookieStore","call","idx","inherits","exports","prototype","synchronous","inspect","custom","findCookie","domain","path","key","cb","undefined","findCookies","results","pathMatcher","matchAll","domainIndex","curPath","pathIndex","push","matchRFC","Object","keys","forEach","cookiePath","domains","curDomain","putCookie","cookie","updateCookie","oldCookie","newCookie","removeCookie","removeCookies","removeAllCookies","getAllCookies","cookies","paths","sort","a","b","creationIndex"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAIA,KAAK,GAAGC,OAAO,CAAC,SAAD,CAAP,CAAmBD,KAA/B;;AACA,IAAIE,aAAa,GAAGD,OAAO,CAAC,iBAAD,CAAP,CAA2BC,aAA/C;;AACA,IAAIC,SAAS,GAAGF,OAAO,CAAC,aAAD,CAAP,CAAuBE,SAAvC;;AACA,IAAIC,IAAI,GAAGH,OAAO,CAAC,MAAD,CAAlB;;AAEA,SAASI,iBAAT,GAA6B;AAC3BL,EAAAA,KAAK,CAACM,IAAN,CAAW,IAAX;AACA,OAAKC,GAAL,GAAW,EAAX;AACD;;AACDH,IAAI,CAACI,QAAL,CAAcH,iBAAd,EAAiCL,KAAjC;AACAS,OAAO,CAACJ,iBAAR,GAA4BA,iBAA5B;AACAA,iBAAiB,CAACK,SAAlB,CAA4BH,GAA5B,GAAkC,IAAlC,C,CAEA;;AACAF,iBAAiB,CAACK,SAAlB,CAA4BC,WAA5B,GAA0C,IAA1C,C,CAEA;;AACAN,iBAAiB,CAACK,SAAlB,CAA4BE,OAA5B,GAAsC,YAAW;AAC/C,SAAO,YAAUR,IAAI,CAACQ,OAAL,CAAa,KAAKL,GAAlB,EAAuB,KAAvB,EAA8B,CAA9B,CAAV,GAA2C,IAAlD;AACD,CAFD,C,CAIA;AACA;;;AACA,IAAIH,IAAI,CAACQ,OAAL,CAAaC,MAAjB,EAAyB;AACvBR,EAAAA,iBAAiB,CAACK,SAAlB,CAA4BN,IAAI,CAACQ,OAAL,CAAaC,MAAzC,IAAmDR,iBAAiB,CAACK,SAAlB,CAA4BE,OAA/E;AACD;;AAE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B,OAAO,GAAG,EAAd;AACA,MAAIrC,GAAG,GAAG,KAAKA,GAAf;AAEA,MAAI0B,OAAO,GAAGJ,MAAM,CAACC,IAAP,CAAYvB,GAAZ,CAAd;AACA0B,EAAAA,OAAO,CAACF,OAAR,CAAgB,UAAShB,MAAT,EAAiB;AAC/B,QAAI8B,KAAK,GAAGhB,MAAM,CAACC,IAAP,CAAYvB,GAAG,CAACQ,MAAD,CAAf,CAAZ;AACA8B,IAAAA,KAAK,CAACd,OAAN,CAAc,UAASf,IAAT,EAAe;AAC3B,UAAIc,IAAI,GAAGD,MAAM,CAACC,IAAP,CAAYvB,GAAG,CAACQ,MAAD,CAAH,CAAYC,IAAZ,CAAZ,CAAX;AACAc,MAAAA,IAAI,CAACC,OAAL,CAAa,UAASd,GAAT,EAAc;AACzB,YAAIA,GAAG,KAAK,IAAZ,EAAkB;AAChB2B,UAAAA,OAAO,CAACjB,IAAR,CAAapB,GAAG,CAACQ,MAAD,CAAH,CAAYC,IAAZ,EAAkBC,GAAlB,CAAb;AACD;AACF,OAJD;AAKD,KAPD;AAQD,GAVD,EALuD,CAiBvD;AACA;;AACA2B,EAAAA,OAAO,CAACE,IAAR,CAAa,UAASC,CAAT,EAAWC,CAAX,EAAc;AACzB,WAAO,CAACD,CAAC,CAACE,aAAF,IAAiB,CAAlB,KAAwBD,CAAC,CAACC,aAAF,IAAiB,CAAzC,CAAP;AACD,GAFD;AAIA/B,EAAAA,EAAE,CAAC,IAAD,EAAO0B,OAAP,CAAF;AACD,CAxBD","sourcesContent":["/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n'use strict';\nvar Store = require('./store').Store;\nvar permuteDomain = require('./permuteDomain').permuteDomain;\nvar pathMatch = require('./pathMatch').pathMatch;\nvar util = require('util');\n\nfunction MemoryCookieStore() {\n Store.call(this);\n this.idx = {};\n}\nutil.inherits(MemoryCookieStore, Store);\nexports.MemoryCookieStore = MemoryCookieStore;\nMemoryCookieStore.prototype.idx = null;\n\n// Since it's just a struct in RAM, this Store is synchronous\nMemoryCookieStore.prototype.synchronous = true;\n\n// force a default depth:\nMemoryCookieStore.prototype.inspect = function() {\n return \"{ idx: \"+util.inspect(this.idx, false, 2)+' }';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n MemoryCookieStore.prototype[util.inspect.custom] = MemoryCookieStore.prototype.inspect;\n}\n\nMemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {\n if (!this.idx[domain]) {\n return cb(null,undefined);\n }\n if (!this.idx[domain][path]) {\n return cb(null,undefined);\n }\n return cb(null,this.idx[domain][path][key]||null);\n};\n\nMemoryCookieStore.prototype.findCookies = function(domain, path, cb) {\n var results = [];\n if (!domain) {\n return cb(null,[]);\n }\n\n var pathMatcher;\n if (!path) {\n // null means \"all paths\"\n pathMatcher = function matchAll(domainIndex) {\n for (var curPath in domainIndex) {\n var pathIndex = domainIndex[curPath];\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n };\n\n } else {\n pathMatcher = function matchRFC(domainIndex) {\n //NOTE: we should use path-match algorithm from S5.1.4 here\n //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)\n Object.keys(domainIndex).forEach(function (cookiePath) {\n if (pathMatch(path, cookiePath)) {\n var pathIndex = domainIndex[cookiePath];\n\n for (var key in pathIndex) {\n results.push(pathIndex[key]);\n }\n }\n });\n };\n }\n\n var domains = permuteDomain(domain) || [domain];\n var idx = this.idx;\n domains.forEach(function(curDomain) {\n var domainIndex = idx[curDomain];\n if (!domainIndex) {\n return;\n }\n pathMatcher(domainIndex);\n });\n\n cb(null,results);\n};\n\nMemoryCookieStore.prototype.putCookie = function(cookie, cb) {\n if (!this.idx[cookie.domain]) {\n this.idx[cookie.domain] = {};\n }\n if (!this.idx[cookie.domain][cookie.path]) {\n this.idx[cookie.domain][cookie.path] = {};\n }\n this.idx[cookie.domain][cookie.path][cookie.key] = cookie;\n cb(null);\n};\n\nMemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {\n // updateCookie() may avoid updating cookies that are identical. For example,\n // lastAccessed may not be important to some stores and an equality\n // comparison could exclude that field.\n this.putCookie(newCookie,cb);\n};\n\nMemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) {\n if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {\n delete this.idx[domain][path][key];\n }\n cb(null);\n};\n\nMemoryCookieStore.prototype.removeCookies = function(domain, path, cb) {\n if (this.idx[domain]) {\n if (path) {\n delete this.idx[domain][path];\n } else {\n delete this.idx[domain];\n }\n }\n return cb(null);\n};\n\nMemoryCookieStore.prototype.removeAllCookies = function(cb) {\n this.idx = {};\n return cb(null);\n}\n\nMemoryCookieStore.prototype.getAllCookies = function(cb) {\n var cookies = [];\n var idx = this.idx;\n\n var domains = Object.keys(idx);\n domains.forEach(function(domain) {\n var paths = Object.keys(idx[domain]);\n paths.forEach(function(path) {\n var keys = Object.keys(idx[domain][path]);\n keys.forEach(function(key) {\n if (key !== null) {\n cookies.push(idx[domain][path][key]);\n }\n });\n });\n });\n\n // Sort by creationIndex so deserializing retains the creation order.\n // When implementing your own store, this SHOULD retain the order too\n cookies.sort(function(a,b) {\n return (a.creationIndex||0) - (b.creationIndex||0);\n });\n\n cb(null, cookies);\n};\n"]},"metadata":{},"sourceType":"script"}