fsevents 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fsevents might be problematic. Click here for more details.
- package/node_modules/node-pre-gyp/CHANGELOG.md +4 -0
- package/node_modules/node-pre-gyp/README.md +1 -1
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +4 -0
- package/node_modules/node-pre-gyp/lib/util/versioning.js +16 -0
- package/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/inherits/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/rc/lib/utils.js +5 -3
- package/node_modules/node-pre-gyp/node_modules/rc/package.json +7 -8
- package/node_modules/node-pre-gyp/node_modules/rc/test/nested-env-vars.js +1 -0
- package/node_modules/node-pre-gyp/node_modules/request/.npmignore +3 -0
- package/node_modules/node-pre-gyp/node_modules/request/CHANGELOG.md +6 -0
- package/node_modules/node-pre-gyp/node_modules/request/README.md +2 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/README.md +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js +10 -4
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js +3 -3
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/timers.js +9 -3
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json +7 -7
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json +1 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json +2 -7
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +1 -6
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/README.md +12 -6
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/lib/cookie.js +32 -12
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/lib/pubsuffix.js +2 -2
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/package.json +35 -12
- package/node_modules/node-pre-gyp/node_modules/request/package.json +7 -7
- package/node_modules/node-pre-gyp/node_modules/request/request.js +6 -3
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +3 -2
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +1 -0
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +9 -9
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +12 -16
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/package.json +10 -11
- package/node_modules/node-pre-gyp/node_modules/semver/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/tar/node_modules/inherits/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/tar/package.json +2 -1
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/inherits/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/package.json +1 -1
- package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/readable-stream/package.json +1 -1
- package/node_modules/node-pre-gyp/package.json +8 -9
- package/package.json +2 -2
- package/node_modules/node-pre-gyp/node_modules/request/disabled.appveyor.yml +0 -36
- package/node_modules/node-pre-gyp/node_modules/request/examples/README.md +0 -115
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/.editorconfig +0 -12
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/.jshintrc +0 -70
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/.npmignore +0 -4
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/.travis.yml +0 -9
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/LICENSE +0 -74
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/generate-pubsuffix.js +0 -293
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/public-suffix.txt +0 -10309
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/api_test.js +0 -372
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/cookie_jar_test.js +0 -468
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/cookie_sorting_test.js +0 -156
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/cookie_to_json_test.js +0 -164
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/cookie_to_string_test.js +0 -162
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/date_test.js +0 -79
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/domain_and_path_test.js +0 -201
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/bsd-examples.json +0 -168
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/ietf_data/dates/examples.json +0 -48
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/ietf_data/parser.json +0 -1959
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/ietf_test.js +0 -105
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/jar_serialization_test.js +0 -348
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/lifetime_test.js +0 -97
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/parsing_test.js +0 -294
- package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/regression_test.js +0 -143
- package/node_modules/node-pre-gyp/node_modules/request/release.sh +0 -45
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/browser.js +0 -1159
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +0 -3
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +0 -32
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +0 -1075
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +0 -182
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +0 -9
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +0 -10
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +0 -24
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +0 -15
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +0 -16
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +0 -10
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +0 -13
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +0 -7
- package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +0 -50
@@ -1,70 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"passfail" : false,
|
3
|
-
"maxerr" : 100,
|
4
|
-
|
5
|
-
"browser" : false,
|
6
|
-
"node" : true,
|
7
|
-
"rhino" : false,
|
8
|
-
"couch" : false,
|
9
|
-
"wsh" : false,
|
10
|
-
|
11
|
-
"jquery" : false,
|
12
|
-
"prototypejs" : false,
|
13
|
-
"mootools" : false,
|
14
|
-
"dojo" : false,
|
15
|
-
|
16
|
-
"debug" : false,
|
17
|
-
"devel" : false,
|
18
|
-
|
19
|
-
"esnext" : true,
|
20
|
-
"strict" : true,
|
21
|
-
"globalstrict" : true,
|
22
|
-
|
23
|
-
"asi" : false,
|
24
|
-
"laxbreak" : false,
|
25
|
-
"bitwise" : true,
|
26
|
-
"boss" : false,
|
27
|
-
"curly" : true,
|
28
|
-
"eqeqeq" : false,
|
29
|
-
"eqnull" : true,
|
30
|
-
"evil" : false,
|
31
|
-
"expr" : false,
|
32
|
-
"forin" : false,
|
33
|
-
"immed" : true,
|
34
|
-
"lastsemic" : true,
|
35
|
-
"latedef" : false,
|
36
|
-
"loopfunc" : false,
|
37
|
-
"noarg" : true,
|
38
|
-
"regexp" : false,
|
39
|
-
"regexdash" : false,
|
40
|
-
"scripturl" : false,
|
41
|
-
"shadow" : false,
|
42
|
-
"supernew" : false,
|
43
|
-
"undef" : true,
|
44
|
-
"unused" : true,
|
45
|
-
|
46
|
-
"newcap" : true,
|
47
|
-
"noempty" : true,
|
48
|
-
"nonew" : true,
|
49
|
-
"nomen" : false,
|
50
|
-
"onevar" : false,
|
51
|
-
"onecase" : true,
|
52
|
-
"plusplus" : false,
|
53
|
-
"proto" : false,
|
54
|
-
"sub" : true,
|
55
|
-
"trailing" : true,
|
56
|
-
"white" : false,
|
57
|
-
|
58
|
-
"predef": [
|
59
|
-
"describe",
|
60
|
-
"it",
|
61
|
-
"before",
|
62
|
-
"beforeEach",
|
63
|
-
"after",
|
64
|
-
"afterEach",
|
65
|
-
"expect",
|
66
|
-
"setTimeout",
|
67
|
-
"clearTimeout"
|
68
|
-
],
|
69
|
-
"maxlen": 0
|
70
|
-
}
|
@@ -1,74 +0,0 @@
|
|
1
|
-
Copyright (c) 2015, Salesforce.com, Inc.
|
2
|
-
All rights reserved.
|
3
|
-
|
4
|
-
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
5
|
-
|
6
|
-
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
7
|
-
|
8
|
-
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
9
|
-
|
10
|
-
3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
11
|
-
|
12
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
13
|
-
|
14
|
-
===
|
15
|
-
|
16
|
-
The following exceptions apply:
|
17
|
-
|
18
|
-
===
|
19
|
-
|
20
|
-
`pubSufTest()` of generate-pubsuffix.js is in the public domain.
|
21
|
-
|
22
|
-
// Any copyright is dedicated to the Public Domain.
|
23
|
-
// http://creativecommons.org/publicdomain/zero/1.0/
|
24
|
-
|
25
|
-
===
|
26
|
-
|
27
|
-
`public-suffix.txt` was obtained from
|
28
|
-
<https://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.dat?raw=1>
|
29
|
-
via <http://publicsuffix.org>.
|
30
|
-
|
31
|
-
That file contains the usual Mozilla triple-license, for which this project uses it
|
32
|
-
under the terms of the MPL 1.1:
|
33
|
-
|
34
|
-
// ***** BEGIN LICENSE BLOCK *****
|
35
|
-
// Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
36
|
-
//
|
37
|
-
// The contents of this file are subject to the Mozilla Public License Version
|
38
|
-
// 1.1 (the "License"); you may not use this file except in compliance with
|
39
|
-
// the License. You may obtain a copy of the License at
|
40
|
-
// http://www.mozilla.org/MPL/
|
41
|
-
//
|
42
|
-
// Software distributed under the License is distributed on an "AS IS" basis,
|
43
|
-
// WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
44
|
-
// for the specific language governing rights and limitations under the
|
45
|
-
// License.
|
46
|
-
//
|
47
|
-
// The Original Code is the Public Suffix List.
|
48
|
-
//
|
49
|
-
// The Initial Developer of the Original Code is
|
50
|
-
// Jo Hermans <jo.hermans@gmail.com>.
|
51
|
-
// Portions created by the Initial Developer are Copyright (C) 2007
|
52
|
-
// the Initial Developer. All Rights Reserved.
|
53
|
-
//
|
54
|
-
// Contributor(s):
|
55
|
-
// Ruben Arakelyan <ruben@rubenarakelyan.com>
|
56
|
-
// Gervase Markham <gerv@gerv.net>
|
57
|
-
// Pamela Greene <pamg.bugs@gmail.com>
|
58
|
-
// David Triendl <david@triendl.name>
|
59
|
-
// Jothan Frakes <jothan@gmail.com>
|
60
|
-
// The kind representatives of many TLD registries
|
61
|
-
//
|
62
|
-
// Alternatively, the contents of this file may be used under the terms of
|
63
|
-
// either the GNU General Public License Version 2 or later (the "GPL"), or
|
64
|
-
// the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
65
|
-
// in which case the provisions of the GPL or the LGPL are applicable instead
|
66
|
-
// of those above. If you wish to allow use of your version of this file only
|
67
|
-
// under the terms of either the GPL or the LGPL, and not to allow others to
|
68
|
-
// use your version of this file under the terms of the MPL, indicate your
|
69
|
-
// decision by deleting the provisions above and replace them with the notice
|
70
|
-
// and other provisions required by the GPL or the LGPL. If you do not delete
|
71
|
-
// the provisions above, a recipient may use your version of this file under
|
72
|
-
// the terms of any one of the MPL, the GPL or the LGPL.
|
73
|
-
//
|
74
|
-
// ***** END LICENSE BLOCK *****
|
@@ -1,293 +0,0 @@
|
|
1
|
-
/*!
|
2
|
-
* Copyright (c) 2015, Salesforce.com, Inc.
|
3
|
-
* All rights reserved.
|
4
|
-
*
|
5
|
-
* Redistribution and use in source and binary forms, with or without
|
6
|
-
* modification, are permitted provided that the following conditions are met:
|
7
|
-
*
|
8
|
-
* 1. Redistributions of source code must retain the above copyright notice,
|
9
|
-
* this list of conditions and the following disclaimer.
|
10
|
-
*
|
11
|
-
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
12
|
-
* this list of conditions and the following disclaimer in the documentation
|
13
|
-
* and/or other materials provided with the distribution.
|
14
|
-
*
|
15
|
-
* 3. Neither the name of Salesforce.com nor the names of its contributors may
|
16
|
-
* be used to endorse or promote products derived from this software without
|
17
|
-
* specific prior written permission.
|
18
|
-
*
|
19
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20
|
-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
22
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
23
|
-
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
24
|
-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
25
|
-
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
26
|
-
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
27
|
-
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
28
|
-
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
29
|
-
* POSSIBILITY OF SUCH DAMAGE.
|
30
|
-
*/
|
31
|
-
'use strict';
|
32
|
-
var fs = require('fs');
|
33
|
-
var assert = require('assert');
|
34
|
-
var punycode = require('punycode');
|
35
|
-
|
36
|
-
fs.readFile('./public-suffix.txt', 'utf8', function(err,string) {
|
37
|
-
if (err) {
|
38
|
-
throw err;
|
39
|
-
}
|
40
|
-
var lines = string.split("\n");
|
41
|
-
process.nextTick(function() {
|
42
|
-
processList(lines);
|
43
|
-
});
|
44
|
-
});
|
45
|
-
|
46
|
-
var index = {};
|
47
|
-
|
48
|
-
var COMMENT = new RegExp('//.+');
|
49
|
-
function processList(lines) {
|
50
|
-
while (lines.length) {
|
51
|
-
var line = lines.shift();
|
52
|
-
line = line.replace(COMMENT,'').trim();
|
53
|
-
if (!line) {
|
54
|
-
continue;
|
55
|
-
}
|
56
|
-
addToIndex(index,line);
|
57
|
-
}
|
58
|
-
|
59
|
-
pubSufTest();
|
60
|
-
|
61
|
-
var w = fs.createWriteStream('./lib/pubsuffix.js',{
|
62
|
-
flags: 'w',
|
63
|
-
encoding: 'utf8',
|
64
|
-
mode: parseInt('644',8)
|
65
|
-
});
|
66
|
-
w.on('end', process.exit);
|
67
|
-
w.write("/****************************************************\n");
|
68
|
-
w.write(" * AUTOMATICALLY GENERATED by generate-pubsuffix.js *\n");
|
69
|
-
w.write(" * DO NOT EDIT! *\n");
|
70
|
-
w.write(" ****************************************************/\n\n");
|
71
|
-
|
72
|
-
w.write('"use strict";\n\n');
|
73
|
-
w.write("var punycode = require('punycode');\n\n");
|
74
|
-
|
75
|
-
w.write("module.exports.getPublicSuffix = ");
|
76
|
-
w.write(getPublicSuffix.toString());
|
77
|
-
w.write(";\n\n");
|
78
|
-
|
79
|
-
w.write("// The following generated structure is used under the MPL version 1.1\n");
|
80
|
-
w.write("// See public-suffix.txt for more information\n\n");
|
81
|
-
w.write("var index = module.exports.index = Object.freeze(\n");
|
82
|
-
w.write(JSON.stringify(index));
|
83
|
-
w.write(");\n\n");
|
84
|
-
w.write("// END of automatically generated file\n");
|
85
|
-
|
86
|
-
w.end();
|
87
|
-
}
|
88
|
-
|
89
|
-
function addToIndex(index,line) {
|
90
|
-
var prefix = '';
|
91
|
-
if (line.replace(/^(!|\*\.)/)) {
|
92
|
-
prefix = RegExp.$1;
|
93
|
-
line = line.slice(prefix.length);
|
94
|
-
}
|
95
|
-
line = prefix + punycode.toASCII(line);
|
96
|
-
|
97
|
-
if (line.substr(0,1) == '!') {
|
98
|
-
index[line.substr(1)] = false;
|
99
|
-
} else {
|
100
|
-
index[line] = true;
|
101
|
-
}
|
102
|
-
}
|
103
|
-
|
104
|
-
// include the licence in the function since it gets written to pubsuffix.js
|
105
|
-
function getPublicSuffix(domain) {
|
106
|
-
/*!
|
107
|
-
* Copyright (c) 2015, Salesforce.com, Inc.
|
108
|
-
* All rights reserved.
|
109
|
-
*
|
110
|
-
* Redistribution and use in source and binary forms, with or without
|
111
|
-
* modification, are permitted provided that the following conditions are met:
|
112
|
-
*
|
113
|
-
* 1. Redistributions of source code must retain the above copyright notice,
|
114
|
-
* this list of conditions and the following disclaimer.
|
115
|
-
*
|
116
|
-
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
117
|
-
* this list of conditions and the following disclaimer in the documentation
|
118
|
-
* and/or other materials provided with the distribution.
|
119
|
-
*
|
120
|
-
* 3. Neither the name of Salesforce.com nor the names of its contributors may
|
121
|
-
* be used to endorse or promote products derived from this software without
|
122
|
-
* specific prior written permission.
|
123
|
-
*
|
124
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
125
|
-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
126
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
127
|
-
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
128
|
-
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
129
|
-
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
130
|
-
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
131
|
-
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
132
|
-
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
133
|
-
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
134
|
-
* POSSIBILITY OF SUCH DAMAGE.
|
135
|
-
*/
|
136
|
-
if (!domain) {
|
137
|
-
return null;
|
138
|
-
}
|
139
|
-
if (domain.match(/^\./)) {
|
140
|
-
return null;
|
141
|
-
}
|
142
|
-
var asciiDomain = punycode.toASCII(domain);
|
143
|
-
var converted = false;
|
144
|
-
if (asciiDomain !== domain) {
|
145
|
-
domain = asciiDomain;
|
146
|
-
converted = true;
|
147
|
-
}
|
148
|
-
if (index[domain]) {
|
149
|
-
return null;
|
150
|
-
}
|
151
|
-
|
152
|
-
domain = domain.toLowerCase();
|
153
|
-
var parts = domain.split('.').reverse();
|
154
|
-
|
155
|
-
var suffix = '';
|
156
|
-
var suffixLen = 0;
|
157
|
-
for (var i=0; i<parts.length; i++) {
|
158
|
-
var part = parts[i];
|
159
|
-
var starstr = '*'+suffix;
|
160
|
-
var partstr = part+suffix;
|
161
|
-
|
162
|
-
if (index[starstr]) { // star rule matches
|
163
|
-
suffixLen = i+1;
|
164
|
-
if (index[partstr] === false) { // exception rule matches (NB: false, not undefined)
|
165
|
-
suffixLen--;
|
166
|
-
}
|
167
|
-
} else if (index[partstr]) { // exact match, not exception
|
168
|
-
suffixLen = i+1;
|
169
|
-
}
|
170
|
-
|
171
|
-
suffix = '.'+partstr;
|
172
|
-
}
|
173
|
-
|
174
|
-
if (index['*'+suffix]) { // *.domain exists (e.g. *.kyoto.jp for domain='kyoto.jp');
|
175
|
-
return null;
|
176
|
-
}
|
177
|
-
|
178
|
-
suffixLen = suffixLen || 1;
|
179
|
-
if (parts.length > suffixLen) {
|
180
|
-
var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.');
|
181
|
-
return converted ? punycode.toUnicode(publicSuffix) : publicSuffix;
|
182
|
-
}
|
183
|
-
|
184
|
-
return null;
|
185
|
-
}
|
186
|
-
|
187
|
-
function checkPublicSuffix(give,get) {
|
188
|
-
var got = getPublicSuffix(give);
|
189
|
-
assert.equal(got, get, give+' should be '+(get==null?'NULL':get)+' but got '+got);
|
190
|
-
}
|
191
|
-
|
192
|
-
// pubSufTest() was converted to JavaScript from http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt?raw=1
|
193
|
-
function pubSufTest() {
|
194
|
-
// For this function-scope and this function-scope ONLY:
|
195
|
-
// Any copyright is dedicated to the Public Domain.
|
196
|
-
// http://creativecommons.org/publicdomain/zero/1.0/
|
197
|
-
|
198
|
-
// NULL input.
|
199
|
-
checkPublicSuffix(null, null);
|
200
|
-
// Mixed case.
|
201
|
-
checkPublicSuffix('COM', null);
|
202
|
-
checkPublicSuffix('example.COM', 'example.com');
|
203
|
-
checkPublicSuffix('WwW.example.COM', 'example.com');
|
204
|
-
// Leading dot.
|
205
|
-
checkPublicSuffix('.com', null);
|
206
|
-
checkPublicSuffix('.example', null);
|
207
|
-
checkPublicSuffix('.example.com', null);
|
208
|
-
checkPublicSuffix('.example.example', null);
|
209
|
-
// Unlisted TLD.
|
210
|
-
checkPublicSuffix('example', null);
|
211
|
-
checkPublicSuffix('example.example', 'example.example');
|
212
|
-
checkPublicSuffix('b.example.example', 'example.example');
|
213
|
-
checkPublicSuffix('a.b.example.example', 'example.example');
|
214
|
-
// Listed, but non-Internet, TLD.
|
215
|
-
//checkPublicSuffix('local', null);
|
216
|
-
//checkPublicSuffix('example.local', null);
|
217
|
-
//checkPublicSuffix('b.example.local', null);
|
218
|
-
//checkPublicSuffix('a.b.example.local', null);
|
219
|
-
// TLD with only 1 rule.
|
220
|
-
checkPublicSuffix('biz', null);
|
221
|
-
checkPublicSuffix('domain.biz', 'domain.biz');
|
222
|
-
checkPublicSuffix('b.domain.biz', 'domain.biz');
|
223
|
-
checkPublicSuffix('a.b.domain.biz', 'domain.biz');
|
224
|
-
// TLD with some 2-level rules.
|
225
|
-
checkPublicSuffix('com', null);
|
226
|
-
checkPublicSuffix('example.com', 'example.com');
|
227
|
-
checkPublicSuffix('b.example.com', 'example.com');
|
228
|
-
checkPublicSuffix('a.b.example.com', 'example.com');
|
229
|
-
checkPublicSuffix('uk.com', null);
|
230
|
-
checkPublicSuffix('example.uk.com', 'example.uk.com');
|
231
|
-
checkPublicSuffix('b.example.uk.com', 'example.uk.com');
|
232
|
-
checkPublicSuffix('a.b.example.uk.com', 'example.uk.com');
|
233
|
-
checkPublicSuffix('test.ac', 'test.ac');
|
234
|
-
// TLD with only 1 (wildcard) rule.
|
235
|
-
checkPublicSuffix('cy', null);
|
236
|
-
checkPublicSuffix('c.cy', null);
|
237
|
-
checkPublicSuffix('b.c.cy', 'b.c.cy');
|
238
|
-
checkPublicSuffix('a.b.c.cy', 'b.c.cy');
|
239
|
-
// More complex TLD.
|
240
|
-
checkPublicSuffix('jp', null);
|
241
|
-
checkPublicSuffix('test.jp', 'test.jp');
|
242
|
-
checkPublicSuffix('www.test.jp', 'test.jp');
|
243
|
-
checkPublicSuffix('ac.jp', null);
|
244
|
-
checkPublicSuffix('test.ac.jp', 'test.ac.jp');
|
245
|
-
checkPublicSuffix('www.test.ac.jp', 'test.ac.jp');
|
246
|
-
checkPublicSuffix('kyoto.jp', null);
|
247
|
-
checkPublicSuffix('test.kyoto.jp', 'test.kyoto.jp');
|
248
|
-
checkPublicSuffix('ide.kyoto.jp', null);
|
249
|
-
checkPublicSuffix('b.ide.kyoto.jp', 'b.ide.kyoto.jp');
|
250
|
-
checkPublicSuffix('a.b.ide.kyoto.jp', 'b.ide.kyoto.jp');
|
251
|
-
checkPublicSuffix('c.kobe.jp', null);
|
252
|
-
checkPublicSuffix('b.c.kobe.jp', 'b.c.kobe.jp');
|
253
|
-
checkPublicSuffix('a.b.c.kobe.jp', 'b.c.kobe.jp');
|
254
|
-
checkPublicSuffix('city.kobe.jp', 'city.kobe.jp');
|
255
|
-
checkPublicSuffix('www.city.kobe.jp', 'city.kobe.jp');
|
256
|
-
// TLD with a wildcard rule and exceptions.
|
257
|
-
checkPublicSuffix('ck', null);
|
258
|
-
checkPublicSuffix('test.ck', null);
|
259
|
-
checkPublicSuffix('b.test.ck', 'b.test.ck');
|
260
|
-
checkPublicSuffix('a.b.test.ck', 'b.test.ck');
|
261
|
-
checkPublicSuffix('www.ck', 'www.ck');
|
262
|
-
checkPublicSuffix('www.www.ck', 'www.ck');
|
263
|
-
// US K12.
|
264
|
-
checkPublicSuffix('us', null);
|
265
|
-
checkPublicSuffix('test.us', 'test.us');
|
266
|
-
checkPublicSuffix('www.test.us', 'test.us');
|
267
|
-
checkPublicSuffix('ak.us', null);
|
268
|
-
checkPublicSuffix('test.ak.us', 'test.ak.us');
|
269
|
-
checkPublicSuffix('www.test.ak.us', 'test.ak.us');
|
270
|
-
checkPublicSuffix('k12.ak.us', null);
|
271
|
-
checkPublicSuffix('test.k12.ak.us', 'test.k12.ak.us');
|
272
|
-
checkPublicSuffix('www.test.k12.ak.us', 'test.k12.ak.us');
|
273
|
-
// IDN labels.
|
274
|
-
checkPublicSuffix('食狮.com.cn', '食狮.com.cn');
|
275
|
-
checkPublicSuffix('食狮.公司.cn', '食狮.公司.cn');
|
276
|
-
checkPublicSuffix('www.食狮.公司.cn', '食狮.公司.cn');
|
277
|
-
checkPublicSuffix('shishi.公司.cn', 'shishi.公司.cn');
|
278
|
-
checkPublicSuffix('公司.cn', null);
|
279
|
-
checkPublicSuffix('食狮.中国', '食狮.中国');
|
280
|
-
checkPublicSuffix('www.食狮.中国', '食狮.中国');
|
281
|
-
checkPublicSuffix('shishi.中国', 'shishi.中国');
|
282
|
-
checkPublicSuffix('中国', null);
|
283
|
-
// Same as above, but punycoded.
|
284
|
-
checkPublicSuffix('xn--85x722f.com.cn', 'xn--85x722f.com.cn');
|
285
|
-
checkPublicSuffix('xn--85x722f.xn--55qx5d.cn', 'xn--85x722f.xn--55qx5d.cn');
|
286
|
-
checkPublicSuffix('www.xn--85x722f.xn--55qx5d.cn', 'xn--85x722f.xn--55qx5d.cn');
|
287
|
-
checkPublicSuffix('shishi.xn--55qx5d.cn', 'shishi.xn--55qx5d.cn');
|
288
|
-
checkPublicSuffix('xn--55qx5d.cn', null);
|
289
|
-
checkPublicSuffix('xn--85x722f.xn--fiqs8s', 'xn--85x722f.xn--fiqs8s');
|
290
|
-
checkPublicSuffix('www.xn--85x722f.xn--fiqs8s', 'xn--85x722f.xn--fiqs8s');
|
291
|
-
checkPublicSuffix('shishi.xn--fiqs8s', 'shishi.xn--fiqs8s');
|
292
|
-
checkPublicSuffix('xn--fiqs8s', null);
|
293
|
-
}
|