@feathersjs/client 5.0.0-pre.0 → 5.0.0-pre.15
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.
- package/CHANGELOG.md +229 -0
- package/README.md +2 -2
- package/dist/core.d.ts +1 -0
- package/dist/core.js +1861 -3627
- package/dist/core.js.map +1 -1
- package/dist/core.min.js +1 -1
- package/dist/feathers.d.ts +8 -0
- package/dist/feathers.js +5106 -5755
- package/dist/feathers.js.map +1 -1
- package/dist/feathers.min.js +1 -1
- package/package.json +44 -38
- package/src/core.ts +1 -0
- package/src/feathers.ts +13 -0
- package/.babelrc +0 -8
- package/.cache/lasso/default/6a3076a5/dependencyFingerprints/cache +0 -0
- package/.cache/lasso/default/6a3076a5/key +0 -1
- package/.cache/lasso/default/6a3076a5/lasso-require/inspect-/5d47a286cdceb98f64bf9128488dd355fde40e81/cache +0 -0
- package/.cache/lasso/default/7be4a25c/dependencyFingerprints/cache +0 -0
- package/.cache/lasso/default/7be4a25c/key +0 -1
- package/.cache/lasso/default/7be4a25c/lasso-require/inspect/cache +0 -0
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/filter-query.js +0 -1998
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/index.js +0 -694
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/service.js +0 -1636
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.0/lib/sort.js +0 -2259
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/filter-query.js +0 -98
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/index.js +0 -37
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/service.js +0 -94
- package/.mocha-puppeteer/test-page/@feathersjs/adapter-commons$4.5.1/lib/sort.js +0 -112
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/browser/test-run.js +0 -1
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/browser/test.js +0 -1037
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.0/dist/feathers.js +0 -78377
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/browser/test-run.js +0 -1
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/browser/test.js +0 -102
- package/.mocha-puppeteer/test-page/@feathersjs/client$4.5.1/dist/feathers.js +0 -5231
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/hooks.js +0 -2626
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/index.js +0 -540
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.0/lib/utils.js +0 -1991
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/hooks.js +0 -170
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/index.js +0 -17
- package/.mocha-puppeteer/test-page/@feathersjs/commons$4.5.1/lib/utils.js +0 -102
- package/.mocha-puppeteer/test-page/@feathersjs/errors$4.5.0/lib/index.js +0 -2262
- package/.mocha-puppeteer/test-page/@feathersjs/errors$4.5.1/lib/index.js +0 -251
- package/.mocha-puppeteer/test-page/@feathersjs/tests$4.5.0/lib/client.js +0 -1506
- package/.mocha-puppeteer/test-page/@feathersjs/tests$4.5.1/lib/client.js +0 -83
- package/.mocha-puppeteer/test-page/assert$1.5.0/assert.js +0 -508
- package/.mocha-puppeteer/test-page/debug$4.1.1/src/browser.js +0 -266
- package/.mocha-puppeteer/test-page/debug$4.1.1/src/common.js +0 -268
- package/.mocha-puppeteer/test-page/feathers-memory$4.1.0/lib/index.js +0 -143
- package/.mocha-puppeteer/test-page/inherits$2.0.1/inherits_browser.js +0 -25
- package/.mocha-puppeteer/test-page/lasso-modules-client$2.0.5/src/index.js +0 -592
- package/.mocha-puppeteer/test-page/lasso-modules-meta.js +0 -28
- package/.mocha-puppeteer/test-page/marko$4.18.35/src/runtime/components/boot-run.js +0 -1
- package/.mocha-puppeteer/test-page/marko$4.18.35/src/runtime/components/boot.js +0 -95
- package/.mocha-puppeteer/test-page/marko$4.18.42/src/runtime/components/boot-run.js +0 -1
- package/.mocha-puppeteer/test-page/marko$4.18.42/src/runtime/components/boot.js +0 -95
- package/.mocha-puppeteer/test-page/marko$4.19.0/src/runtime/components/boot-run.js +0 -1
- package/.mocha-puppeteer/test-page/marko$4.19.0/src/runtime/components/boot.js +0 -3
- package/.mocha-puppeteer/test-page/mocha$3.5.3/mocha.css +0 -326
- package/.mocha-puppeteer/test-page/mocha$3.5.3/mocha.js +0 -16590
- package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests-run.js +0 -1
- package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests.js +0 -53
- package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/setup-run.js +0 -1
- package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/setup.js +0 -10
- package/.mocha-puppeteer/test-page/ms$2.1.2/index.js +0 -164
- package/.mocha-puppeteer/test-page/object-assign$4.1.1/index.js +0 -92
- package/.mocha-puppeteer/test-page/process$0.11.10/browser.js +0 -186
- package/.mocha-puppeteer/test-page/sift$8.5.1/lib/index.js +0 -738
- package/.mocha-puppeteer/test-page/superagent$3.8.3/superagent.js +0 -2035
- package/.mocha-puppeteer/test-page/util$0.10.3/support/isBufferBrowser.js +0 -7
- package/.mocha-puppeteer/test-page/util$0.10.3/util.js +0 -588
- package/.nyc_output/coverage.json +0 -1
- package/authentication.js +0 -1
- package/dist/authentication.js +0 -2242
- package/dist/authentication.js.map +0 -1
- package/dist/authentication.min.js +0 -1
- package/dist/rest.js +0 -3287
- package/dist/rest.js.map +0 -1
- package/dist/rest.min.js +0 -1
- package/dist/socketio.js +0 -2384
- package/dist/socketio.js.map +0 -1
- package/dist/socketio.min.js +0 -1
- package/index.d.ts +0 -23
- package/index.js +0 -1
- package/rest.js +0 -1
- package/socketio.js +0 -1
- package/webpack.config.js +0 -69
package/.mocha-puppeteer/test-page/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests-run.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
$_mod.run("/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests");
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
$_mod.def("/mocha-puppeteer$0.14.0/lib/pages/test-page/run-tests", function(require, exports, module, __filename, __dirname) { const { mocha, Mocha, WebSocket, superagent, location } = window
|
|
2
|
-
const { hostname, port } = location
|
|
3
|
-
|
|
4
|
-
// end test if not started within one second
|
|
5
|
-
const testTimeout = setTimeout(async () => {
|
|
6
|
-
await superagent.post('/end-test')
|
|
7
|
-
.send({ errorMsg: 'No tests detected' })
|
|
8
|
-
}, 1000)
|
|
9
|
-
|
|
10
|
-
const socket = new WebSocket(`ws://${hostname}:${port}/ws`)
|
|
11
|
-
|
|
12
|
-
socket.addEventListener('open', () => {
|
|
13
|
-
// patch stdout to send strings written to stdout
|
|
14
|
-
Mocha.process.stdout.write = function (data) {
|
|
15
|
-
socket.send(JSON.stringify({
|
|
16
|
-
type: 'stdout',
|
|
17
|
-
data
|
|
18
|
-
}))
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// patch console log to send logs
|
|
22
|
-
const oldConsoleLog = console.log
|
|
23
|
-
console.log = function (...args) {
|
|
24
|
-
socket.send(JSON.stringify({
|
|
25
|
-
type: 'console',
|
|
26
|
-
data: args
|
|
27
|
-
}))
|
|
28
|
-
oldConsoleLog(...args)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const runner = mocha.run()
|
|
32
|
-
|
|
33
|
-
let testsPassed = true
|
|
34
|
-
|
|
35
|
-
runner.once('fail', () => {
|
|
36
|
-
testsPassed = false
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
runner.once('suite', () => {
|
|
40
|
-
clearTimeout(testTimeout)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
runner.once('end', async (event) => {
|
|
44
|
-
await superagent.post('/end-test')
|
|
45
|
-
.send({
|
|
46
|
-
testsPassed,
|
|
47
|
-
// pass coverage report back to server
|
|
48
|
-
coverageReport: window.__coverage__
|
|
49
|
-
})
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
|
|
53
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
$_mod.run("/mocha-puppeteer$0.14.0/lib/pages/test-page/setup");
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
$_mod.def("/mocha-puppeteer$0.14.0/lib/pages/test-page/setup", function(require, exports, module, __filename, __dirname) { "use strict";
|
|
2
|
-
|
|
3
|
-
const { mocha, location } = window;
|
|
4
|
-
|
|
5
|
-
// parse query to get mocha options
|
|
6
|
-
const hashData = location.hash.substring(1);
|
|
7
|
-
const { mochaOptions } = JSON.parse(hashData);
|
|
8
|
-
|
|
9
|
-
mocha.setup(mochaOptions);
|
|
10
|
-
});
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
$_mod.def("/ms$2.1.2/index", function(require, exports, module, __filename, __dirname) { /**
|
|
2
|
-
* Helpers.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
var s = 1000;
|
|
6
|
-
var m = s * 60;
|
|
7
|
-
var h = m * 60;
|
|
8
|
-
var d = h * 24;
|
|
9
|
-
var w = d * 7;
|
|
10
|
-
var y = d * 365.25;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Parse or format the given `val`.
|
|
14
|
-
*
|
|
15
|
-
* Options:
|
|
16
|
-
*
|
|
17
|
-
* - `long` verbose formatting [false]
|
|
18
|
-
*
|
|
19
|
-
* @param {String|Number} val
|
|
20
|
-
* @param {Object} [options]
|
|
21
|
-
* @throws {Error} throw an error if val is not a non-empty string or a number
|
|
22
|
-
* @return {String|Number}
|
|
23
|
-
* @api public
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
module.exports = function(val, options) {
|
|
27
|
-
options = options || {};
|
|
28
|
-
var type = typeof val;
|
|
29
|
-
if (type === 'string' && val.length > 0) {
|
|
30
|
-
return parse(val);
|
|
31
|
-
} else if (type === 'number' && isFinite(val)) {
|
|
32
|
-
return options.long ? fmtLong(val) : fmtShort(val);
|
|
33
|
-
}
|
|
34
|
-
throw new Error(
|
|
35
|
-
'val is not a non-empty string or a valid number. val=' +
|
|
36
|
-
JSON.stringify(val)
|
|
37
|
-
);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Parse the given `str` and return milliseconds.
|
|
42
|
-
*
|
|
43
|
-
* @param {String} str
|
|
44
|
-
* @return {Number}
|
|
45
|
-
* @api private
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
function parse(str) {
|
|
49
|
-
str = String(str);
|
|
50
|
-
if (str.length > 100) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
|
|
54
|
-
str
|
|
55
|
-
);
|
|
56
|
-
if (!match) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
var n = parseFloat(match[1]);
|
|
60
|
-
var type = (match[2] || 'ms').toLowerCase();
|
|
61
|
-
switch (type) {
|
|
62
|
-
case 'years':
|
|
63
|
-
case 'year':
|
|
64
|
-
case 'yrs':
|
|
65
|
-
case 'yr':
|
|
66
|
-
case 'y':
|
|
67
|
-
return n * y;
|
|
68
|
-
case 'weeks':
|
|
69
|
-
case 'week':
|
|
70
|
-
case 'w':
|
|
71
|
-
return n * w;
|
|
72
|
-
case 'days':
|
|
73
|
-
case 'day':
|
|
74
|
-
case 'd':
|
|
75
|
-
return n * d;
|
|
76
|
-
case 'hours':
|
|
77
|
-
case 'hour':
|
|
78
|
-
case 'hrs':
|
|
79
|
-
case 'hr':
|
|
80
|
-
case 'h':
|
|
81
|
-
return n * h;
|
|
82
|
-
case 'minutes':
|
|
83
|
-
case 'minute':
|
|
84
|
-
case 'mins':
|
|
85
|
-
case 'min':
|
|
86
|
-
case 'm':
|
|
87
|
-
return n * m;
|
|
88
|
-
case 'seconds':
|
|
89
|
-
case 'second':
|
|
90
|
-
case 'secs':
|
|
91
|
-
case 'sec':
|
|
92
|
-
case 's':
|
|
93
|
-
return n * s;
|
|
94
|
-
case 'milliseconds':
|
|
95
|
-
case 'millisecond':
|
|
96
|
-
case 'msecs':
|
|
97
|
-
case 'msec':
|
|
98
|
-
case 'ms':
|
|
99
|
-
return n;
|
|
100
|
-
default:
|
|
101
|
-
return undefined;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Short format for `ms`.
|
|
107
|
-
*
|
|
108
|
-
* @param {Number} ms
|
|
109
|
-
* @return {String}
|
|
110
|
-
* @api private
|
|
111
|
-
*/
|
|
112
|
-
|
|
113
|
-
function fmtShort(ms) {
|
|
114
|
-
var msAbs = Math.abs(ms);
|
|
115
|
-
if (msAbs >= d) {
|
|
116
|
-
return Math.round(ms / d) + 'd';
|
|
117
|
-
}
|
|
118
|
-
if (msAbs >= h) {
|
|
119
|
-
return Math.round(ms / h) + 'h';
|
|
120
|
-
}
|
|
121
|
-
if (msAbs >= m) {
|
|
122
|
-
return Math.round(ms / m) + 'm';
|
|
123
|
-
}
|
|
124
|
-
if (msAbs >= s) {
|
|
125
|
-
return Math.round(ms / s) + 's';
|
|
126
|
-
}
|
|
127
|
-
return ms + 'ms';
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Long format for `ms`.
|
|
132
|
-
*
|
|
133
|
-
* @param {Number} ms
|
|
134
|
-
* @return {String}
|
|
135
|
-
* @api private
|
|
136
|
-
*/
|
|
137
|
-
|
|
138
|
-
function fmtLong(ms) {
|
|
139
|
-
var msAbs = Math.abs(ms);
|
|
140
|
-
if (msAbs >= d) {
|
|
141
|
-
return plural(ms, msAbs, d, 'day');
|
|
142
|
-
}
|
|
143
|
-
if (msAbs >= h) {
|
|
144
|
-
return plural(ms, msAbs, h, 'hour');
|
|
145
|
-
}
|
|
146
|
-
if (msAbs >= m) {
|
|
147
|
-
return plural(ms, msAbs, m, 'minute');
|
|
148
|
-
}
|
|
149
|
-
if (msAbs >= s) {
|
|
150
|
-
return plural(ms, msAbs, s, 'second');
|
|
151
|
-
}
|
|
152
|
-
return ms + ' ms';
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Pluralization helper.
|
|
157
|
-
*/
|
|
158
|
-
|
|
159
|
-
function plural(ms, msAbs, n, name) {
|
|
160
|
-
var isPlural = msAbs >= n * 1.5;
|
|
161
|
-
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
});
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
$_mod.def("/object-assign$4.1.1/index", function(require, exports, module, __filename, __dirname) { /*
|
|
2
|
-
object-assign
|
|
3
|
-
(c) Sindre Sorhus
|
|
4
|
-
@license MIT
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
'use strict';
|
|
8
|
-
/* eslint-disable no-unused-vars */
|
|
9
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
10
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
11
|
-
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
|
|
13
|
-
function toObject(val) {
|
|
14
|
-
if (val === null || val === undefined) {
|
|
15
|
-
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return Object(val);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function shouldUseNative() {
|
|
22
|
-
try {
|
|
23
|
-
if (!Object.assign) {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// Detect buggy property enumeration order in older V8 versions.
|
|
28
|
-
|
|
29
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
30
|
-
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
31
|
-
test1[5] = 'de';
|
|
32
|
-
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
37
|
-
var test2 = {};
|
|
38
|
-
for (var i = 0; i < 10; i++) {
|
|
39
|
-
test2['_' + String.fromCharCode(i)] = i;
|
|
40
|
-
}
|
|
41
|
-
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
42
|
-
return test2[n];
|
|
43
|
-
});
|
|
44
|
-
if (order2.join('') !== '0123456789') {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
49
|
-
var test3 = {};
|
|
50
|
-
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
51
|
-
test3[letter] = letter;
|
|
52
|
-
});
|
|
53
|
-
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
54
|
-
'abcdefghijklmnopqrst') {
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return true;
|
|
59
|
-
} catch (err) {
|
|
60
|
-
// We don't expect any of the above to throw, but better to be safe.
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
module.exports = shouldUseNative() ? Object.assign : function (target, source) {
|
|
66
|
-
var from;
|
|
67
|
-
var to = toObject(target);
|
|
68
|
-
var symbols;
|
|
69
|
-
|
|
70
|
-
for (var s = 1; s < arguments.length; s++) {
|
|
71
|
-
from = Object(arguments[s]);
|
|
72
|
-
|
|
73
|
-
for (var key in from) {
|
|
74
|
-
if (hasOwnProperty.call(from, key)) {
|
|
75
|
-
to[key] = from[key];
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (getOwnPropertySymbols) {
|
|
80
|
-
symbols = getOwnPropertySymbols(from);
|
|
81
|
-
for (var i = 0; i < symbols.length; i++) {
|
|
82
|
-
if (propIsEnumerable.call(from, symbols[i])) {
|
|
83
|
-
to[symbols[i]] = from[symbols[i]];
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return to;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
});
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
$_mod.def("/process$0.11.10/browser", function(require, exports, module, __filename, __dirname) { // shim for using process in browser
|
|
2
|
-
var process = module.exports = {};
|
|
3
|
-
|
|
4
|
-
// cached from whatever global is present so that test runners that stub it
|
|
5
|
-
// don't break things. But we need to wrap it in a try catch in case it is
|
|
6
|
-
// wrapped in strict mode code which doesn't define any globals. It's inside a
|
|
7
|
-
// function because try/catches deoptimize in certain engines.
|
|
8
|
-
|
|
9
|
-
var cachedSetTimeout;
|
|
10
|
-
var cachedClearTimeout;
|
|
11
|
-
|
|
12
|
-
function defaultSetTimout() {
|
|
13
|
-
throw new Error('setTimeout has not been defined');
|
|
14
|
-
}
|
|
15
|
-
function defaultClearTimeout () {
|
|
16
|
-
throw new Error('clearTimeout has not been defined');
|
|
17
|
-
}
|
|
18
|
-
(function () {
|
|
19
|
-
try {
|
|
20
|
-
if (typeof setTimeout === 'function') {
|
|
21
|
-
cachedSetTimeout = setTimeout;
|
|
22
|
-
} else {
|
|
23
|
-
cachedSetTimeout = defaultSetTimout;
|
|
24
|
-
}
|
|
25
|
-
} catch (e) {
|
|
26
|
-
cachedSetTimeout = defaultSetTimout;
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
if (typeof clearTimeout === 'function') {
|
|
30
|
-
cachedClearTimeout = clearTimeout;
|
|
31
|
-
} else {
|
|
32
|
-
cachedClearTimeout = defaultClearTimeout;
|
|
33
|
-
}
|
|
34
|
-
} catch (e) {
|
|
35
|
-
cachedClearTimeout = defaultClearTimeout;
|
|
36
|
-
}
|
|
37
|
-
} ())
|
|
38
|
-
function runTimeout(fun) {
|
|
39
|
-
if (cachedSetTimeout === setTimeout) {
|
|
40
|
-
//normal enviroments in sane situations
|
|
41
|
-
return setTimeout(fun, 0);
|
|
42
|
-
}
|
|
43
|
-
// if setTimeout wasn't available but was latter defined
|
|
44
|
-
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
45
|
-
cachedSetTimeout = setTimeout;
|
|
46
|
-
return setTimeout(fun, 0);
|
|
47
|
-
}
|
|
48
|
-
try {
|
|
49
|
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
50
|
-
return cachedSetTimeout(fun, 0);
|
|
51
|
-
} catch(e){
|
|
52
|
-
try {
|
|
53
|
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
54
|
-
return cachedSetTimeout.call(null, fun, 0);
|
|
55
|
-
} catch(e){
|
|
56
|
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
|
|
57
|
-
return cachedSetTimeout.call(this, fun, 0);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
function runClearTimeout(marker) {
|
|
64
|
-
if (cachedClearTimeout === clearTimeout) {
|
|
65
|
-
//normal enviroments in sane situations
|
|
66
|
-
return clearTimeout(marker);
|
|
67
|
-
}
|
|
68
|
-
// if clearTimeout wasn't available but was latter defined
|
|
69
|
-
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
70
|
-
cachedClearTimeout = clearTimeout;
|
|
71
|
-
return clearTimeout(marker);
|
|
72
|
-
}
|
|
73
|
-
try {
|
|
74
|
-
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
75
|
-
return cachedClearTimeout(marker);
|
|
76
|
-
} catch (e){
|
|
77
|
-
try {
|
|
78
|
-
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
79
|
-
return cachedClearTimeout.call(null, marker);
|
|
80
|
-
} catch (e){
|
|
81
|
-
// same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
|
|
82
|
-
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
83
|
-
return cachedClearTimeout.call(this, marker);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
var queue = [];
|
|
91
|
-
var draining = false;
|
|
92
|
-
var currentQueue;
|
|
93
|
-
var queueIndex = -1;
|
|
94
|
-
|
|
95
|
-
function cleanUpNextTick() {
|
|
96
|
-
if (!draining || !currentQueue) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
draining = false;
|
|
100
|
-
if (currentQueue.length) {
|
|
101
|
-
queue = currentQueue.concat(queue);
|
|
102
|
-
} else {
|
|
103
|
-
queueIndex = -1;
|
|
104
|
-
}
|
|
105
|
-
if (queue.length) {
|
|
106
|
-
drainQueue();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function drainQueue() {
|
|
111
|
-
if (draining) {
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
var timeout = runTimeout(cleanUpNextTick);
|
|
115
|
-
draining = true;
|
|
116
|
-
|
|
117
|
-
var len = queue.length;
|
|
118
|
-
while(len) {
|
|
119
|
-
currentQueue = queue;
|
|
120
|
-
queue = [];
|
|
121
|
-
while (++queueIndex < len) {
|
|
122
|
-
if (currentQueue) {
|
|
123
|
-
currentQueue[queueIndex].run();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
queueIndex = -1;
|
|
127
|
-
len = queue.length;
|
|
128
|
-
}
|
|
129
|
-
currentQueue = null;
|
|
130
|
-
draining = false;
|
|
131
|
-
runClearTimeout(timeout);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
process.nextTick = function (fun) {
|
|
135
|
-
var args = new Array(arguments.length - 1);
|
|
136
|
-
if (arguments.length > 1) {
|
|
137
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
138
|
-
args[i - 1] = arguments[i];
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
queue.push(new Item(fun, args));
|
|
142
|
-
if (queue.length === 1 && !draining) {
|
|
143
|
-
runTimeout(drainQueue);
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
|
|
147
|
-
// v8 likes predictible objects
|
|
148
|
-
function Item(fun, array) {
|
|
149
|
-
this.fun = fun;
|
|
150
|
-
this.array = array;
|
|
151
|
-
}
|
|
152
|
-
Item.prototype.run = function () {
|
|
153
|
-
this.fun.apply(null, this.array);
|
|
154
|
-
};
|
|
155
|
-
process.title = 'browser';
|
|
156
|
-
process.browser = true;
|
|
157
|
-
process.env = {};
|
|
158
|
-
process.argv = [];
|
|
159
|
-
process.version = ''; // empty string to avoid regexp issues
|
|
160
|
-
process.versions = {};
|
|
161
|
-
|
|
162
|
-
function noop() {}
|
|
163
|
-
|
|
164
|
-
process.on = noop;
|
|
165
|
-
process.addListener = noop;
|
|
166
|
-
process.once = noop;
|
|
167
|
-
process.off = noop;
|
|
168
|
-
process.removeListener = noop;
|
|
169
|
-
process.removeAllListeners = noop;
|
|
170
|
-
process.emit = noop;
|
|
171
|
-
process.prependListener = noop;
|
|
172
|
-
process.prependOnceListener = noop;
|
|
173
|
-
|
|
174
|
-
process.listeners = function (name) { return [] }
|
|
175
|
-
|
|
176
|
-
process.binding = function (name) {
|
|
177
|
-
throw new Error('process.binding is not supported');
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
process.cwd = function () { return '/' };
|
|
181
|
-
process.chdir = function (dir) {
|
|
182
|
-
throw new Error('process.chdir is not supported');
|
|
183
|
-
};
|
|
184
|
-
process.umask = function() { return 0; };
|
|
185
|
-
|
|
186
|
-
});
|