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,164 +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
|
-
|
32
|
-
'use strict';
|
33
|
-
var vows = require('vows');
|
34
|
-
var assert = require('assert');
|
35
|
-
var tough = require('../lib/cookie');
|
36
|
-
var Cookie = tough.Cookie;
|
37
|
-
|
38
|
-
vows
|
39
|
-
.describe('Cookie.toJSON()')
|
40
|
-
.addBatch({
|
41
|
-
"JSON": {
|
42
|
-
"serialization": {
|
43
|
-
topic: function() {
|
44
|
-
var c = Cookie.parse('alpha=beta; Domain=example.com; Path=/foo; Expires=Tue, 19 Jan 2038 03:14:07 GMT; HttpOnly');
|
45
|
-
return JSON.stringify(c);
|
46
|
-
},
|
47
|
-
"gives a string": function(str) {
|
48
|
-
assert.equal(typeof str, "string");
|
49
|
-
},
|
50
|
-
"date is in ISO format": function(str) {
|
51
|
-
assert.match(str, /"expires":"2038-01-19T03:14:07\.000Z"/, 'expires is in ISO format');
|
52
|
-
}
|
53
|
-
},
|
54
|
-
"deserialization": {
|
55
|
-
topic: function() {
|
56
|
-
var json = '{"key":"alpha","value":"beta","domain":"example.com","path":"/foo","expires":"2038-01-19T03:14:07.000Z","httpOnly":true,"lastAccessed":2000000000123}';
|
57
|
-
return Cookie.fromJSON(json);
|
58
|
-
},
|
59
|
-
"works": function(c) {
|
60
|
-
assert.ok(c);
|
61
|
-
},
|
62
|
-
"key": function(c) { assert.equal(c.key, "alpha") },
|
63
|
-
"value": function(c) { assert.equal(c.value, "beta") },
|
64
|
-
"domain": function(c) { assert.equal(c.domain, "example.com") },
|
65
|
-
"path": function(c) { assert.equal(c.path, "/foo") },
|
66
|
-
"httpOnly": function(c) { assert.strictEqual(c.httpOnly, true) },
|
67
|
-
"secure": function(c) { assert.strictEqual(c.secure, false) },
|
68
|
-
"hostOnly": function(c) { assert.strictEqual(c.hostOnly, null) },
|
69
|
-
"expires is a date object": function(c) {
|
70
|
-
assert.equal(c.expires.getTime(), 2147483647000);
|
71
|
-
},
|
72
|
-
"lastAccessed is a date object": function(c) {
|
73
|
-
assert.equal(c.lastAccessed.getTime(), 2000000000123);
|
74
|
-
},
|
75
|
-
"creation defaulted": function(c) {
|
76
|
-
assert.ok(c.creation.getTime());
|
77
|
-
}
|
78
|
-
},
|
79
|
-
"null deserialization": {
|
80
|
-
topic: function() {
|
81
|
-
return Cookie.fromJSON(null);
|
82
|
-
},
|
83
|
-
"is null": function(cookie) {
|
84
|
-
assert.equal(cookie,null);
|
85
|
-
}
|
86
|
-
}
|
87
|
-
},
|
88
|
-
"expiry deserialization": {
|
89
|
-
"Infinity": {
|
90
|
-
topic: Cookie.fromJSON.bind(null, '{"expires":"Infinity"}'),
|
91
|
-
"is infinite": function(c) {
|
92
|
-
assert.strictEqual(c.expires, "Infinity");
|
93
|
-
assert.equal(c.expires, Infinity);
|
94
|
-
}
|
95
|
-
}
|
96
|
-
},
|
97
|
-
"maxAge serialization": {
|
98
|
-
topic: function() {
|
99
|
-
return function(toSet) {
|
100
|
-
var c = new Cookie();
|
101
|
-
c.key = 'foo'; c.value = 'bar';
|
102
|
-
c.setMaxAge(toSet);
|
103
|
-
return JSON.stringify(c);
|
104
|
-
};
|
105
|
-
},
|
106
|
-
"zero": {
|
107
|
-
topic: function(f) { return f(0) },
|
108
|
-
"looks good": function(str) {
|
109
|
-
assert.match(str, /"maxAge":0/);
|
110
|
-
}
|
111
|
-
},
|
112
|
-
"Infinity": {
|
113
|
-
topic: function(f) { return f(Infinity) },
|
114
|
-
"looks good": function(str) {
|
115
|
-
assert.match(str, /"maxAge":"Infinity"/);
|
116
|
-
}
|
117
|
-
},
|
118
|
-
"-Infinity": {
|
119
|
-
topic: function(f) { return f(-Infinity) },
|
120
|
-
"looks good": function(str) {
|
121
|
-
assert.match(str, /"maxAge":"-Infinity"/);
|
122
|
-
}
|
123
|
-
},
|
124
|
-
"null": {
|
125
|
-
topic: function(f) { return f(null) },
|
126
|
-
"absent": function(str) {
|
127
|
-
assert.match(str, /(?!"maxAge":null)/); // NB: negative RegExp
|
128
|
-
}
|
129
|
-
}
|
130
|
-
},
|
131
|
-
"maxAge deserialization": {
|
132
|
-
"number": {
|
133
|
-
topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":123}'),
|
134
|
-
"is the number": function(c) {
|
135
|
-
assert.strictEqual(c.maxAge, 123);
|
136
|
-
}
|
137
|
-
},
|
138
|
-
"null": {
|
139
|
-
topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":null}'),
|
140
|
-
"is null": function(c) {
|
141
|
-
assert.strictEqual(c.maxAge, null);
|
142
|
-
}
|
143
|
-
},
|
144
|
-
"less than zero": {
|
145
|
-
topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":-123}'),
|
146
|
-
"is -123": function(c) {
|
147
|
-
assert.strictEqual(c.maxAge, -123);
|
148
|
-
}
|
149
|
-
},
|
150
|
-
"Infinity": {
|
151
|
-
topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":"Infinity"}'),
|
152
|
-
"is inf-as-string": function(c) {
|
153
|
-
assert.strictEqual(c.maxAge, "Infinity");
|
154
|
-
}
|
155
|
-
},
|
156
|
-
"-Infinity": {
|
157
|
-
topic: Cookie.fromJSON.bind(null,'{"key":"foo","value":"bar","maxAge":"-Infinity"}'),
|
158
|
-
"is inf-as-string": function(c) {
|
159
|
-
assert.strictEqual(c.maxAge, "-Infinity");
|
160
|
-
}
|
161
|
-
}
|
162
|
-
}
|
163
|
-
})
|
164
|
-
.export(module);
|
@@ -1,162 +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
|
-
|
32
|
-
'use strict';
|
33
|
-
var vows = require('vows');
|
34
|
-
var assert = require('assert');
|
35
|
-
var tough = require('../lib/cookie');
|
36
|
-
var Cookie = tough.Cookie;
|
37
|
-
|
38
|
-
vows
|
39
|
-
.describe('Cookie.toString()')
|
40
|
-
.addBatch({
|
41
|
-
"a simple cookie": {
|
42
|
-
topic: function () {
|
43
|
-
var c = new Cookie();
|
44
|
-
c.key = 'a';
|
45
|
-
c.value = 'b';
|
46
|
-
return c;
|
47
|
-
},
|
48
|
-
"validates": function (c) {
|
49
|
-
assert.ok(c.validate());
|
50
|
-
},
|
51
|
-
"to string": function (c) {
|
52
|
-
assert.equal(c.toString(), 'a=b');
|
53
|
-
}
|
54
|
-
},
|
55
|
-
"a cookie with spaces in the value": {
|
56
|
-
topic: function () {
|
57
|
-
var c = new Cookie();
|
58
|
-
c.key = 'a';
|
59
|
-
c.value = 'beta gamma';
|
60
|
-
return c;
|
61
|
-
},
|
62
|
-
"doesn't validate": function (c) {
|
63
|
-
assert.ok(!c.validate());
|
64
|
-
},
|
65
|
-
"'garbage in, garbage out'": function (c) {
|
66
|
-
assert.equal(c.toString(), 'a=beta gamma');
|
67
|
-
}
|
68
|
-
},
|
69
|
-
"with an empty value and HttpOnly": {
|
70
|
-
topic: function () {
|
71
|
-
var c = new Cookie();
|
72
|
-
c.key = 'a';
|
73
|
-
c.httpOnly = true;
|
74
|
-
return c;
|
75
|
-
},
|
76
|
-
"to string": function (c) {
|
77
|
-
assert.equal(c.toString(), 'a=; HttpOnly');
|
78
|
-
}
|
79
|
-
},
|
80
|
-
"with an expiry": {
|
81
|
-
topic: function () {
|
82
|
-
var c = new Cookie();
|
83
|
-
c.key = 'a';
|
84
|
-
c.value = 'b';
|
85
|
-
c.setExpires("Oct 18 2011 07:05:03 GMT");
|
86
|
-
return c;
|
87
|
-
},
|
88
|
-
"validates": function (c) {
|
89
|
-
assert.ok(c.validate());
|
90
|
-
},
|
91
|
-
"to string": function (c) {
|
92
|
-
assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT');
|
93
|
-
},
|
94
|
-
"to short string": function (c) {
|
95
|
-
assert.equal(c.cookieString(), 'a=b');
|
96
|
-
}
|
97
|
-
},
|
98
|
-
"with a max-age": {
|
99
|
-
topic: function () {
|
100
|
-
var c = new Cookie();
|
101
|
-
c.key = 'a';
|
102
|
-
c.value = 'b';
|
103
|
-
c.setExpires("Oct 18 2011 07:05:03 GMT");
|
104
|
-
c.maxAge = 12345;
|
105
|
-
return c;
|
106
|
-
},
|
107
|
-
"validates": function (c) {
|
108
|
-
assert.ok(c.validate()); // mabe this one *shouldn't*?
|
109
|
-
},
|
110
|
-
"to string": function (c) {
|
111
|
-
assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Max-Age=12345');
|
112
|
-
}
|
113
|
-
},
|
114
|
-
"with a bunch of things": function () {
|
115
|
-
var c = new Cookie();
|
116
|
-
c.key = 'a';
|
117
|
-
c.value = 'b';
|
118
|
-
c.setExpires("Oct 18 2011 07:05:03 GMT");
|
119
|
-
c.maxAge = 12345;
|
120
|
-
c.domain = 'example.com';
|
121
|
-
c.path = '/foo';
|
122
|
-
c.secure = true;
|
123
|
-
c.httpOnly = true;
|
124
|
-
c.extensions = ['MyExtension'];
|
125
|
-
assert.equal(c.toString(), 'a=b; Expires=Tue, 18 Oct 2011 07:05:03 GMT; Max-Age=12345; Domain=example.com; Path=/foo; Secure; HttpOnly; MyExtension');
|
126
|
-
},
|
127
|
-
"a host-only cookie": {
|
128
|
-
topic: function () {
|
129
|
-
var c = new Cookie();
|
130
|
-
c.key = 'a';
|
131
|
-
c.value = 'b';
|
132
|
-
c.hostOnly = true;
|
133
|
-
c.domain = 'shouldnt-stringify.example.com';
|
134
|
-
c.path = '/should-stringify';
|
135
|
-
return c;
|
136
|
-
},
|
137
|
-
"validates": function (c) {
|
138
|
-
assert.ok(c.validate());
|
139
|
-
},
|
140
|
-
"to string": function (c) {
|
141
|
-
assert.equal(c.toString(), 'a=b; Path=/should-stringify');
|
142
|
-
}
|
143
|
-
},
|
144
|
-
"minutes are '10'": {
|
145
|
-
topic: function () {
|
146
|
-
var c = new Cookie();
|
147
|
-
c.key = 'a';
|
148
|
-
c.value = 'b';
|
149
|
-
c.expires = new Date(1284113410000);
|
150
|
-
return c;
|
151
|
-
},
|
152
|
-
"validates": function (c) {
|
153
|
-
assert.ok(c.validate());
|
154
|
-
},
|
155
|
-
"to string": function (c) {
|
156
|
-
var str = c.toString();
|
157
|
-
assert.notEqual(str, 'a=b; Expires=Fri, 010 Sep 2010 010:010:010 GMT');
|
158
|
-
assert.equal(str, 'a=b; Expires=Fri, 10 Sep 2010 10:10:10 GMT');
|
159
|
-
}
|
160
|
-
}
|
161
|
-
})
|
162
|
-
.export(module);
|
package/node_modules/node-pre-gyp/node_modules/request/node_modules/tough-cookie/test/date_test.js
DELETED
@@ -1,79 +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
|
-
|
32
|
-
'use strict';
|
33
|
-
var vows = require('vows');
|
34
|
-
var assert = require('assert');
|
35
|
-
var tough = require('../lib/cookie');
|
36
|
-
|
37
|
-
function dateVows(table) {
|
38
|
-
var theVows = {};
|
39
|
-
Object.keys(table).forEach(function (date) {
|
40
|
-
var expect = table[date];
|
41
|
-
theVows[date] = function () {
|
42
|
-
var got = tough.parseDate(date) ? 'valid' : 'invalid';
|
43
|
-
assert.equal(got, expect ? 'valid' : 'invalid');
|
44
|
-
};
|
45
|
-
});
|
46
|
-
return {"date parsing": theVows};
|
47
|
-
}
|
48
|
-
|
49
|
-
vows
|
50
|
-
.describe('Date')
|
51
|
-
.addBatch(dateVows({
|
52
|
-
"Wed, 09 Jun 2021 10:18:14 GMT": true,
|
53
|
-
"Wed, 09 Jun 2021 22:18:14 GMT": true,
|
54
|
-
"Tue, 18 Oct 2011 07:42:42.123 GMT": true,
|
55
|
-
"18 Oct 2011 07:42:42 GMT": true,
|
56
|
-
"8 Oct 2011 7:42:42 GMT": true,
|
57
|
-
"8 Oct 2011 7:2:42 GMT": true,
|
58
|
-
"Oct 18 2011 07:42:42 GMT": true,
|
59
|
-
"Tue Oct 18 2011 07:05:03 GMT+0000 (GMT)": true,
|
60
|
-
"09 Jun 2021 10:18:14 GMT": true,
|
61
|
-
"99 Jix 3038 48:86:72 ZMT": false,
|
62
|
-
'01 Jan 1970 00:00:00 GMT': true,
|
63
|
-
'01 Jan 1600 00:00:00 GMT': false, // before 1601
|
64
|
-
'01 Jan 1601 00:00:00 GMT': true,
|
65
|
-
'10 Feb 81 13:00:00 GMT': true, // implicit year
|
66
|
-
'Thu, 17-Apr-2014 02:12:29 GMT': true, // dashes
|
67
|
-
'Thu, 17-Apr-2014 02:12:29 UTC': true // dashes and UTC
|
68
|
-
}))
|
69
|
-
.addBatch({
|
70
|
-
"strict date parse of Thu, 01 Jan 1970 00:00:010 GMT": {
|
71
|
-
topic: function () {
|
72
|
-
return tough.parseDate('Thu, 01 Jan 1970 00:00:010 GMT', true) ? true : false;
|
73
|
-
},
|
74
|
-
"invalid": function (date) {
|
75
|
-
assert.equal(date, false);
|
76
|
-
}
|
77
|
-
}
|
78
|
-
})
|
79
|
-
.export(module);
|
@@ -1,201 +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
|
-
|
32
|
-
'use strict';
|
33
|
-
var vows = require('vows');
|
34
|
-
var assert = require('assert');
|
35
|
-
var tough = require('../lib/cookie');
|
36
|
-
var Cookie = tough.Cookie;
|
37
|
-
|
38
|
-
function matchVows(func, table) {
|
39
|
-
var theVows = {};
|
40
|
-
table.forEach(function (item) {
|
41
|
-
var str = item[0];
|
42
|
-
var dom = item[1];
|
43
|
-
var expect = item[2];
|
44
|
-
var label = str + (expect ? " matches " : " doesn't match ") + dom;
|
45
|
-
theVows[label] = function () {
|
46
|
-
assert.equal(func(str, dom), expect);
|
47
|
-
};
|
48
|
-
});
|
49
|
-
return theVows;
|
50
|
-
}
|
51
|
-
|
52
|
-
function defaultPathVows(table) {
|
53
|
-
var theVows = {};
|
54
|
-
table.forEach(function (item) {
|
55
|
-
var str = item[0];
|
56
|
-
var expect = item[1];
|
57
|
-
var label = str + " gives " + expect;
|
58
|
-
theVows[label] = function () {
|
59
|
-
assert.equal(tough.defaultPath(str), expect);
|
60
|
-
};
|
61
|
-
});
|
62
|
-
return theVows;
|
63
|
-
}
|
64
|
-
|
65
|
-
vows
|
66
|
-
.describe('Domain and Path')
|
67
|
-
.addBatch({
|
68
|
-
"domain normalization": {
|
69
|
-
"simple": function () {
|
70
|
-
var c = new Cookie();
|
71
|
-
c.domain = "EXAMPLE.com";
|
72
|
-
assert.equal(c.canonicalizedDomain(), "example.com");
|
73
|
-
},
|
74
|
-
"extra dots": function () {
|
75
|
-
var c = new Cookie();
|
76
|
-
c.domain = ".EXAMPLE.com";
|
77
|
-
assert.equal(c.cdomain(), "example.com");
|
78
|
-
},
|
79
|
-
"weird trailing dot": function () {
|
80
|
-
var c = new Cookie();
|
81
|
-
c.domain = "EXAMPLE.ca.";
|
82
|
-
assert.equal(c.canonicalizedDomain(), "example.ca.");
|
83
|
-
},
|
84
|
-
"weird internal dots": function () {
|
85
|
-
var c = new Cookie();
|
86
|
-
c.domain = "EXAMPLE...ca.";
|
87
|
-
assert.equal(c.canonicalizedDomain(), "example...ca.");
|
88
|
-
},
|
89
|
-
"IDN": function () {
|
90
|
-
var c = new Cookie();
|
91
|
-
c.domain = "δοκιμή.δοκιμή"; // "test.test" in greek
|
92
|
-
assert.equal(c.canonicalizedDomain(), "xn--jxalpdlp.xn--jxalpdlp");
|
93
|
-
}
|
94
|
-
}
|
95
|
-
})
|
96
|
-
.addBatch({
|
97
|
-
"Domain Match": matchVows(tough.domainMatch, [
|
98
|
-
// str, dom, expect
|
99
|
-
["example.com", "example.com", true],
|
100
|
-
["eXaMpLe.cOm", "ExAmPlE.CoM", true],
|
101
|
-
["no.ca", "yes.ca", false],
|
102
|
-
["wwwexample.com", "example.com", false],
|
103
|
-
["www.example.com", "example.com", true],
|
104
|
-
["example.com", "www.example.com", false],
|
105
|
-
["www.subdom.example.com", "example.com", true],
|
106
|
-
["www.subdom.example.com", "subdom.example.com", true],
|
107
|
-
["example.com", "example.com.", false], // RFC6265 S4.1.2.3
|
108
|
-
["192.168.0.1", "168.0.1", false], // S5.1.3 "The string is a host name"
|
109
|
-
[null, "example.com", null],
|
110
|
-
["example.com", null, null],
|
111
|
-
[null, null, null],
|
112
|
-
[undefined, undefined, null],
|
113
|
-
])
|
114
|
-
})
|
115
|
-
|
116
|
-
.addBatch({
|
117
|
-
"default-path": defaultPathVows([
|
118
|
-
[null, "/"],
|
119
|
-
["/", "/"],
|
120
|
-
["/file", "/"],
|
121
|
-
["/dir/file", "/dir"],
|
122
|
-
["noslash", "/"],
|
123
|
-
])
|
124
|
-
})
|
125
|
-
.addBatch({
|
126
|
-
"Path-Match": matchVows(tough.pathMatch, [
|
127
|
-
// request, cookie, match
|
128
|
-
["/", "/", true],
|
129
|
-
["/dir", "/", true],
|
130
|
-
["/", "/dir", false],
|
131
|
-
["/dir/", "/dir/", true],
|
132
|
-
["/dir/file", "/dir/", true],
|
133
|
-
["/dir/file", "/dir", true],
|
134
|
-
["/directory", "/dir", false],
|
135
|
-
])
|
136
|
-
})
|
137
|
-
.addBatch({
|
138
|
-
"permuteDomain": {
|
139
|
-
"base case": {
|
140
|
-
topic: tough.permuteDomain.bind(null, 'example.com'),
|
141
|
-
"got the domain": function (list) {
|
142
|
-
assert.deepEqual(list, ['example.com']);
|
143
|
-
}
|
144
|
-
},
|
145
|
-
"two levels": {
|
146
|
-
topic: tough.permuteDomain.bind(null, 'foo.bar.example.com'),
|
147
|
-
"got three things": function (list) {
|
148
|
-
assert.deepEqual(list, ['example.com', 'bar.example.com', 'foo.bar.example.com']);
|
149
|
-
}
|
150
|
-
},
|
151
|
-
"local domain": {
|
152
|
-
topic: tough.permuteDomain.bind(null, 'foo.bar.example.localduhmain'),
|
153
|
-
"got three things": function (list) {
|
154
|
-
assert.deepEqual(list, ['example.localduhmain', 'bar.example.localduhmain', 'foo.bar.example.localduhmain']);
|
155
|
-
}
|
156
|
-
}
|
157
|
-
},
|
158
|
-
"permutePath": {
|
159
|
-
"base case": {
|
160
|
-
topic: tough.permutePath.bind(null, '/'),
|
161
|
-
"just slash": function (list) {
|
162
|
-
assert.deepEqual(list, ['/']);
|
163
|
-
}
|
164
|
-
},
|
165
|
-
"single case": {
|
166
|
-
topic: tough.permutePath.bind(null, '/foo'),
|
167
|
-
"two things": function (list) {
|
168
|
-
assert.deepEqual(list, ['/foo', '/']);
|
169
|
-
},
|
170
|
-
"path matching": function (list) {
|
171
|
-
list.forEach(function (e) {
|
172
|
-
assert.ok(tough.pathMatch('/foo', e));
|
173
|
-
});
|
174
|
-
}
|
175
|
-
},
|
176
|
-
"double case": {
|
177
|
-
topic: tough.permutePath.bind(null, '/foo/bar'),
|
178
|
-
"four things": function (list) {
|
179
|
-
assert.deepEqual(list, ['/foo/bar', '/foo', '/']);
|
180
|
-
},
|
181
|
-
"path matching": function (list) {
|
182
|
-
list.forEach(function (e) {
|
183
|
-
assert.ok(tough.pathMatch('/foo/bar', e));
|
184
|
-
});
|
185
|
-
}
|
186
|
-
},
|
187
|
-
"trailing slash": {
|
188
|
-
topic: tough.permutePath.bind(null, '/foo/bar/'),
|
189
|
-
"three things": function (list) {
|
190
|
-
assert.deepEqual(list, ['/foo/bar', '/foo', '/']);
|
191
|
-
},
|
192
|
-
"path matching": function (list) {
|
193
|
-
list.forEach(function (e) {
|
194
|
-
assert.ok(tough.pathMatch('/foo/bar/', e));
|
195
|
-
});
|
196
|
-
}
|
197
|
-
}
|
198
|
-
}
|
199
|
-
})
|
200
|
-
.export(module);
|
201
|
-
|