1 line
5.8 KiB
JSON
1 line
5.8 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 pubsuffix = require('./pubsuffix-psl'); // Gives the permutation of all possible domainMatch()es of a given domain. The\n// array is in shortest-to-longest order. Handy for indexing.\n\n\nfunction permuteDomain(domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n\n if (!pubSuf) {\n return null;\n }\n\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n\n return permutations;\n}\n\nexports.permuteDomain = permuteDomain;","map":{"version":3,"sources":["/Users/tylerkoenig/Code/personal/react-scss2/node_modules/request/node_modules/tough-cookie/lib/permuteDomain.js"],"names":["pubsuffix","require","permuteDomain","domain","pubSuf","getPublicSuffix","prefix","slice","length","parts","split","reverse","cur","permutations","shift","push","exports"],"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,SAAS,GAAGC,OAAO,CAAC,iBAAD,CAAvB,C,CAEA;AACA;;;AACA,SAASC,aAAT,CAAwBC,MAAxB,EAAgC;AAC9B,MAAIC,MAAM,GAAGJ,SAAS,CAACK,eAAV,CAA0BF,MAA1B,CAAb;;AACA,MAAI,CAACC,MAAL,EAAa;AACX,WAAO,IAAP;AACD;;AACD,MAAIA,MAAM,IAAID,MAAd,EAAsB;AACpB,WAAO,CAACA,MAAD,CAAP;AACD;;AAED,MAAIG,MAAM,GAAGH,MAAM,CAACI,KAAP,CAAa,CAAb,EAAgB,EAAEH,MAAM,CAACI,MAAP,GAAgB,CAAlB,CAAhB,CAAb,CAT8B,CASsB;;AACpD,MAAIC,KAAK,GAAGH,MAAM,CAACI,KAAP,CAAa,GAAb,EAAkBC,OAAlB,EAAZ;AACA,MAAIC,GAAG,GAAGR,MAAV;AACA,MAAIS,YAAY,GAAG,CAACD,GAAD,CAAnB;;AACA,SAAOH,KAAK,CAACD,MAAb,EAAqB;AACnBI,IAAAA,GAAG,GAAGH,KAAK,CAACK,KAAN,KAAgB,GAAhB,GAAsBF,GAA5B;AACAC,IAAAA,YAAY,CAACE,IAAb,CAAkBH,GAAlB;AACD;;AACD,SAAOC,YAAP;AACD;;AAEDG,OAAO,CAACd,aAAR,GAAwBA,aAAxB","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 pubsuffix = require('./pubsuffix-psl');\n\n// Gives the permutation of all possible domainMatch()es of a given domain. The\n// array is in shortest-to-longest order. Handy for indexing.\nfunction permuteDomain (domain) {\n var pubSuf = pubsuffix.getPublicSuffix(domain);\n if (!pubSuf) {\n return null;\n }\n if (pubSuf == domain) {\n return [domain];\n }\n\n var prefix = domain.slice(0, -(pubSuf.length + 1)); // \".example.com\"\n var parts = prefix.split('.').reverse();\n var cur = pubSuf;\n var permutations = [cur];\n while (parts.length) {\n cur = parts.shift() + '.' + cur;\n permutations.push(cur);\n }\n return permutations;\n}\n\nexports.permuteDomain = permuteDomain;\n"]},"metadata":{},"sourceType":"script"} |