centrifuge 5.3.3 → 5.3.4
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/build/index.js +0 -1
- package/build/index.mjs +0 -1
- package/build/protobuf/index.js +277 -255
- package/build/protobuf/index.mjs +277 -255
- package/dist/centrifuge.js +1 -1
- package/dist/centrifuge.js.map +2 -2
- package/dist/centrifuge.protobuf.js +1 -1
- package/dist/centrifuge.protobuf.js.map +2 -2
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -1539,7 +1539,6 @@ class HttpStreamTransport {
|
|
|
1539
1539
|
body: body,
|
|
1540
1540
|
mode: 'cors',
|
|
1541
1541
|
credentials: 'same-origin',
|
|
1542
|
-
cache: 'no-cache',
|
|
1543
1542
|
signal: this._abortController.signal
|
|
1544
1543
|
};
|
|
1545
1544
|
const eventTarget = this._fetchEventTarget(this, this.endpoint, fetchOptions);
|
package/build/index.mjs
CHANGED
|
@@ -1537,7 +1537,6 @@ class HttpStreamTransport {
|
|
|
1537
1537
|
body: body,
|
|
1538
1538
|
mode: 'cors',
|
|
1539
1539
|
credentials: 'same-origin',
|
|
1540
|
-
cache: 'no-cache',
|
|
1541
1540
|
signal: this._abortController.signal
|
|
1542
1541
|
};
|
|
1543
1542
|
const eventTarget = this._fetchEventTarget(this, this.endpoint, fetchOptions);
|
package/build/protobuf/index.js
CHANGED
|
@@ -1541,7 +1541,6 @@ class HttpStreamTransport {
|
|
|
1541
1541
|
body: body,
|
|
1542
1542
|
mode: 'cors',
|
|
1543
1543
|
credentials: 'same-origin',
|
|
1544
|
-
cache: 'no-cache',
|
|
1545
1544
|
signal: this._abortController.signal
|
|
1546
1545
|
};
|
|
1547
1546
|
const eventTarget = this._fetchEventTarget(this, this.endpoint, fetchOptions);
|
|
@@ -3726,7 +3725,7 @@ var indexMinimal = {};
|
|
|
3726
3725
|
|
|
3727
3726
|
var minimal = {};
|
|
3728
3727
|
|
|
3729
|
-
var aspromise = asPromise
|
|
3728
|
+
var aspromise = asPromise;
|
|
3730
3729
|
|
|
3731
3730
|
/**
|
|
3732
3731
|
* Callback as used by {@link util.asPromise}.
|
|
@@ -3745,7 +3744,7 @@ var aspromise = asPromise$1;
|
|
|
3745
3744
|
* @param {...*} params Function arguments
|
|
3746
3745
|
* @returns {Promise<*>} Promisified function
|
|
3747
3746
|
*/
|
|
3748
|
-
function asPromise
|
|
3747
|
+
function asPromise(fn, ctx/*, varargs */) {
|
|
3749
3748
|
var params = new Array(arguments.length - 1),
|
|
3750
3749
|
offset = 0,
|
|
3751
3750
|
index = 2,
|
|
@@ -4331,7 +4330,7 @@ function readUintBE(buf, pos) {
|
|
|
4331
4330
|
| buf[pos + 3]) >>> 0;
|
|
4332
4331
|
}
|
|
4333
4332
|
|
|
4334
|
-
var inquire_1 = inquire
|
|
4333
|
+
var inquire_1 = inquire;
|
|
4335
4334
|
|
|
4336
4335
|
/**
|
|
4337
4336
|
* Requires a module only if available.
|
|
@@ -4339,7 +4338,7 @@ var inquire_1 = inquire$1;
|
|
|
4339
4338
|
* @param {string} moduleName Module to require
|
|
4340
4339
|
* @returns {?Object} Required module if available and not empty, otherwise `null`
|
|
4341
4340
|
*/
|
|
4342
|
-
function inquire
|
|
4341
|
+
function inquire(moduleName) {
|
|
4343
4342
|
try {
|
|
4344
4343
|
var mod = eval("quire".replace(/^/,"re"))(moduleName); // eslint-disable-line no-eval
|
|
4345
4344
|
if (mod && (mod.length || Object.keys(mod).length))
|
|
@@ -6401,288 +6400,311 @@ var roots = {};
|
|
|
6401
6400
|
|
|
6402
6401
|
var util$1 = {exports: {}};
|
|
6403
6402
|
|
|
6404
|
-
var codegen_1
|
|
6403
|
+
var codegen_1;
|
|
6404
|
+
var hasRequiredCodegen;
|
|
6405
|
+
|
|
6406
|
+
function requireCodegen () {
|
|
6407
|
+
if (hasRequiredCodegen) return codegen_1;
|
|
6408
|
+
hasRequiredCodegen = 1;
|
|
6409
|
+
codegen_1 = codegen;
|
|
6405
6410
|
|
|
6406
|
-
/**
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
function codegen(functionParams, functionName) {
|
|
6411
|
+
/**
|
|
6412
|
+
* Begins generating a function.
|
|
6413
|
+
* @memberof util
|
|
6414
|
+
* @param {string[]} functionParams Function parameter names
|
|
6415
|
+
* @param {string} [functionName] Function name if not anonymous
|
|
6416
|
+
* @returns {Codegen} Appender that appends code to the function's body
|
|
6417
|
+
*/
|
|
6418
|
+
function codegen(functionParams, functionName) {
|
|
6414
6419
|
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
+
/* istanbul ignore if */
|
|
6421
|
+
if (typeof functionParams === "string") {
|
|
6422
|
+
functionName = functionParams;
|
|
6423
|
+
functionParams = undefined;
|
|
6424
|
+
}
|
|
6420
6425
|
|
|
6421
|
-
|
|
6426
|
+
var body = [];
|
|
6422
6427
|
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6428
|
+
/**
|
|
6429
|
+
* Appends code to the function's body or finishes generation.
|
|
6430
|
+
* @typedef Codegen
|
|
6431
|
+
* @type {function}
|
|
6432
|
+
* @param {string|Object.<string,*>} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any
|
|
6433
|
+
* @param {...*} [formatParams] Format parameters
|
|
6434
|
+
* @returns {Codegen|Function} Itself or the generated function if finished
|
|
6435
|
+
* @throws {Error} If format parameter counts do not match
|
|
6436
|
+
*/
|
|
6432
6437
|
|
|
6433
|
-
|
|
6434
|
-
|
|
6438
|
+
function Codegen(formatStringOrScope) {
|
|
6439
|
+
// note that explicit array handling below makes this ~50% faster
|
|
6435
6440
|
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6441
|
+
// finish the function
|
|
6442
|
+
if (typeof formatStringOrScope !== "string") {
|
|
6443
|
+
var source = toString();
|
|
6444
|
+
if (codegen.verbose)
|
|
6445
|
+
console.log("codegen: " + source); // eslint-disable-line no-console
|
|
6446
|
+
source = "return " + source;
|
|
6447
|
+
if (formatStringOrScope) {
|
|
6448
|
+
var scopeKeys = Object.keys(formatStringOrScope),
|
|
6449
|
+
scopeParams = new Array(scopeKeys.length + 1),
|
|
6450
|
+
scopeValues = new Array(scopeKeys.length),
|
|
6451
|
+
scopeOffset = 0;
|
|
6452
|
+
while (scopeOffset < scopeKeys.length) {
|
|
6453
|
+
scopeParams[scopeOffset] = scopeKeys[scopeOffset];
|
|
6454
|
+
scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];
|
|
6455
|
+
}
|
|
6456
|
+
scopeParams[scopeOffset] = source;
|
|
6457
|
+
return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func
|
|
6458
|
+
}
|
|
6459
|
+
return Function(source)(); // eslint-disable-line no-new-func
|
|
6460
|
+
}
|
|
6456
6461
|
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6462
|
+
// otherwise append to body
|
|
6463
|
+
var formatParams = new Array(arguments.length - 1),
|
|
6464
|
+
formatOffset = 0;
|
|
6465
|
+
while (formatOffset < formatParams.length)
|
|
6466
|
+
formatParams[formatOffset] = arguments[++formatOffset];
|
|
6467
|
+
formatOffset = 0;
|
|
6468
|
+
formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {
|
|
6469
|
+
var value = formatParams[formatOffset++];
|
|
6470
|
+
switch ($1) {
|
|
6471
|
+
case "d": case "f": return String(Number(value));
|
|
6472
|
+
case "i": return String(Math.floor(value));
|
|
6473
|
+
case "j": return JSON.stringify(value);
|
|
6474
|
+
case "s": return String(value);
|
|
6475
|
+
}
|
|
6476
|
+
return "%";
|
|
6477
|
+
});
|
|
6478
|
+
if (formatOffset !== formatParams.length)
|
|
6479
|
+
throw Error("parameter count mismatch");
|
|
6480
|
+
body.push(formatStringOrScope);
|
|
6481
|
+
return Codegen;
|
|
6482
|
+
}
|
|
6478
6483
|
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6484
|
+
function toString(functionNameOverride) {
|
|
6485
|
+
return "function " + (functionNameOverride || functionName || "") + "(" + (functionParams && functionParams.join(",") || "") + "){\n " + body.join("\n ") + "\n}";
|
|
6486
|
+
}
|
|
6482
6487
|
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
}
|
|
6488
|
+
Codegen.toString = toString;
|
|
6489
|
+
return Codegen;
|
|
6490
|
+
}
|
|
6486
6491
|
|
|
6487
|
-
/**
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6492
|
+
/**
|
|
6493
|
+
* Begins generating a function.
|
|
6494
|
+
* @memberof util
|
|
6495
|
+
* @function codegen
|
|
6496
|
+
* @param {string} [functionName] Function name if not anonymous
|
|
6497
|
+
* @returns {Codegen} Appender that appends code to the function's body
|
|
6498
|
+
* @variation 2
|
|
6499
|
+
*/
|
|
6495
6500
|
|
|
6496
|
-
/**
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
codegen.verbose = false;
|
|
6501
|
+
/**
|
|
6502
|
+
* When set to `true`, codegen will log generated code to console. Useful for debugging.
|
|
6503
|
+
* @name util.codegen.verbose
|
|
6504
|
+
* @type {boolean}
|
|
6505
|
+
*/
|
|
6506
|
+
codegen.verbose = false;
|
|
6507
|
+
return codegen_1;
|
|
6508
|
+
}
|
|
6502
6509
|
|
|
6503
|
-
var fetch_1
|
|
6510
|
+
var fetch_1;
|
|
6511
|
+
var hasRequiredFetch;
|
|
6512
|
+
|
|
6513
|
+
function requireFetch () {
|
|
6514
|
+
if (hasRequiredFetch) return fetch_1;
|
|
6515
|
+
hasRequiredFetch = 1;
|
|
6516
|
+
fetch_1 = fetch;
|
|
6504
6517
|
|
|
6505
|
-
var asPromise = aspromise,
|
|
6506
|
-
|
|
6518
|
+
var asPromise = aspromise,
|
|
6519
|
+
inquire = inquire_1;
|
|
6507
6520
|
|
|
6508
|
-
var fs = inquire("fs");
|
|
6521
|
+
var fs = inquire("fs");
|
|
6509
6522
|
|
|
6510
|
-
/**
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6523
|
+
/**
|
|
6524
|
+
* Node-style callback as used by {@link util.fetch}.
|
|
6525
|
+
* @typedef FetchCallback
|
|
6526
|
+
* @type {function}
|
|
6527
|
+
* @param {?Error} error Error, if any, otherwise `null`
|
|
6528
|
+
* @param {string} [contents] File contents, if there hasn't been an error
|
|
6529
|
+
* @returns {undefined}
|
|
6530
|
+
*/
|
|
6518
6531
|
|
|
6519
|
-
/**
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6532
|
+
/**
|
|
6533
|
+
* Options as used by {@link util.fetch}.
|
|
6534
|
+
* @typedef FetchOptions
|
|
6535
|
+
* @type {Object}
|
|
6536
|
+
* @property {boolean} [binary=false] Whether expecting a binary response
|
|
6537
|
+
* @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest
|
|
6538
|
+
*/
|
|
6526
6539
|
|
|
6527
|
-
/**
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
function fetch(filename, options, callback) {
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6540
|
+
/**
|
|
6541
|
+
* Fetches the contents of a file.
|
|
6542
|
+
* @memberof util
|
|
6543
|
+
* @param {string} filename File path or url
|
|
6544
|
+
* @param {FetchOptions} options Fetch options
|
|
6545
|
+
* @param {FetchCallback} callback Callback function
|
|
6546
|
+
* @returns {undefined}
|
|
6547
|
+
*/
|
|
6548
|
+
function fetch(filename, options, callback) {
|
|
6549
|
+
if (typeof options === "function") {
|
|
6550
|
+
callback = options;
|
|
6551
|
+
options = {};
|
|
6552
|
+
} else if (!options)
|
|
6553
|
+
options = {};
|
|
6541
6554
|
|
|
6542
|
-
|
|
6543
|
-
|
|
6555
|
+
if (!callback)
|
|
6556
|
+
return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this
|
|
6544
6557
|
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6558
|
+
// if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.
|
|
6559
|
+
if (!options.xhr && fs && fs.readFile)
|
|
6560
|
+
return fs.readFile(filename, function fetchReadFileCallback(err, contents) {
|
|
6561
|
+
return err && typeof XMLHttpRequest !== "undefined"
|
|
6562
|
+
? fetch.xhr(filename, options, callback)
|
|
6563
|
+
: err
|
|
6564
|
+
? callback(err)
|
|
6565
|
+
: callback(null, options.binary ? contents : contents.toString("utf8"));
|
|
6566
|
+
});
|
|
6554
6567
|
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
}
|
|
6568
|
+
// use the XHR version otherwise.
|
|
6569
|
+
return fetch.xhr(filename, options, callback);
|
|
6570
|
+
}
|
|
6558
6571
|
|
|
6559
|
-
/**
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6572
|
+
/**
|
|
6573
|
+
* Fetches the contents of a file.
|
|
6574
|
+
* @name util.fetch
|
|
6575
|
+
* @function
|
|
6576
|
+
* @param {string} path File path or url
|
|
6577
|
+
* @param {FetchCallback} callback Callback function
|
|
6578
|
+
* @returns {undefined}
|
|
6579
|
+
* @variation 2
|
|
6580
|
+
*/
|
|
6568
6581
|
|
|
6569
|
-
/**
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6582
|
+
/**
|
|
6583
|
+
* Fetches the contents of a file.
|
|
6584
|
+
* @name util.fetch
|
|
6585
|
+
* @function
|
|
6586
|
+
* @param {string} path File path or url
|
|
6587
|
+
* @param {FetchOptions} [options] Fetch options
|
|
6588
|
+
* @returns {Promise<string|Uint8Array>} Promise
|
|
6589
|
+
* @variation 3
|
|
6590
|
+
*/
|
|
6578
6591
|
|
|
6579
|
-
/**/
|
|
6580
|
-
fetch.xhr = function fetch_xhr(filename, options, callback) {
|
|
6581
|
-
|
|
6582
|
-
|
|
6592
|
+
/**/
|
|
6593
|
+
fetch.xhr = function fetch_xhr(filename, options, callback) {
|
|
6594
|
+
var xhr = new XMLHttpRequest();
|
|
6595
|
+
xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {
|
|
6583
6596
|
|
|
6584
|
-
|
|
6585
|
-
|
|
6597
|
+
if (xhr.readyState !== 4)
|
|
6598
|
+
return undefined;
|
|
6586
6599
|
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6600
|
+
// local cors security errors return status 0 / empty string, too. afaik this cannot be
|
|
6601
|
+
// reliably distinguished from an actually empty file for security reasons. feel free
|
|
6602
|
+
// to send a pull request if you are aware of a solution.
|
|
6603
|
+
if (xhr.status !== 0 && xhr.status !== 200)
|
|
6604
|
+
return callback(Error("status " + xhr.status));
|
|
6592
6605
|
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
+
// if binary data is expected, make sure that some sort of array is returned, even if
|
|
6607
|
+
// ArrayBuffers are not supported. the binary string fallback, however, is unsafe.
|
|
6608
|
+
if (options.binary) {
|
|
6609
|
+
var buffer = xhr.response;
|
|
6610
|
+
if (!buffer) {
|
|
6611
|
+
buffer = [];
|
|
6612
|
+
for (var i = 0; i < xhr.responseText.length; ++i)
|
|
6613
|
+
buffer.push(xhr.responseText.charCodeAt(i) & 255);
|
|
6614
|
+
}
|
|
6615
|
+
return callback(null, typeof Uint8Array !== "undefined" ? new Uint8Array(buffer) : buffer);
|
|
6616
|
+
}
|
|
6617
|
+
return callback(null, xhr.responseText);
|
|
6618
|
+
};
|
|
6606
6619
|
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6620
|
+
if (options.binary) {
|
|
6621
|
+
// ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers
|
|
6622
|
+
if ("overrideMimeType" in xhr)
|
|
6623
|
+
xhr.overrideMimeType("text/plain; charset=x-user-defined");
|
|
6624
|
+
xhr.responseType = "arraybuffer";
|
|
6625
|
+
}
|
|
6613
6626
|
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
};
|
|
6627
|
+
xhr.open("GET", filename);
|
|
6628
|
+
xhr.send();
|
|
6629
|
+
};
|
|
6630
|
+
return fetch_1;
|
|
6631
|
+
}
|
|
6617
6632
|
|
|
6618
6633
|
var path = {};
|
|
6619
6634
|
|
|
6620
|
-
|
|
6635
|
+
var hasRequiredPath;
|
|
6636
|
+
|
|
6637
|
+
function requirePath () {
|
|
6638
|
+
if (hasRequiredPath) return path;
|
|
6639
|
+
hasRequiredPath = 1;
|
|
6640
|
+
(function (exports) {
|
|
6621
6641
|
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6642
|
+
/**
|
|
6643
|
+
* A minimal path module to resolve Unix, Windows and URL paths alike.
|
|
6644
|
+
* @memberof util
|
|
6645
|
+
* @namespace
|
|
6646
|
+
*/
|
|
6647
|
+
var path = exports;
|
|
6628
6648
|
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6649
|
+
var isAbsolute =
|
|
6650
|
+
/**
|
|
6651
|
+
* Tests if the specified path is absolute.
|
|
6652
|
+
* @param {string} path Path to test
|
|
6653
|
+
* @returns {boolean} `true` if path is absolute
|
|
6654
|
+
*/
|
|
6655
|
+
path.isAbsolute = function isAbsolute(path) {
|
|
6656
|
+
return /^(?:\/|\w+:)/.test(path);
|
|
6657
|
+
};
|
|
6638
6658
|
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6659
|
+
var normalize =
|
|
6660
|
+
/**
|
|
6661
|
+
* Normalizes the specified path.
|
|
6662
|
+
* @param {string} path Path to normalize
|
|
6663
|
+
* @returns {string} Normalized path
|
|
6664
|
+
*/
|
|
6665
|
+
path.normalize = function normalize(path) {
|
|
6666
|
+
path = path.replace(/\\/g, "/")
|
|
6667
|
+
.replace(/\/{2,}/g, "/");
|
|
6668
|
+
var parts = path.split("/"),
|
|
6669
|
+
absolute = isAbsolute(path),
|
|
6670
|
+
prefix = "";
|
|
6671
|
+
if (absolute)
|
|
6672
|
+
prefix = parts.shift() + "/";
|
|
6673
|
+
for (var i = 0; i < parts.length;) {
|
|
6674
|
+
if (parts[i] === "..") {
|
|
6675
|
+
if (i > 0 && parts[i - 1] !== "..")
|
|
6676
|
+
parts.splice(--i, 2);
|
|
6677
|
+
else if (absolute)
|
|
6678
|
+
parts.splice(i, 1);
|
|
6679
|
+
else
|
|
6680
|
+
++i;
|
|
6681
|
+
} else if (parts[i] === ".")
|
|
6682
|
+
parts.splice(i, 1);
|
|
6683
|
+
else
|
|
6684
|
+
++i;
|
|
6685
|
+
}
|
|
6686
|
+
return prefix + parts.join("/");
|
|
6687
|
+
};
|
|
6668
6688
|
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
} (path));
|
|
6689
|
+
/**
|
|
6690
|
+
* Resolves the specified include path against the specified origin path.
|
|
6691
|
+
* @param {string} originPath Path to the origin file
|
|
6692
|
+
* @param {string} includePath Include path relative to origin path
|
|
6693
|
+
* @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized
|
|
6694
|
+
* @returns {string} Path to the include file
|
|
6695
|
+
*/
|
|
6696
|
+
path.resolve = function resolve(originPath, includePath, alreadyNormalized) {
|
|
6697
|
+
if (!alreadyNormalized)
|
|
6698
|
+
includePath = normalize(includePath);
|
|
6699
|
+
if (isAbsolute(includePath))
|
|
6700
|
+
return includePath;
|
|
6701
|
+
if (!alreadyNormalized)
|
|
6702
|
+
originPath = normalize(originPath);
|
|
6703
|
+
return (originPath = originPath.replace(/(?:\/|^)[^/]+$/, "")).length ? normalize(originPath + "/" + includePath) : includePath;
|
|
6704
|
+
};
|
|
6705
|
+
} (path));
|
|
6706
|
+
return path;
|
|
6707
|
+
}
|
|
6686
6708
|
|
|
6687
6709
|
var types = {};
|
|
6688
6710
|
|
|
@@ -10272,9 +10294,9 @@ function requireUtil () {
|
|
|
10272
10294
|
var Type, // cyclic
|
|
10273
10295
|
Enum;
|
|
10274
10296
|
|
|
10275
|
-
util.codegen =
|
|
10276
|
-
util.fetch =
|
|
10277
|
-
util.path =
|
|
10297
|
+
util.codegen = requireCodegen();
|
|
10298
|
+
util.fetch = requireFetch();
|
|
10299
|
+
util.path = requirePath();
|
|
10278
10300
|
|
|
10279
10301
|
/**
|
|
10280
10302
|
* Node's fs module if available.
|