@twilio/conversations 2.0.0-rc.3 → 2.0.1-canary.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.
- package/README.md +24 -27
- package/{dist → builds}/browser.js +20 -21
- package/builds/browser.js.map +1 -0
- package/{dist → builds}/lib.d.ts +19 -3
- package/{dist → builds}/lib.js +20 -21
- package/builds/lib.js.map +1 -0
- package/{dist → builds}/twilio-conversations.js +1946 -1098
- package/builds/twilio-conversations.min.js +156 -0
- package/dist/aggregated-delivery-receipt.js +227 -0
- package/dist/aggregated-delivery-receipt.js.map +1 -0
- package/dist/client.js +872 -0
- package/dist/client.js.map +1 -0
- package/dist/command-executor.js +203 -0
- package/dist/command-executor.js.map +1 -0
- package/dist/configuration.js +196 -0
- package/dist/configuration.js.map +1 -0
- package/dist/conversation.js +973 -0
- package/dist/conversation.js.map +1 -0
- package/dist/data/conversations.js +443 -0
- package/dist/data/conversations.js.map +1 -0
- package/dist/data/messages.js +341 -0
- package/dist/data/messages.js.map +1 -0
- package/dist/data/participants.js +313 -0
- package/dist/data/participants.js.map +1 -0
- package/dist/data/users.js +228 -0
- package/dist/data/users.js.map +1 -0
- package/dist/detailed-delivery-receipt.js +154 -0
- package/dist/detailed-delivery-receipt.js.map +1 -0
- package/dist/index.js +167 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/notification-types.js +143 -0
- package/dist/interfaces/notification-types.js.map +1 -0
- package/dist/logger.js +190 -0
- package/dist/logger.js.map +1 -0
- package/dist/media.js +213 -0
- package/dist/media.js.map +1 -0
- package/dist/message-builder.js +209 -0
- package/dist/message-builder.js.map +1 -0
- package/dist/message.js +450 -0
- package/dist/message.js.map +1 -0
- package/dist/node_modules/tslib/tslib.es6.js +161 -0
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/packages/conversations/package.json.js +136 -0
- package/dist/packages/conversations/package.json.js.map +1 -0
- package/dist/participant.js +346 -0
- package/dist/participant.js.map +1 -0
- package/dist/push-notification.js +152 -0
- package/dist/push-notification.js.map +1 -0
- package/dist/rest-paginator.js +175 -0
- package/dist/rest-paginator.js.map +1 -0
- package/dist/services/network.js +205 -0
- package/dist/services/network.js.map +1 -0
- package/dist/services/typing-indicator.js +235 -0
- package/dist/services/typing-indicator.js.map +1 -0
- package/dist/unsent-message.js +159 -0
- package/dist/unsent-message.js.map +1 -0
- package/dist/user.js +392 -0
- package/dist/user.js.map +1 -0
- package/dist/util/deferred.js +154 -0
- package/dist/util/deferred.js.map +1 -0
- package/dist/util/index.js +206 -0
- package/dist/util/index.js.map +1 -0
- package/{dist/docs → docs}/assets/css/main.css +0 -0
- package/{dist/docs → docs}/assets/images/icons.png +0 -0
- package/{dist/docs → docs}/assets/images/icons@2x.png +0 -0
- package/{dist/docs → docs}/assets/images/widgets.png +0 -0
- package/{dist/docs → docs}/assets/images/widgets@2x.png +0 -0
- package/{dist/docs → docs}/assets/js/main.js +0 -0
- package/{dist/docs → docs}/assets/js/search.js +0 -0
- package/{dist/docs → docs}/classes/AggregatedDeliveryReceipt.html +0 -0
- package/{dist/docs → docs}/classes/Client.html +0 -0
- package/{dist/docs → docs}/classes/Conversation.html +0 -0
- package/{dist/docs → docs}/classes/DetailedDeliveryReceipt.html +0 -0
- package/{dist/docs → docs}/classes/Media.html +0 -0
- package/{dist/docs → docs}/classes/Message.html +0 -0
- package/{dist/docs → docs}/classes/MessageBuilder.html +0 -0
- package/{dist/docs → docs}/classes/Participant.html +0 -0
- package/{dist/docs → docs}/classes/PushNotification.html +0 -0
- package/{dist/docs → docs}/classes/RestPaginator.html +0 -0
- package/{dist/docs → docs}/classes/UnsentMessage.html +0 -0
- package/{dist/docs → docs}/classes/User.html +0 -0
- package/{dist/docs → docs}/index.html +24 -23
- package/{dist/docs → docs}/interfaces/ClientOptions.html +0 -0
- package/{dist/docs → docs}/interfaces/ConversationState.html +0 -0
- package/{dist/docs → docs}/interfaces/CreateConversationOptions.html +0 -0
- package/{dist/docs → docs}/interfaces/LastMessage.html +0 -0
- package/{dist/docs → docs}/interfaces/Paginator.html +0 -0
- package/{dist/docs → docs}/interfaces/PushNotificationData.html +1 -1
- package/{dist/docs → docs}/interfaces/SendEmailOptions.html +0 -0
- package/{dist/docs → docs}/interfaces/SendMediaOptions.html +2 -1
- package/{dist/docs → docs}/modules.html +24 -23
- package/package.json +27 -24
- package/CHANGELOG.md +0 -201
- package/dist/browser.js.map +0 -1
- package/dist/lib.js.map +0 -1
- package/dist/post-install.js +0 -29
- package/dist/react-native.js +0 -4031
- package/dist/react-native.js.map +0 -1
- package/dist/twilio-conversations.min.js +0 -156
@@ -1833,11 +1833,11 @@ this.Twilio.Conversations = (function (exports) {
|
|
1833
1833
|
var wellKnownSymbol$l = wellKnownSymbol$s;
|
1834
1834
|
|
1835
1835
|
var TO_STRING_TAG$3 = wellKnownSymbol$l('toStringTag');
|
1836
|
-
var test$
|
1836
|
+
var test$1 = {};
|
1837
1837
|
|
1838
|
-
test$
|
1838
|
+
test$1[TO_STRING_TAG$3] = 'z';
|
1839
1839
|
|
1840
|
-
var toStringTagSupport = String(test$
|
1840
|
+
var toStringTagSupport = String(test$1) === '[object z]';
|
1841
1841
|
|
1842
1842
|
var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
|
1843
1843
|
var classofRaw = classofRaw$1;
|
@@ -5018,7 +5018,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
5018
5018
|
var toObject$8 = toObject$g;
|
5019
5019
|
|
5020
5020
|
var floor$6 = Math.floor;
|
5021
|
-
var replace$
|
5021
|
+
var replace$1 = ''.replace;
|
5022
5022
|
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
|
5023
5023
|
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
|
5024
5024
|
|
@@ -5032,7 +5032,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
5032
5032
|
namedCaptures = toObject$8(namedCaptures);
|
5033
5033
|
symbols = SUBSTITUTION_SYMBOLS;
|
5034
5034
|
}
|
5035
|
-
return replace$
|
5035
|
+
return replace$1.call(replacement, symbols, function (match, ch) {
|
5036
5036
|
var capture;
|
5037
5037
|
switch (ch.charAt(0)) {
|
5038
5038
|
case '$': return '$';
|
@@ -5224,1092 +5224,12 @@ this.Twilio.Conversations = (function (exports) {
|
|
5224
5224
|
}
|
5225
5225
|
});
|
5226
5226
|
|
5227
|
-
var rfc6902 = {};
|
5228
|
-
|
5229
|
-
var pointer = {};
|
5230
|
-
|
5231
|
-
Object.defineProperty(pointer, "__esModule", {
|
5232
|
-
value: true
|
5233
|
-
});
|
5234
|
-
pointer.Pointer = void 0;
|
5235
|
-
/**
|
5236
|
-
Unescape token part of a JSON Pointer string
|
5237
|
-
|
5238
|
-
`token` should *not* contain any '/' characters.
|
5239
|
-
|
5240
|
-
> Evaluation of each reference token begins by decoding any escaped
|
5241
|
-
> character sequence. This is performed by first transforming any
|
5242
|
-
> occurrence of the sequence '~1' to '/', and then transforming any
|
5243
|
-
> occurrence of the sequence '~0' to '~'. By performing the
|
5244
|
-
> substitutions in this order, an implementation avoids the error of
|
5245
|
-
> turning '~01' first into '~1' and then into '/', which would be
|
5246
|
-
> incorrect (the string '~01' correctly becomes '~1' after
|
5247
|
-
> transformation).
|
5248
|
-
|
5249
|
-
Here's my take:
|
5250
|
-
|
5251
|
-
~1 is unescaped with higher priority than ~0 because it is a lower-order escape character.
|
5252
|
-
I say "lower order" because '/' needs escaping due to the JSON Pointer serialization technique.
|
5253
|
-
Whereas, '~' is escaped because escaping '/' uses the '~' character.
|
5254
|
-
*/
|
5255
|
-
|
5256
|
-
function unescape(token) {
|
5257
|
-
return token.replace(/~1/g, '/').replace(/~0/g, '~');
|
5258
|
-
}
|
5259
|
-
/** Escape token part of a JSON Pointer string
|
5260
|
-
|
5261
|
-
> '~' needs to be encoded as '~0' and '/'
|
5262
|
-
> needs to be encoded as '~1' when these characters appear in a
|
5263
|
-
> reference token.
|
5264
|
-
|
5265
|
-
This is the exact inverse of `unescape()`, so the reverse replacements must take place in reverse order.
|
5266
|
-
*/
|
5267
|
-
|
5268
|
-
|
5269
|
-
function escape(token) {
|
5270
|
-
return token.replace(/~/g, '~0').replace(/\//g, '~1');
|
5271
|
-
}
|
5272
|
-
/**
|
5273
|
-
JSON Pointer representation
|
5274
|
-
*/
|
5275
|
-
|
5276
|
-
|
5277
|
-
var Pointer =
|
5278
|
-
/** @class */
|
5279
|
-
function () {
|
5280
|
-
function Pointer(tokens) {
|
5281
|
-
if (tokens === void 0) {
|
5282
|
-
tokens = [''];
|
5283
|
-
}
|
5284
|
-
|
5285
|
-
this.tokens = tokens;
|
5286
|
-
}
|
5287
|
-
/**
|
5288
|
-
`path` *must* be a properly escaped string.
|
5289
|
-
*/
|
5290
|
-
|
5291
|
-
|
5292
|
-
Pointer.fromJSON = function (path) {
|
5293
|
-
var tokens = path.split('/').map(unescape);
|
5294
|
-
if (tokens[0] !== '') throw new Error("Invalid JSON Pointer: " + path);
|
5295
|
-
return new Pointer(tokens);
|
5296
|
-
};
|
5297
|
-
|
5298
|
-
Pointer.prototype.toString = function () {
|
5299
|
-
return this.tokens.map(escape).join('/');
|
5300
|
-
};
|
5301
|
-
/**
|
5302
|
-
Returns an object with 'parent', 'key', and 'value' properties.
|
5303
|
-
In the special case that this Pointer's path == "",
|
5304
|
-
this object will be {parent: null, key: '', value: object}.
|
5305
|
-
Otherwise, parent and key will have the property such that parent[key] == value.
|
5306
|
-
*/
|
5307
|
-
|
5308
|
-
|
5309
|
-
Pointer.prototype.evaluate = function (object) {
|
5310
|
-
var parent = null;
|
5311
|
-
var key = '';
|
5312
|
-
var value = object;
|
5313
|
-
|
5314
|
-
for (var i = 1, l = this.tokens.length; i < l; i++) {
|
5315
|
-
parent = value;
|
5316
|
-
key = this.tokens[i]; // not sure if this the best way to handle non-existant paths...
|
5317
|
-
|
5318
|
-
value = (parent || {})[key];
|
5319
|
-
}
|
5320
|
-
|
5321
|
-
return {
|
5322
|
-
parent: parent,
|
5323
|
-
key: key,
|
5324
|
-
value: value
|
5325
|
-
};
|
5326
|
-
};
|
5327
|
-
|
5328
|
-
Pointer.prototype.get = function (object) {
|
5329
|
-
return this.evaluate(object).value;
|
5330
|
-
};
|
5331
|
-
|
5332
|
-
Pointer.prototype.set = function (object, value) {
|
5333
|
-
var cursor = object;
|
5334
|
-
|
5335
|
-
for (var i = 1, l = this.tokens.length - 1, token = this.tokens[i]; i < l; i++) {
|
5336
|
-
// not sure if this the best way to handle non-existant paths...
|
5337
|
-
cursor = (cursor || {})[token];
|
5338
|
-
}
|
5339
|
-
|
5340
|
-
if (cursor) {
|
5341
|
-
cursor[this.tokens[this.tokens.length - 1]] = value;
|
5342
|
-
}
|
5343
|
-
};
|
5344
|
-
|
5345
|
-
Pointer.prototype.push = function (token) {
|
5346
|
-
// mutable
|
5347
|
-
this.tokens.push(token);
|
5348
|
-
};
|
5349
|
-
/**
|
5350
|
-
`token` should be a String. It'll be coerced to one anyway.
|
5351
|
-
immutable (shallowly)
|
5352
|
-
*/
|
5353
|
-
|
5354
|
-
|
5355
|
-
Pointer.prototype.add = function (token) {
|
5356
|
-
var tokens = this.tokens.concat(String(token));
|
5357
|
-
return new Pointer(tokens);
|
5358
|
-
};
|
5359
|
-
|
5360
|
-
return Pointer;
|
5361
|
-
}();
|
5362
|
-
|
5363
|
-
pointer.Pointer = Pointer;
|
5364
|
-
|
5365
|
-
var patch = {};
|
5366
|
-
|
5367
|
-
var util = {};
|
5368
|
-
|
5369
|
-
(function (exports) {
|
5370
|
-
|
5371
|
-
Object.defineProperty(exports, "__esModule", {
|
5372
|
-
value: true
|
5373
|
-
});
|
5374
|
-
exports.clone = exports.objectType = exports.hasOwnProperty = void 0;
|
5375
|
-
exports.hasOwnProperty = Object.prototype.hasOwnProperty;
|
5376
|
-
|
5377
|
-
function objectType(object) {
|
5378
|
-
if (object === undefined) {
|
5379
|
-
return 'undefined';
|
5380
|
-
}
|
5381
|
-
|
5382
|
-
if (object === null) {
|
5383
|
-
return 'null';
|
5384
|
-
}
|
5385
|
-
|
5386
|
-
if (Array.isArray(object)) {
|
5387
|
-
return 'array';
|
5388
|
-
}
|
5389
|
-
|
5390
|
-
return _typeof$4(object);
|
5391
|
-
}
|
5392
|
-
|
5393
|
-
exports.objectType = objectType;
|
5394
|
-
/**
|
5395
|
-
Recursively copy a value.
|
5396
|
-
|
5397
|
-
@param source - should be a JavaScript primitive, Array, or (plain old) Object.
|
5398
|
-
@returns copy of source where every Array and Object have been recursively
|
5399
|
-
reconstructed from their constituent elements
|
5400
|
-
*/
|
5401
|
-
|
5402
|
-
function clone(source) {
|
5403
|
-
// loose-equality checking for null is faster than strict checking for each of null/undefined/true/false
|
5404
|
-
// checking null first, then calling typeof, is faster than vice-versa
|
5405
|
-
if (source == null || _typeof$4(source) != 'object') {
|
5406
|
-
// short-circuiting is faster than a single return
|
5407
|
-
return source;
|
5408
|
-
} // x.constructor == Array is the fastest way to check if x is an Array
|
5409
|
-
|
5410
|
-
|
5411
|
-
if (source.constructor == Array) {
|
5412
|
-
// construction via imperative for-loop is faster than source.map(arrayVsObject)
|
5413
|
-
var length_1 = source.length; // setting the Array length during construction is faster than just `[]` or `new Array()`
|
5414
|
-
|
5415
|
-
var arrayTarget = new Array(length_1);
|
5416
|
-
|
5417
|
-
for (var i = 0; i < length_1; i++) {
|
5418
|
-
arrayTarget[i] = clone(source[i]);
|
5419
|
-
}
|
5420
|
-
|
5421
|
-
return arrayTarget;
|
5422
|
-
} // Object
|
5423
|
-
|
5424
|
-
|
5425
|
-
var objectTarget = {}; // declaring the variable (with const) inside the loop is faster
|
5426
|
-
|
5427
|
-
for (var key in source) {
|
5428
|
-
// hasOwnProperty costs a bit of performance, but it's semantically necessary
|
5429
|
-
// using a global helper is MUCH faster than calling source.hasOwnProperty(key)
|
5430
|
-
if (exports.hasOwnProperty.call(source, key)) {
|
5431
|
-
objectTarget[key] = clone(source[key]);
|
5432
|
-
}
|
5433
|
-
}
|
5434
|
-
|
5435
|
-
return objectTarget;
|
5436
|
-
}
|
5437
|
-
|
5438
|
-
exports.clone = clone;
|
5439
|
-
})(util);
|
5440
|
-
|
5441
|
-
var equal = {};
|
5442
|
-
|
5443
|
-
Object.defineProperty(equal, "__esModule", {
|
5444
|
-
value: true
|
5445
|
-
});
|
5446
|
-
equal.compare = void 0;
|
5447
|
-
var util_1$2 = util;
|
5448
|
-
/**
|
5449
|
-
Evaluate `left === right`, treating `left` and `right` as ordered lists.
|
5450
|
-
|
5451
|
-
@returns true iff `left` and `right` have identical lengths, and every element
|
5452
|
-
of `left` is equal to the corresponding element of `right`. Equality is
|
5453
|
-
determined recursivly, via `compare`.
|
5454
|
-
*/
|
5455
|
-
|
5456
|
-
function compareArrays(left, right) {
|
5457
|
-
var length = left.length;
|
5458
|
-
|
5459
|
-
if (length !== right.length) {
|
5460
|
-
return false;
|
5461
|
-
}
|
5462
|
-
|
5463
|
-
for (var i = 0; i < length; i++) {
|
5464
|
-
if (!compare(left[i], right[i])) {
|
5465
|
-
return false;
|
5466
|
-
}
|
5467
|
-
}
|
5468
|
-
|
5469
|
-
return true;
|
5470
|
-
}
|
5471
|
-
/**
|
5472
|
-
Evaluate `left === right`, treating `left` and `right` as property maps.
|
5473
|
-
|
5474
|
-
@returns true iff every property in `left` has a value equal to the value of the
|
5475
|
-
corresponding property in `right`, and vice-versa, stopping as soon as
|
5476
|
-
possible. Equality is determined recursivly, via `compare`.
|
5477
|
-
*/
|
5478
|
-
|
5479
|
-
|
5480
|
-
function compareObjects(left, right) {
|
5481
|
-
var left_keys = Object.keys(left);
|
5482
|
-
var right_keys = Object.keys(right);
|
5483
|
-
var length = left_keys.length; // quick exit if the number of keys don't match up
|
5484
|
-
|
5485
|
-
if (length !== right_keys.length) {
|
5486
|
-
return false;
|
5487
|
-
} // we don't know for sure that Set(left_keys) is equal to Set(right_keys),
|
5488
|
-
// much less that their values in left and right are equal, but if right
|
5489
|
-
// contains each key in left, we know it can't have any additional keys
|
5490
|
-
|
5491
|
-
|
5492
|
-
for (var i = 0; i < length; i++) {
|
5493
|
-
var key = left_keys[i];
|
5494
|
-
|
5495
|
-
if (!util_1$2.hasOwnProperty.call(right, key) || !compare(left[key], right[key])) {
|
5496
|
-
return false;
|
5497
|
-
}
|
5498
|
-
}
|
5499
|
-
|
5500
|
-
return true;
|
5501
|
-
}
|
5502
|
-
/**
|
5503
|
-
`compare()` returns true if `left` and `right` are materially equal
|
5504
|
-
(i.e., would produce equivalent JSON), false otherwise.
|
5505
|
-
|
5506
|
-
> Here, "equal" means that the value at the target location and the
|
5507
|
-
> value conveyed by "value" are of the same JSON type, and that they
|
5508
|
-
> are considered equal by the following rules for that type:
|
5509
|
-
> o strings: are considered equal if they contain the same number of
|
5510
|
-
> Unicode characters and their code points are byte-by-byte equal.
|
5511
|
-
> o numbers: are considered equal if their values are numerically
|
5512
|
-
> equal.
|
5513
|
-
> o arrays: are considered equal if they contain the same number of
|
5514
|
-
> values, and if each value can be considered equal to the value at
|
5515
|
-
> the corresponding position in the other array, using this list of
|
5516
|
-
> type-specific rules.
|
5517
|
-
> o objects: are considered equal if they contain the same number of
|
5518
|
-
> members, and if each member can be considered equal to a member in
|
5519
|
-
> the other object, by comparing their keys (as strings) and their
|
5520
|
-
> values (using this list of type-specific rules).
|
5521
|
-
> o literals (false, true, and null): are considered equal if they are
|
5522
|
-
> the same.
|
5523
|
-
*/
|
5524
|
-
|
5525
|
-
|
5526
|
-
function compare(left, right) {
|
5527
|
-
// strict equality handles literals, numbers, and strings (a sufficient but not necessary cause)
|
5528
|
-
if (left === right) {
|
5529
|
-
return true;
|
5530
|
-
}
|
5531
|
-
|
5532
|
-
var left_type = util_1$2.objectType(left);
|
5533
|
-
var right_type = util_1$2.objectType(right); // check arrays
|
5534
|
-
|
5535
|
-
if (left_type == 'array' && right_type == 'array') {
|
5536
|
-
return compareArrays(left, right);
|
5537
|
-
} // check objects
|
5538
|
-
|
5539
|
-
|
5540
|
-
if (left_type == 'object' && right_type == 'object') {
|
5541
|
-
return compareObjects(left, right);
|
5542
|
-
} // mismatched arrays & objects, etc., are always inequal
|
5543
|
-
|
5544
|
-
|
5545
|
-
return false;
|
5546
|
-
}
|
5547
|
-
|
5548
|
-
equal.compare = compare;
|
5549
|
-
|
5550
|
-
var __extends = commonjsGlobal && commonjsGlobal.__extends || function () {
|
5551
|
-
var _extendStatics = function extendStatics(d, b) {
|
5552
|
-
_extendStatics = Object.setPrototypeOf || {
|
5553
|
-
__proto__: []
|
5554
|
-
} instanceof Array && function (d, b) {
|
5555
|
-
d.__proto__ = b;
|
5556
|
-
} || function (d, b) {
|
5557
|
-
for (var p in b) {
|
5558
|
-
if (b.hasOwnProperty(p)) d[p] = b[p];
|
5559
|
-
}
|
5560
|
-
};
|
5561
|
-
|
5562
|
-
return _extendStatics(d, b);
|
5563
|
-
};
|
5564
|
-
|
5565
|
-
return function (d, b) {
|
5566
|
-
_extendStatics(d, b);
|
5567
|
-
|
5568
|
-
function __() {
|
5569
|
-
this.constructor = d;
|
5570
|
-
}
|
5571
|
-
|
5572
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
5573
|
-
};
|
5574
|
-
}();
|
5575
|
-
|
5576
|
-
Object.defineProperty(patch, "__esModule", {
|
5577
|
-
value: true
|
5578
|
-
});
|
5579
|
-
patch.apply = patch.InvalidOperationError = patch.test = patch.copy = patch.move = patch.replace = patch.remove = patch.add = patch.TestError = patch.MissingError = void 0;
|
5580
|
-
var pointer_1$1 = pointer;
|
5581
|
-
var util_1$1 = util;
|
5582
|
-
var equal_1$1 = equal;
|
5583
|
-
|
5584
|
-
var MissingError =
|
5585
|
-
/** @class */
|
5586
|
-
function (_super) {
|
5587
|
-
__extends(MissingError, _super);
|
5588
|
-
|
5589
|
-
function MissingError(path) {
|
5590
|
-
var _this = _super.call(this, "Value required at path: " + path) || this;
|
5591
|
-
|
5592
|
-
_this.path = path;
|
5593
|
-
_this.name = 'MissingError';
|
5594
|
-
return _this;
|
5595
|
-
}
|
5596
|
-
|
5597
|
-
return MissingError;
|
5598
|
-
}(Error);
|
5599
|
-
|
5600
|
-
patch.MissingError = MissingError;
|
5601
|
-
|
5602
|
-
var TestError =
|
5603
|
-
/** @class */
|
5604
|
-
function (_super) {
|
5605
|
-
__extends(TestError, _super);
|
5606
|
-
|
5607
|
-
function TestError(actual, expected) {
|
5608
|
-
var _this = _super.call(this, "Test failed: " + actual + " != " + expected) || this;
|
5609
|
-
|
5610
|
-
_this.actual = actual;
|
5611
|
-
_this.expected = expected;
|
5612
|
-
_this.name = 'TestError';
|
5613
|
-
return _this;
|
5614
|
-
}
|
5615
|
-
|
5616
|
-
return TestError;
|
5617
|
-
}(Error);
|
5618
|
-
|
5619
|
-
patch.TestError = TestError;
|
5620
|
-
|
5621
|
-
function _add(object, key, value) {
|
5622
|
-
if (Array.isArray(object)) {
|
5623
|
-
// `key` must be an index
|
5624
|
-
if (key == '-') {
|
5625
|
-
object.push(value);
|
5626
|
-
} else {
|
5627
|
-
var index = parseInt(key, 10);
|
5628
|
-
object.splice(index, 0, value);
|
5629
|
-
}
|
5630
|
-
} else {
|
5631
|
-
object[key] = value;
|
5632
|
-
}
|
5633
|
-
}
|
5634
|
-
|
5635
|
-
function _remove(object, key) {
|
5636
|
-
if (Array.isArray(object)) {
|
5637
|
-
// '-' syntax doesn't make sense when removing
|
5638
|
-
var index = parseInt(key, 10);
|
5639
|
-
object.splice(index, 1);
|
5640
|
-
} else {
|
5641
|
-
// not sure what the proper behavior is when path = ''
|
5642
|
-
delete object[key];
|
5643
|
-
}
|
5644
|
-
}
|
5645
|
-
/**
|
5646
|
-
> o If the target location specifies an array index, a new value is
|
5647
|
-
> inserted into the array at the specified index.
|
5648
|
-
> o If the target location specifies an object member that does not
|
5649
|
-
> already exist, a new member is added to the object.
|
5650
|
-
> o If the target location specifies an object member that does exist,
|
5651
|
-
> that member's value is replaced.
|
5652
|
-
*/
|
5653
|
-
|
5654
|
-
|
5655
|
-
function add(object, operation) {
|
5656
|
-
var endpoint = pointer_1$1.Pointer.fromJSON(operation.path).evaluate(object); // it's not exactly a "MissingError" in the same way that `remove` is -- more like a MissingParent, or something
|
5657
|
-
|
5658
|
-
if (endpoint.parent === undefined) {
|
5659
|
-
return new MissingError(operation.path);
|
5660
|
-
}
|
5661
|
-
|
5662
|
-
_add(endpoint.parent, endpoint.key, util_1$1.clone(operation.value));
|
5663
|
-
|
5664
|
-
return null;
|
5665
|
-
}
|
5666
|
-
|
5667
|
-
patch.add = add;
|
5668
|
-
/**
|
5669
|
-
> The "remove" operation removes the value at the target location.
|
5670
|
-
> The target location MUST exist for the operation to be successful.
|
5671
|
-
*/
|
5672
|
-
|
5673
|
-
function remove(object, operation) {
|
5674
|
-
// endpoint has parent, key, and value properties
|
5675
|
-
var endpoint = pointer_1$1.Pointer.fromJSON(operation.path).evaluate(object);
|
5676
|
-
|
5677
|
-
if (endpoint.value === undefined) {
|
5678
|
-
return new MissingError(operation.path);
|
5679
|
-
} // not sure what the proper behavior is when path = ''
|
5680
|
-
|
5681
|
-
|
5682
|
-
_remove(endpoint.parent, endpoint.key);
|
5683
|
-
|
5684
|
-
return null;
|
5685
|
-
}
|
5686
|
-
|
5687
|
-
patch.remove = remove;
|
5688
|
-
/**
|
5689
|
-
> The "replace" operation replaces the value at the target location
|
5690
|
-
> with a new value. The operation object MUST contain a "value" member
|
5691
|
-
> whose content specifies the replacement value.
|
5692
|
-
> The target location MUST exist for the operation to be successful.
|
5693
|
-
|
5694
|
-
> This operation is functionally identical to a "remove" operation for
|
5695
|
-
> a value, followed immediately by an "add" operation at the same
|
5696
|
-
> location with the replacement value.
|
5697
|
-
|
5698
|
-
Even more simply, it's like the add operation with an existence check.
|
5699
|
-
*/
|
5700
|
-
|
5701
|
-
function replace$1(object, operation) {
|
5702
|
-
var endpoint = pointer_1$1.Pointer.fromJSON(operation.path).evaluate(object);
|
5703
|
-
|
5704
|
-
if (endpoint.parent === null) {
|
5705
|
-
return new MissingError(operation.path);
|
5706
|
-
} // this existence check treats arrays as a special case
|
5707
|
-
|
5708
|
-
|
5709
|
-
if (Array.isArray(endpoint.parent)) {
|
5710
|
-
if (parseInt(endpoint.key, 10) >= endpoint.parent.length) {
|
5711
|
-
return new MissingError(operation.path);
|
5712
|
-
}
|
5713
|
-
} else if (endpoint.value === undefined) {
|
5714
|
-
return new MissingError(operation.path);
|
5715
|
-
}
|
5716
|
-
|
5717
|
-
endpoint.parent[endpoint.key] = operation.value;
|
5718
|
-
return null;
|
5719
|
-
}
|
5720
|
-
|
5721
|
-
patch.replace = replace$1;
|
5722
|
-
/**
|
5723
|
-
> The "move" operation removes the value at a specified location and
|
5724
|
-
> adds it to the target location.
|
5725
|
-
> The operation object MUST contain a "from" member, which is a string
|
5726
|
-
> containing a JSON Pointer value that references the location in the
|
5727
|
-
> target document to move the value from.
|
5728
|
-
> This operation is functionally identical to a "remove" operation on
|
5729
|
-
> the "from" location, followed immediately by an "add" operation at
|
5730
|
-
> the target location with the value that was just removed.
|
5731
|
-
|
5732
|
-
> The "from" location MUST NOT be a proper prefix of the "path"
|
5733
|
-
> location; i.e., a location cannot be moved into one of its children.
|
5734
|
-
|
5735
|
-
TODO: throw if the check described in the previous paragraph fails.
|
5736
|
-
*/
|
5737
|
-
|
5738
|
-
function move(object, operation) {
|
5739
|
-
var from_endpoint = pointer_1$1.Pointer.fromJSON(operation.from).evaluate(object);
|
5740
|
-
|
5741
|
-
if (from_endpoint.value === undefined) {
|
5742
|
-
return new MissingError(operation.from);
|
5743
|
-
}
|
5744
|
-
|
5745
|
-
var endpoint = pointer_1$1.Pointer.fromJSON(operation.path).evaluate(object);
|
5746
|
-
|
5747
|
-
if (endpoint.parent === undefined) {
|
5748
|
-
return new MissingError(operation.path);
|
5749
|
-
}
|
5750
|
-
|
5751
|
-
_remove(from_endpoint.parent, from_endpoint.key);
|
5752
|
-
|
5753
|
-
_add(endpoint.parent, endpoint.key, from_endpoint.value);
|
5754
|
-
|
5755
|
-
return null;
|
5756
|
-
}
|
5757
|
-
|
5758
|
-
patch.move = move;
|
5759
|
-
/**
|
5760
|
-
> The "copy" operation copies the value at a specified location to the
|
5761
|
-
> target location.
|
5762
|
-
> The operation object MUST contain a "from" member, which is a string
|
5763
|
-
> containing a JSON Pointer value that references the location in the
|
5764
|
-
> target document to copy the value from.
|
5765
|
-
> The "from" location MUST exist for the operation to be successful.
|
5766
|
-
|
5767
|
-
> This operation is functionally identical to an "add" operation at the
|
5768
|
-
> target location using the value specified in the "from" member.
|
5769
|
-
|
5770
|
-
Alternatively, it's like 'move' without the 'remove'.
|
5771
|
-
*/
|
5772
|
-
|
5773
|
-
function copy(object, operation) {
|
5774
|
-
var from_endpoint = pointer_1$1.Pointer.fromJSON(operation.from).evaluate(object);
|
5775
|
-
|
5776
|
-
if (from_endpoint.value === undefined) {
|
5777
|
-
return new MissingError(operation.from);
|
5778
|
-
}
|
5779
|
-
|
5780
|
-
var endpoint = pointer_1$1.Pointer.fromJSON(operation.path).evaluate(object);
|
5781
|
-
|
5782
|
-
if (endpoint.parent === undefined) {
|
5783
|
-
return new MissingError(operation.path);
|
5784
|
-
}
|
5785
|
-
|
5786
|
-
_add(endpoint.parent, endpoint.key, util_1$1.clone(from_endpoint.value));
|
5787
|
-
|
5788
|
-
return null;
|
5789
|
-
}
|
5790
|
-
|
5791
|
-
patch.copy = copy;
|
5792
|
-
/**
|
5793
|
-
> The "test" operation tests that a value at the target location is
|
5794
|
-
> equal to a specified value.
|
5795
|
-
> The operation object MUST contain a "value" member that conveys the
|
5796
|
-
> value to be compared to the target location's value.
|
5797
|
-
> The target location MUST be equal to the "value" value for the
|
5798
|
-
> operation to be considered successful.
|
5799
|
-
*/
|
5800
|
-
|
5801
|
-
function test$1(object, operation) {
|
5802
|
-
var endpoint = pointer_1$1.Pointer.fromJSON(operation.path).evaluate(object);
|
5803
|
-
var result = equal_1$1.compare(endpoint.value, operation.value);
|
5804
|
-
|
5805
|
-
if (!result) {
|
5806
|
-
return new TestError(endpoint.value, operation.value);
|
5807
|
-
}
|
5808
|
-
|
5809
|
-
return null;
|
5810
|
-
}
|
5811
|
-
|
5812
|
-
patch.test = test$1;
|
5813
|
-
|
5814
|
-
var InvalidOperationError =
|
5815
|
-
/** @class */
|
5816
|
-
function (_super) {
|
5817
|
-
__extends(InvalidOperationError, _super);
|
5818
|
-
|
5819
|
-
function InvalidOperationError(operation) {
|
5820
|
-
var _this = _super.call(this, "Invalid operation: " + operation.op) || this;
|
5821
|
-
|
5822
|
-
_this.operation = operation;
|
5823
|
-
_this.name = 'InvalidOperationError';
|
5824
|
-
return _this;
|
5825
|
-
}
|
5826
|
-
|
5827
|
-
return InvalidOperationError;
|
5828
|
-
}(Error);
|
5829
|
-
|
5830
|
-
patch.InvalidOperationError = InvalidOperationError;
|
5831
|
-
/**
|
5832
|
-
Switch on `operation.op`, applying the corresponding patch function for each
|
5833
|
-
case to `object`.
|
5834
|
-
*/
|
5835
|
-
|
5836
|
-
function apply(object, operation) {
|
5837
|
-
// not sure why TypeScript can't infer typesafety of:
|
5838
|
-
// {add, remove, replace, move, copy, test}[operation.op](object, operation)
|
5839
|
-
// (seems like a bug)
|
5840
|
-
switch (operation.op) {
|
5841
|
-
case 'add':
|
5842
|
-
return add(object, operation);
|
5843
|
-
|
5844
|
-
case 'remove':
|
5845
|
-
return remove(object, operation);
|
5846
|
-
|
5847
|
-
case 'replace':
|
5848
|
-
return replace$1(object, operation);
|
5849
|
-
|
5850
|
-
case 'move':
|
5851
|
-
return move(object, operation);
|
5852
|
-
|
5853
|
-
case 'copy':
|
5854
|
-
return copy(object, operation);
|
5855
|
-
|
5856
|
-
case 'test':
|
5857
|
-
return test$1(object, operation);
|
5858
|
-
}
|
5859
|
-
|
5860
|
-
return new InvalidOperationError(operation);
|
5861
|
-
}
|
5862
|
-
|
5863
|
-
patch.apply = apply;
|
5864
|
-
|
5865
|
-
var diff = {};
|
5866
|
-
|
5867
|
-
Object.defineProperty(diff, "__esModule", {
|
5868
|
-
value: true
|
5869
|
-
});
|
5870
|
-
diff.diffAny = diff.diffObjects = diff.diffArrays = diff.intersection = diff.subtract = diff.isDestructive = void 0;
|
5871
|
-
var equal_1 = equal;
|
5872
|
-
var util_1 = util;
|
5873
|
-
|
5874
|
-
function isDestructive(_a) {
|
5875
|
-
var op = _a.op;
|
5876
|
-
return op === 'remove' || op === 'replace' || op === 'copy' || op === 'move';
|
5877
|
-
}
|
5878
|
-
|
5879
|
-
diff.isDestructive = isDestructive;
|
5880
|
-
/**
|
5881
|
-
List the keys in `minuend` that are not in `subtrahend`.
|
5882
|
-
|
5883
|
-
A key is only considered if it is both 1) an own-property (o.hasOwnProperty(k))
|
5884
|
-
of the object, and 2) has a value that is not undefined. This is to match JSON
|
5885
|
-
semantics, where JSON object serialization drops keys with undefined values.
|
5886
|
-
|
5887
|
-
@param minuend Object of interest
|
5888
|
-
@param subtrahend Object of comparison
|
5889
|
-
@returns Array of keys that are in `minuend` but not in `subtrahend`.
|
5890
|
-
*/
|
5891
|
-
|
5892
|
-
function subtract(minuend, subtrahend) {
|
5893
|
-
// initialize empty object; we only care about the keys, the values can be anything
|
5894
|
-
var obj = {}; // build up obj with all the properties of minuend
|
5895
|
-
|
5896
|
-
for (var add_key in minuend) {
|
5897
|
-
if (util_1.hasOwnProperty.call(minuend, add_key) && minuend[add_key] !== undefined) {
|
5898
|
-
obj[add_key] = 1;
|
5899
|
-
}
|
5900
|
-
} // now delete all the properties of subtrahend from obj
|
5901
|
-
// (deleting a missing key has no effect)
|
5902
|
-
|
5903
|
-
|
5904
|
-
for (var del_key in subtrahend) {
|
5905
|
-
if (util_1.hasOwnProperty.call(subtrahend, del_key) && subtrahend[del_key] !== undefined) {
|
5906
|
-
delete obj[del_key];
|
5907
|
-
}
|
5908
|
-
} // finally, extract whatever keys remain in obj
|
5909
|
-
|
5910
|
-
|
5911
|
-
return Object.keys(obj);
|
5912
|
-
}
|
5913
|
-
|
5914
|
-
diff.subtract = subtract;
|
5915
|
-
/**
|
5916
|
-
List the keys that shared by all `objects`.
|
5917
|
-
|
5918
|
-
The semantics of what constitutes a "key" is described in {@link subtract}.
|
5919
|
-
|
5920
|
-
@param objects Array of objects to compare
|
5921
|
-
@returns Array of keys that are in ("own-properties" of) every object in `objects`.
|
5922
|
-
*/
|
5923
|
-
|
5924
|
-
function intersection(objects) {
|
5925
|
-
var length = objects.length; // prepare empty counter to keep track of how many objects each key occurred in
|
5926
|
-
|
5927
|
-
var counter = {}; // go through each object and increment the counter for each key in that object
|
5928
|
-
|
5929
|
-
for (var i = 0; i < length; i++) {
|
5930
|
-
var object = objects[i];
|
5931
|
-
|
5932
|
-
for (var key in object) {
|
5933
|
-
if (util_1.hasOwnProperty.call(object, key) && object[key] !== undefined) {
|
5934
|
-
counter[key] = (counter[key] || 0) + 1;
|
5935
|
-
}
|
5936
|
-
}
|
5937
|
-
} // now delete all keys from the counter that were not seen in every object
|
5938
|
-
|
5939
|
-
|
5940
|
-
for (var key in counter) {
|
5941
|
-
if (counter[key] < length) {
|
5942
|
-
delete counter[key];
|
5943
|
-
}
|
5944
|
-
} // finally, extract whatever keys remain in the counter
|
5945
|
-
|
5946
|
-
|
5947
|
-
return Object.keys(counter);
|
5948
|
-
}
|
5949
|
-
|
5950
|
-
diff.intersection = intersection;
|
5951
|
-
|
5952
|
-
function isArrayAdd(array_operation) {
|
5953
|
-
return array_operation.op === 'add';
|
5954
|
-
}
|
5955
|
-
|
5956
|
-
function isArrayRemove(array_operation) {
|
5957
|
-
return array_operation.op === 'remove';
|
5958
|
-
}
|
5959
|
-
|
5960
|
-
function appendArrayOperation(base, operation) {
|
5961
|
-
return {
|
5962
|
-
// the new operation must be pushed on the end
|
5963
|
-
operations: base.operations.concat(operation),
|
5964
|
-
cost: base.cost + 1
|
5965
|
-
};
|
5966
|
-
}
|
5967
|
-
/**
|
5968
|
-
Calculate the shortest sequence of operations to get from `input` to `output`,
|
5969
|
-
using a dynamic programming implementation of the Levenshtein distance algorithm.
|
5970
|
-
|
5971
|
-
To get from the input ABC to the output AZ we could just delete all the input
|
5972
|
-
and say "insert A, insert Z" and be done with it. That's what we do if the
|
5973
|
-
input is empty. But we can be smarter.
|
5974
|
-
|
5975
|
-
output
|
5976
|
-
A Z
|
5977
|
-
- -
|
5978
|
-
[0] 1 2
|
5979
|
-
input A | 1 [0] 1
|
5980
|
-
B | 2 [1] 1
|
5981
|
-
C | 3 2 [2]
|
5982
|
-
|
5983
|
-
1) start at 0,0 (+0)
|
5984
|
-
2) keep A (+0)
|
5985
|
-
3) remove B (+1)
|
5986
|
-
4) replace C with Z (+1)
|
5987
|
-
|
5988
|
-
If the `input` (source) is empty, they'll all be in the top row, resulting in an
|
5989
|
-
array of 'add' operations.
|
5990
|
-
If the `output` (target) is empty, everything will be in the left column,
|
5991
|
-
resulting in an array of 'remove' operations.
|
5992
|
-
|
5993
|
-
@returns A list of add/remove/replace operations.
|
5994
|
-
*/
|
5995
|
-
|
5996
|
-
|
5997
|
-
function diffArrays(input, output, ptr, diff) {
|
5998
|
-
if (diff === void 0) {
|
5999
|
-
diff = diffAny;
|
6000
|
-
} // set up cost matrix (very simple initialization: just a map)
|
6001
|
-
|
6002
|
-
|
6003
|
-
var memo = {
|
6004
|
-
'0,0': {
|
6005
|
-
operations: [],
|
6006
|
-
cost: 0
|
6007
|
-
}
|
6008
|
-
};
|
6009
|
-
/**
|
6010
|
-
Calculate the cheapest sequence of operations required to get from
|
6011
|
-
input.slice(0, i) to output.slice(0, j).
|
6012
|
-
There may be other valid sequences with the same cost, but none cheaper.
|
6013
|
-
@param i The row in the layout above
|
6014
|
-
@param j The column in the layout above
|
6015
|
-
@returns An object containing a list of operations, along with the total cost
|
6016
|
-
of applying them (+1 for each add/remove/replace operation)
|
6017
|
-
*/
|
6018
|
-
|
6019
|
-
function dist(i, j) {
|
6020
|
-
// memoized
|
6021
|
-
var memo_key = i + "," + j;
|
6022
|
-
var memoized = memo[memo_key];
|
6023
|
-
|
6024
|
-
if (memoized === undefined) {
|
6025
|
-
if (i > 0 && j > 0 && equal_1.compare(input[i - 1], output[j - 1])) {
|
6026
|
-
// equal (no operations => no cost)
|
6027
|
-
memoized = dist(i - 1, j - 1);
|
6028
|
-
} else {
|
6029
|
-
var alternatives = [];
|
6030
|
-
|
6031
|
-
if (i > 0) {
|
6032
|
-
// NOT topmost row
|
6033
|
-
var remove_base = dist(i - 1, j);
|
6034
|
-
var remove_operation = {
|
6035
|
-
op: 'remove',
|
6036
|
-
index: i - 1
|
6037
|
-
};
|
6038
|
-
alternatives.push(appendArrayOperation(remove_base, remove_operation));
|
6039
|
-
}
|
6040
|
-
|
6041
|
-
if (j > 0) {
|
6042
|
-
// NOT leftmost column
|
6043
|
-
var add_base = dist(i, j - 1);
|
6044
|
-
var add_operation = {
|
6045
|
-
op: 'add',
|
6046
|
-
index: i - 1,
|
6047
|
-
value: output[j - 1]
|
6048
|
-
};
|
6049
|
-
alternatives.push(appendArrayOperation(add_base, add_operation));
|
6050
|
-
}
|
6051
|
-
|
6052
|
-
if (i > 0 && j > 0) {
|
6053
|
-
// TABLE MIDDLE
|
6054
|
-
// supposing we replaced it, compute the rest of the costs:
|
6055
|
-
var replace_base = dist(i - 1, j - 1); // okay, the general plan is to replace it, but we can be smarter,
|
6056
|
-
// recursing into the structure and replacing only part of it if
|
6057
|
-
// possible, but to do so we'll need the original value
|
6058
|
-
|
6059
|
-
var replace_operation = {
|
6060
|
-
op: 'replace',
|
6061
|
-
index: i - 1,
|
6062
|
-
original: input[i - 1],
|
6063
|
-
value: output[j - 1]
|
6064
|
-
};
|
6065
|
-
alternatives.push(appendArrayOperation(replace_base, replace_operation));
|
6066
|
-
} // the only other case, i === 0 && j === 0, has already been memoized
|
6067
|
-
// the meat of the algorithm:
|
6068
|
-
// sort by cost to find the lowest one (might be several ties for lowest)
|
6069
|
-
// [4, 6, 7, 1, 2].sort((a, b) => a - b) -> [ 1, 2, 4, 6, 7 ]
|
6070
|
-
|
6071
|
-
|
6072
|
-
var best = alternatives.sort(function (a, b) {
|
6073
|
-
return a.cost - b.cost;
|
6074
|
-
})[0];
|
6075
|
-
memoized = best;
|
6076
|
-
}
|
6077
|
-
|
6078
|
-
memo[memo_key] = memoized;
|
6079
|
-
}
|
6080
|
-
|
6081
|
-
return memoized;
|
6082
|
-
} // handle weird objects masquerading as Arrays that don't have proper length
|
6083
|
-
// properties by using 0 for everything but positive numbers
|
6084
|
-
|
6085
|
-
|
6086
|
-
var input_length = isNaN(input.length) || input.length <= 0 ? 0 : input.length;
|
6087
|
-
var output_length = isNaN(output.length) || output.length <= 0 ? 0 : output.length;
|
6088
|
-
var array_operations = dist(input_length, output_length).operations;
|
6089
|
-
var padded_operations = array_operations.reduce(function (_a, array_operation) {
|
6090
|
-
var operations = _a[0],
|
6091
|
-
padding = _a[1];
|
6092
|
-
|
6093
|
-
if (isArrayAdd(array_operation)) {
|
6094
|
-
var padded_index = array_operation.index + 1 + padding;
|
6095
|
-
var index_token = padded_index < input_length + padding ? String(padded_index) : '-';
|
6096
|
-
var operation = {
|
6097
|
-
op: array_operation.op,
|
6098
|
-
path: ptr.add(index_token).toString(),
|
6099
|
-
value: array_operation.value
|
6100
|
-
}; // padding++ // maybe only if array_operation.index > -1 ?
|
6101
|
-
|
6102
|
-
return [operations.concat(operation), padding + 1];
|
6103
|
-
} else if (isArrayRemove(array_operation)) {
|
6104
|
-
var operation = {
|
6105
|
-
op: array_operation.op,
|
6106
|
-
path: ptr.add(String(array_operation.index + padding)).toString()
|
6107
|
-
}; // padding--
|
6108
|
-
|
6109
|
-
return [operations.concat(operation), padding - 1];
|
6110
|
-
} else {
|
6111
|
-
// replace
|
6112
|
-
var replace_ptr = ptr.add(String(array_operation.index + padding));
|
6113
|
-
var replace_operations = diff(array_operation.original, array_operation.value, replace_ptr);
|
6114
|
-
return [operations.concat.apply(operations, replace_operations), padding];
|
6115
|
-
}
|
6116
|
-
}, [[], 0])[0];
|
6117
|
-
return padded_operations;
|
6118
|
-
}
|
6119
|
-
|
6120
|
-
diff.diffArrays = diffArrays;
|
6121
|
-
|
6122
|
-
function diffObjects(input, output, ptr, diff) {
|
6123
|
-
if (diff === void 0) {
|
6124
|
-
diff = diffAny;
|
6125
|
-
} // if a key is in input but not output -> remove it
|
6126
|
-
|
6127
|
-
|
6128
|
-
var operations = [];
|
6129
|
-
subtract(input, output).forEach(function (key) {
|
6130
|
-
operations.push({
|
6131
|
-
op: 'remove',
|
6132
|
-
path: ptr.add(key).toString()
|
6133
|
-
});
|
6134
|
-
}); // if a key is in output but not input -> add it
|
6135
|
-
|
6136
|
-
subtract(output, input).forEach(function (key) {
|
6137
|
-
operations.push({
|
6138
|
-
op: 'add',
|
6139
|
-
path: ptr.add(key).toString(),
|
6140
|
-
value: output[key]
|
6141
|
-
});
|
6142
|
-
}); // if a key is in both, diff it recursively
|
6143
|
-
|
6144
|
-
intersection([input, output]).forEach(function (key) {
|
6145
|
-
operations.push.apply(operations, diff(input[key], output[key], ptr.add(key)));
|
6146
|
-
});
|
6147
|
-
return operations;
|
6148
|
-
}
|
6149
|
-
|
6150
|
-
diff.diffObjects = diffObjects;
|
6151
|
-
/**
|
6152
|
-
`diffAny()` returns an empty array if `input` and `output` are materially equal
|
6153
|
-
(i.e., would produce equivalent JSON); otherwise it produces an array of patches
|
6154
|
-
that would transform `input` into `output`.
|
6155
|
-
*/
|
6156
|
-
|
6157
|
-
function diffAny(input, output, ptr, diff) {
|
6158
|
-
if (diff === void 0) {
|
6159
|
-
diff = diffAny;
|
6160
|
-
} // strict equality handles literals, numbers, and strings (a sufficient but not necessary cause)
|
6161
|
-
|
6162
|
-
|
6163
|
-
if (input === output) {
|
6164
|
-
return [];
|
6165
|
-
}
|
6166
|
-
|
6167
|
-
var input_type = util_1.objectType(input);
|
6168
|
-
var output_type = util_1.objectType(output);
|
6169
|
-
|
6170
|
-
if (input_type == 'array' && output_type == 'array') {
|
6171
|
-
return diffArrays(input, output, ptr, diff);
|
6172
|
-
}
|
6173
|
-
|
6174
|
-
if (input_type == 'object' && output_type == 'object') {
|
6175
|
-
return diffObjects(input, output, ptr, diff);
|
6176
|
-
} // at this point we know that input and output are materially different;
|
6177
|
-
// could be array -> object, object -> array, boolean -> undefined,
|
6178
|
-
// number -> string, or some other combination, but nothing that can be split
|
6179
|
-
// up into multiple patches: so `output` must replace `input` wholesale.
|
6180
|
-
|
6181
|
-
|
6182
|
-
return [{
|
6183
|
-
op: 'replace',
|
6184
|
-
path: ptr.toString(),
|
6185
|
-
value: output
|
6186
|
-
}];
|
6187
|
-
}
|
6188
|
-
|
6189
|
-
diff.diffAny = diffAny;
|
6190
|
-
|
6191
|
-
Object.defineProperty(rfc6902, "__esModule", {
|
6192
|
-
value: true
|
6193
|
-
});
|
6194
|
-
rfc6902.createTests = createPatch_1 = rfc6902.createPatch = rfc6902.applyPatch = void 0;
|
6195
|
-
var pointer_1 = pointer;
|
6196
|
-
var patch_1 = patch;
|
6197
|
-
var diff_1 = diff;
|
6198
|
-
/**
|
6199
|
-
Apply a 'application/json-patch+json'-type patch to an object.
|
6200
|
-
|
6201
|
-
`patch` *must* be an array of operations.
|
6202
|
-
|
6203
|
-
> Operation objects MUST have exactly one "op" member, whose value
|
6204
|
-
> indicates the operation to perform. Its value MUST be one of "add",
|
6205
|
-
> "remove", "replace", "move", "copy", or "test"; other values are
|
6206
|
-
> errors.
|
6207
|
-
|
6208
|
-
This method mutates the target object in-place.
|
6209
|
-
|
6210
|
-
@returns list of results, one for each operation: `null` indicated success,
|
6211
|
-
otherwise, the result will be an instance of one of the Error classes:
|
6212
|
-
MissingError, InvalidOperationError, or TestError.
|
6213
|
-
*/
|
6214
|
-
|
6215
|
-
function applyPatch(object, patch) {
|
6216
|
-
return patch.map(function (operation) {
|
6217
|
-
return patch_1.apply(object, operation);
|
6218
|
-
});
|
6219
|
-
}
|
6220
|
-
|
6221
|
-
rfc6902.applyPatch = applyPatch;
|
6222
|
-
|
6223
|
-
function wrapVoidableDiff(diff) {
|
6224
|
-
function wrappedDiff(input, output, ptr) {
|
6225
|
-
var custom_patch = diff(input, output, ptr); // ensure an array is always returned
|
6226
|
-
|
6227
|
-
return Array.isArray(custom_patch) ? custom_patch : diff_1.diffAny(input, output, ptr, wrappedDiff);
|
6228
|
-
}
|
6229
|
-
|
6230
|
-
return wrappedDiff;
|
6231
|
-
}
|
6232
|
-
/**
|
6233
|
-
Produce a 'application/json-patch+json'-type patch to get from one object to
|
6234
|
-
another.
|
6235
|
-
|
6236
|
-
This does not alter `input` or `output` unless they have a property getter with
|
6237
|
-
side-effects (which is not a good idea anyway).
|
6238
|
-
|
6239
|
-
`diff` is called on each pair of comparable non-primitive nodes in the
|
6240
|
-
`input`/`output` object trees, producing nested patches. Return `undefined`
|
6241
|
-
to fall back to default behaviour.
|
6242
|
-
|
6243
|
-
Returns list of operations to perform on `input` to produce `output`.
|
6244
|
-
*/
|
6245
|
-
|
6246
|
-
|
6247
|
-
function createPatch(input, output, diff) {
|
6248
|
-
var ptr = new pointer_1.Pointer(); // a new Pointer gets a default path of [''] if not specified
|
6249
|
-
|
6250
|
-
return (diff ? wrapVoidableDiff(diff) : diff_1.diffAny)(input, output, ptr);
|
6251
|
-
}
|
6252
|
-
|
6253
|
-
var createPatch_1 = rfc6902.createPatch = createPatch;
|
6254
|
-
/**
|
6255
|
-
Create a test operation based on `input`'s current evaluation of the JSON
|
6256
|
-
Pointer `path`; if such a pointer cannot be resolved, returns undefined.
|
6257
|
-
*/
|
6258
|
-
|
6259
|
-
function createTest(input, path) {
|
6260
|
-
var endpoint = pointer_1.Pointer.fromJSON(path).evaluate(input);
|
6261
|
-
|
6262
|
-
if (endpoint !== undefined) {
|
6263
|
-
return {
|
6264
|
-
op: 'test',
|
6265
|
-
path: path,
|
6266
|
-
value: endpoint.value
|
6267
|
-
};
|
6268
|
-
}
|
6269
|
-
}
|
6270
|
-
/**
|
6271
|
-
Produce an 'application/json-patch+json'-type list of tests, to verify that
|
6272
|
-
existing values in an object are identical to the those captured at some
|
6273
|
-
checkpoint (whenever this function is called).
|
6274
|
-
|
6275
|
-
This does not alter `input` or `output` unless they have a property getter with
|
6276
|
-
side-effects (which is not a good idea anyway).
|
6277
|
-
|
6278
|
-
Returns list of test operations.
|
6279
|
-
*/
|
6280
|
-
|
6281
|
-
|
6282
|
-
function createTests(input, patch) {
|
6283
|
-
var tests = new Array();
|
6284
|
-
patch.filter(diff_1.isDestructive).forEach(function (operation) {
|
6285
|
-
var pathTest = createTest(input, operation.path);
|
6286
|
-
if (pathTest) tests.push(pathTest);
|
6287
|
-
|
6288
|
-
if ('from' in operation) {
|
6289
|
-
var fromTest = createTest(input, operation.from);
|
6290
|
-
if (fromTest) tests.push(fromTest);
|
6291
|
-
}
|
6292
|
-
});
|
6293
|
-
return tests;
|
6294
|
-
}
|
6295
|
-
|
6296
|
-
rfc6902.createTests = createTests;
|
6297
|
-
|
6298
|
-
/**
|
6299
|
-
* Checks if objects are equal
|
6300
|
-
*/
|
6301
|
-
|
6302
|
-
function isDeepEqual(o1, o2) {
|
6303
|
-
return createPatch_1(o1, o2).length === 0;
|
6304
|
-
}
|
6305
5227
|
/**
|
6306
5228
|
* Deep-clone an object. Note that this does not work on object containing
|
6307
5229
|
* functions.
|
6308
5230
|
* @param {object} obj - the object to deep-clone
|
6309
5231
|
* @returns {object}
|
6310
5232
|
*/
|
6311
|
-
|
6312
|
-
|
6313
5233
|
function deepClone$1(obj) {
|
6314
5234
|
return JSON.parse(JSON.stringify(obj));
|
6315
5235
|
}
|
@@ -8413,6 +7333,1926 @@ this.Twilio.Conversations = (function (exports) {
|
|
8413
7333
|
|
8414
7334
|
var ReplayEventEmitter_1 = browser$5.ReplayEventEmitter = ReplayEventEmitter;
|
8415
7335
|
|
7336
|
+
var lodash_isequal = {exports: {}};
|
7337
|
+
|
7338
|
+
(function (module, exports) {
|
7339
|
+
/** Used as the size to enable large array optimizations. */
|
7340
|
+
var LARGE_ARRAY_SIZE = 200;
|
7341
|
+
/** Used to stand-in for `undefined` hash values. */
|
7342
|
+
|
7343
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
7344
|
+
/** Used to compose bitmasks for value comparisons. */
|
7345
|
+
|
7346
|
+
var COMPARE_PARTIAL_FLAG = 1,
|
7347
|
+
COMPARE_UNORDERED_FLAG = 2;
|
7348
|
+
/** Used as references for various `Number` constants. */
|
7349
|
+
|
7350
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
7351
|
+
/** `Object#toString` result references. */
|
7352
|
+
|
7353
|
+
var argsTag = '[object Arguments]',
|
7354
|
+
arrayTag = '[object Array]',
|
7355
|
+
asyncTag = '[object AsyncFunction]',
|
7356
|
+
boolTag = '[object Boolean]',
|
7357
|
+
dateTag = '[object Date]',
|
7358
|
+
errorTag = '[object Error]',
|
7359
|
+
funcTag = '[object Function]',
|
7360
|
+
genTag = '[object GeneratorFunction]',
|
7361
|
+
mapTag = '[object Map]',
|
7362
|
+
numberTag = '[object Number]',
|
7363
|
+
nullTag = '[object Null]',
|
7364
|
+
objectTag = '[object Object]',
|
7365
|
+
promiseTag = '[object Promise]',
|
7366
|
+
proxyTag = '[object Proxy]',
|
7367
|
+
regexpTag = '[object RegExp]',
|
7368
|
+
setTag = '[object Set]',
|
7369
|
+
stringTag = '[object String]',
|
7370
|
+
symbolTag = '[object Symbol]',
|
7371
|
+
undefinedTag = '[object Undefined]',
|
7372
|
+
weakMapTag = '[object WeakMap]';
|
7373
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
7374
|
+
dataViewTag = '[object DataView]',
|
7375
|
+
float32Tag = '[object Float32Array]',
|
7376
|
+
float64Tag = '[object Float64Array]',
|
7377
|
+
int8Tag = '[object Int8Array]',
|
7378
|
+
int16Tag = '[object Int16Array]',
|
7379
|
+
int32Tag = '[object Int32Array]',
|
7380
|
+
uint8Tag = '[object Uint8Array]',
|
7381
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
7382
|
+
uint16Tag = '[object Uint16Array]',
|
7383
|
+
uint32Tag = '[object Uint32Array]';
|
7384
|
+
/**
|
7385
|
+
* Used to match `RegExp`
|
7386
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
7387
|
+
*/
|
7388
|
+
|
7389
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
7390
|
+
/** Used to detect host constructors (Safari). */
|
7391
|
+
|
7392
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
7393
|
+
/** Used to detect unsigned integer values. */
|
7394
|
+
|
7395
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
7396
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
7397
|
+
|
7398
|
+
var typedArrayTags = {};
|
7399
|
+
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
7400
|
+
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
7401
|
+
/** Detect free variable `global` from Node.js. */
|
7402
|
+
|
7403
|
+
var freeGlobal = _typeof$4(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
7404
|
+
/** Detect free variable `self`. */
|
7405
|
+
|
7406
|
+
var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof$4(self)) == 'object' && self && self.Object === Object && self;
|
7407
|
+
/** Used as a reference to the global object. */
|
7408
|
+
|
7409
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
7410
|
+
/** Detect free variable `exports`. */
|
7411
|
+
|
7412
|
+
var freeExports = exports && !exports.nodeType && exports;
|
7413
|
+
/** Detect free variable `module`. */
|
7414
|
+
|
7415
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
7416
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
7417
|
+
|
7418
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
7419
|
+
/** Detect free variable `process` from Node.js. */
|
7420
|
+
|
7421
|
+
var freeProcess = moduleExports && freeGlobal.process;
|
7422
|
+
/** Used to access faster Node.js helpers. */
|
7423
|
+
|
7424
|
+
var nodeUtil = function () {
|
7425
|
+
try {
|
7426
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
7427
|
+
} catch (e) {}
|
7428
|
+
}();
|
7429
|
+
/* Node.js helper references. */
|
7430
|
+
|
7431
|
+
|
7432
|
+
var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
7433
|
+
/**
|
7434
|
+
* A specialized version of `_.filter` for arrays without support for
|
7435
|
+
* iteratee shorthands.
|
7436
|
+
*
|
7437
|
+
* @private
|
7438
|
+
* @param {Array} [array] The array to iterate over.
|
7439
|
+
* @param {Function} predicate The function invoked per iteration.
|
7440
|
+
* @returns {Array} Returns the new filtered array.
|
7441
|
+
*/
|
7442
|
+
|
7443
|
+
function arrayFilter(array, predicate) {
|
7444
|
+
var index = -1,
|
7445
|
+
length = array == null ? 0 : array.length,
|
7446
|
+
resIndex = 0,
|
7447
|
+
result = [];
|
7448
|
+
|
7449
|
+
while (++index < length) {
|
7450
|
+
var value = array[index];
|
7451
|
+
|
7452
|
+
if (predicate(value, index, array)) {
|
7453
|
+
result[resIndex++] = value;
|
7454
|
+
}
|
7455
|
+
}
|
7456
|
+
|
7457
|
+
return result;
|
7458
|
+
}
|
7459
|
+
/**
|
7460
|
+
* Appends the elements of `values` to `array`.
|
7461
|
+
*
|
7462
|
+
* @private
|
7463
|
+
* @param {Array} array The array to modify.
|
7464
|
+
* @param {Array} values The values to append.
|
7465
|
+
* @returns {Array} Returns `array`.
|
7466
|
+
*/
|
7467
|
+
|
7468
|
+
|
7469
|
+
function arrayPush(array, values) {
|
7470
|
+
var index = -1,
|
7471
|
+
length = values.length,
|
7472
|
+
offset = array.length;
|
7473
|
+
|
7474
|
+
while (++index < length) {
|
7475
|
+
array[offset + index] = values[index];
|
7476
|
+
}
|
7477
|
+
|
7478
|
+
return array;
|
7479
|
+
}
|
7480
|
+
/**
|
7481
|
+
* A specialized version of `_.some` for arrays without support for iteratee
|
7482
|
+
* shorthands.
|
7483
|
+
*
|
7484
|
+
* @private
|
7485
|
+
* @param {Array} [array] The array to iterate over.
|
7486
|
+
* @param {Function} predicate The function invoked per iteration.
|
7487
|
+
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
7488
|
+
* else `false`.
|
7489
|
+
*/
|
7490
|
+
|
7491
|
+
|
7492
|
+
function arraySome(array, predicate) {
|
7493
|
+
var index = -1,
|
7494
|
+
length = array == null ? 0 : array.length;
|
7495
|
+
|
7496
|
+
while (++index < length) {
|
7497
|
+
if (predicate(array[index], index, array)) {
|
7498
|
+
return true;
|
7499
|
+
}
|
7500
|
+
}
|
7501
|
+
|
7502
|
+
return false;
|
7503
|
+
}
|
7504
|
+
/**
|
7505
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
7506
|
+
* or max array length checks.
|
7507
|
+
*
|
7508
|
+
* @private
|
7509
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
7510
|
+
* @param {Function} iteratee The function invoked per iteration.
|
7511
|
+
* @returns {Array} Returns the array of results.
|
7512
|
+
*/
|
7513
|
+
|
7514
|
+
|
7515
|
+
function baseTimes(n, iteratee) {
|
7516
|
+
var index = -1,
|
7517
|
+
result = Array(n);
|
7518
|
+
|
7519
|
+
while (++index < n) {
|
7520
|
+
result[index] = iteratee(index);
|
7521
|
+
}
|
7522
|
+
|
7523
|
+
return result;
|
7524
|
+
}
|
7525
|
+
/**
|
7526
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
7527
|
+
*
|
7528
|
+
* @private
|
7529
|
+
* @param {Function} func The function to cap arguments for.
|
7530
|
+
* @returns {Function} Returns the new capped function.
|
7531
|
+
*/
|
7532
|
+
|
7533
|
+
|
7534
|
+
function baseUnary(func) {
|
7535
|
+
return function (value) {
|
7536
|
+
return func(value);
|
7537
|
+
};
|
7538
|
+
}
|
7539
|
+
/**
|
7540
|
+
* Checks if a `cache` value for `key` exists.
|
7541
|
+
*
|
7542
|
+
* @private
|
7543
|
+
* @param {Object} cache The cache to query.
|
7544
|
+
* @param {string} key The key of the entry to check.
|
7545
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
7546
|
+
*/
|
7547
|
+
|
7548
|
+
|
7549
|
+
function cacheHas(cache, key) {
|
7550
|
+
return cache.has(key);
|
7551
|
+
}
|
7552
|
+
/**
|
7553
|
+
* Gets the value at `key` of `object`.
|
7554
|
+
*
|
7555
|
+
* @private
|
7556
|
+
* @param {Object} [object] The object to query.
|
7557
|
+
* @param {string} key The key of the property to get.
|
7558
|
+
* @returns {*} Returns the property value.
|
7559
|
+
*/
|
7560
|
+
|
7561
|
+
|
7562
|
+
function getValue(object, key) {
|
7563
|
+
return object == null ? undefined : object[key];
|
7564
|
+
}
|
7565
|
+
/**
|
7566
|
+
* Converts `map` to its key-value pairs.
|
7567
|
+
*
|
7568
|
+
* @private
|
7569
|
+
* @param {Object} map The map to convert.
|
7570
|
+
* @returns {Array} Returns the key-value pairs.
|
7571
|
+
*/
|
7572
|
+
|
7573
|
+
|
7574
|
+
function mapToArray(map) {
|
7575
|
+
var index = -1,
|
7576
|
+
result = Array(map.size);
|
7577
|
+
map.forEach(function (value, key) {
|
7578
|
+
result[++index] = [key, value];
|
7579
|
+
});
|
7580
|
+
return result;
|
7581
|
+
}
|
7582
|
+
/**
|
7583
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
7584
|
+
*
|
7585
|
+
* @private
|
7586
|
+
* @param {Function} func The function to wrap.
|
7587
|
+
* @param {Function} transform The argument transform.
|
7588
|
+
* @returns {Function} Returns the new function.
|
7589
|
+
*/
|
7590
|
+
|
7591
|
+
|
7592
|
+
function overArg(func, transform) {
|
7593
|
+
return function (arg) {
|
7594
|
+
return func(transform(arg));
|
7595
|
+
};
|
7596
|
+
}
|
7597
|
+
/**
|
7598
|
+
* Converts `set` to an array of its values.
|
7599
|
+
*
|
7600
|
+
* @private
|
7601
|
+
* @param {Object} set The set to convert.
|
7602
|
+
* @returns {Array} Returns the values.
|
7603
|
+
*/
|
7604
|
+
|
7605
|
+
|
7606
|
+
function setToArray(set) {
|
7607
|
+
var index = -1,
|
7608
|
+
result = Array(set.size);
|
7609
|
+
set.forEach(function (value) {
|
7610
|
+
result[++index] = value;
|
7611
|
+
});
|
7612
|
+
return result;
|
7613
|
+
}
|
7614
|
+
/** Used for built-in method references. */
|
7615
|
+
|
7616
|
+
|
7617
|
+
var arrayProto = Array.prototype,
|
7618
|
+
funcProto = Function.prototype,
|
7619
|
+
objectProto = Object.prototype;
|
7620
|
+
/** Used to detect overreaching core-js shims. */
|
7621
|
+
|
7622
|
+
var coreJsData = root['__core-js_shared__'];
|
7623
|
+
/** Used to resolve the decompiled source of functions. */
|
7624
|
+
|
7625
|
+
var funcToString = funcProto.toString;
|
7626
|
+
/** Used to check objects for own properties. */
|
7627
|
+
|
7628
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
7629
|
+
/** Used to detect methods masquerading as native. */
|
7630
|
+
|
7631
|
+
var maskSrcKey = function () {
|
7632
|
+
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
|
7633
|
+
return uid ? 'Symbol(src)_1.' + uid : '';
|
7634
|
+
}();
|
7635
|
+
/**
|
7636
|
+
* Used to resolve the
|
7637
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
7638
|
+
* of values.
|
7639
|
+
*/
|
7640
|
+
|
7641
|
+
|
7642
|
+
var nativeObjectToString = objectProto.toString;
|
7643
|
+
/** Used to detect if a method is native. */
|
7644
|
+
|
7645
|
+
var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
|
7646
|
+
/** Built-in value references. */
|
7647
|
+
|
7648
|
+
var Buffer = moduleExports ? root.Buffer : undefined,
|
7649
|
+
_Symbol = root.Symbol,
|
7650
|
+
Uint8Array = root.Uint8Array,
|
7651
|
+
propertyIsEnumerable = objectProto.propertyIsEnumerable,
|
7652
|
+
splice = arrayProto.splice,
|
7653
|
+
symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
7654
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
7655
|
+
|
7656
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols,
|
7657
|
+
nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
|
7658
|
+
nativeKeys = overArg(Object.keys, Object);
|
7659
|
+
/* Built-in method references that are verified to be native. */
|
7660
|
+
|
7661
|
+
var DataView = getNative(root, 'DataView'),
|
7662
|
+
Map = getNative(root, 'Map'),
|
7663
|
+
Promise = getNative(root, 'Promise'),
|
7664
|
+
Set = getNative(root, 'Set'),
|
7665
|
+
WeakMap = getNative(root, 'WeakMap'),
|
7666
|
+
nativeCreate = getNative(Object, 'create');
|
7667
|
+
/** Used to detect maps, sets, and weakmaps. */
|
7668
|
+
|
7669
|
+
var dataViewCtorString = toSource(DataView),
|
7670
|
+
mapCtorString = toSource(Map),
|
7671
|
+
promiseCtorString = toSource(Promise),
|
7672
|
+
setCtorString = toSource(Set),
|
7673
|
+
weakMapCtorString = toSource(WeakMap);
|
7674
|
+
/** Used to convert symbols to primitives and strings. */
|
7675
|
+
|
7676
|
+
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
7677
|
+
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
7678
|
+
/**
|
7679
|
+
* Creates a hash object.
|
7680
|
+
*
|
7681
|
+
* @private
|
7682
|
+
* @constructor
|
7683
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
7684
|
+
*/
|
7685
|
+
|
7686
|
+
function Hash(entries) {
|
7687
|
+
var index = -1,
|
7688
|
+
length = entries == null ? 0 : entries.length;
|
7689
|
+
this.clear();
|
7690
|
+
|
7691
|
+
while (++index < length) {
|
7692
|
+
var entry = entries[index];
|
7693
|
+
this.set(entry[0], entry[1]);
|
7694
|
+
}
|
7695
|
+
}
|
7696
|
+
/**
|
7697
|
+
* Removes all key-value entries from the hash.
|
7698
|
+
*
|
7699
|
+
* @private
|
7700
|
+
* @name clear
|
7701
|
+
* @memberOf Hash
|
7702
|
+
*/
|
7703
|
+
|
7704
|
+
|
7705
|
+
function hashClear() {
|
7706
|
+
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
7707
|
+
this.size = 0;
|
7708
|
+
}
|
7709
|
+
/**
|
7710
|
+
* Removes `key` and its value from the hash.
|
7711
|
+
*
|
7712
|
+
* @private
|
7713
|
+
* @name delete
|
7714
|
+
* @memberOf Hash
|
7715
|
+
* @param {Object} hash The hash to modify.
|
7716
|
+
* @param {string} key The key of the value to remove.
|
7717
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
7718
|
+
*/
|
7719
|
+
|
7720
|
+
|
7721
|
+
function hashDelete(key) {
|
7722
|
+
var result = this.has(key) && delete this.__data__[key];
|
7723
|
+
this.size -= result ? 1 : 0;
|
7724
|
+
return result;
|
7725
|
+
}
|
7726
|
+
/**
|
7727
|
+
* Gets the hash value for `key`.
|
7728
|
+
*
|
7729
|
+
* @private
|
7730
|
+
* @name get
|
7731
|
+
* @memberOf Hash
|
7732
|
+
* @param {string} key The key of the value to get.
|
7733
|
+
* @returns {*} Returns the entry value.
|
7734
|
+
*/
|
7735
|
+
|
7736
|
+
|
7737
|
+
function hashGet(key) {
|
7738
|
+
var data = this.__data__;
|
7739
|
+
|
7740
|
+
if (nativeCreate) {
|
7741
|
+
var result = data[key];
|
7742
|
+
return result === HASH_UNDEFINED ? undefined : result;
|
7743
|
+
}
|
7744
|
+
|
7745
|
+
return hasOwnProperty.call(data, key) ? data[key] : undefined;
|
7746
|
+
}
|
7747
|
+
/**
|
7748
|
+
* Checks if a hash value for `key` exists.
|
7749
|
+
*
|
7750
|
+
* @private
|
7751
|
+
* @name has
|
7752
|
+
* @memberOf Hash
|
7753
|
+
* @param {string} key The key of the entry to check.
|
7754
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
7755
|
+
*/
|
7756
|
+
|
7757
|
+
|
7758
|
+
function hashHas(key) {
|
7759
|
+
var data = this.__data__;
|
7760
|
+
return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
|
7761
|
+
}
|
7762
|
+
/**
|
7763
|
+
* Sets the hash `key` to `value`.
|
7764
|
+
*
|
7765
|
+
* @private
|
7766
|
+
* @name set
|
7767
|
+
* @memberOf Hash
|
7768
|
+
* @param {string} key The key of the value to set.
|
7769
|
+
* @param {*} value The value to set.
|
7770
|
+
* @returns {Object} Returns the hash instance.
|
7771
|
+
*/
|
7772
|
+
|
7773
|
+
|
7774
|
+
function hashSet(key, value) {
|
7775
|
+
var data = this.__data__;
|
7776
|
+
this.size += this.has(key) ? 0 : 1;
|
7777
|
+
data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
|
7778
|
+
return this;
|
7779
|
+
} // Add methods to `Hash`.
|
7780
|
+
|
7781
|
+
|
7782
|
+
Hash.prototype.clear = hashClear;
|
7783
|
+
Hash.prototype['delete'] = hashDelete;
|
7784
|
+
Hash.prototype.get = hashGet;
|
7785
|
+
Hash.prototype.has = hashHas;
|
7786
|
+
Hash.prototype.set = hashSet;
|
7787
|
+
/**
|
7788
|
+
* Creates an list cache object.
|
7789
|
+
*
|
7790
|
+
* @private
|
7791
|
+
* @constructor
|
7792
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
7793
|
+
*/
|
7794
|
+
|
7795
|
+
function ListCache(entries) {
|
7796
|
+
var index = -1,
|
7797
|
+
length = entries == null ? 0 : entries.length;
|
7798
|
+
this.clear();
|
7799
|
+
|
7800
|
+
while (++index < length) {
|
7801
|
+
var entry = entries[index];
|
7802
|
+
this.set(entry[0], entry[1]);
|
7803
|
+
}
|
7804
|
+
}
|
7805
|
+
/**
|
7806
|
+
* Removes all key-value entries from the list cache.
|
7807
|
+
*
|
7808
|
+
* @private
|
7809
|
+
* @name clear
|
7810
|
+
* @memberOf ListCache
|
7811
|
+
*/
|
7812
|
+
|
7813
|
+
|
7814
|
+
function listCacheClear() {
|
7815
|
+
this.__data__ = [];
|
7816
|
+
this.size = 0;
|
7817
|
+
}
|
7818
|
+
/**
|
7819
|
+
* Removes `key` and its value from the list cache.
|
7820
|
+
*
|
7821
|
+
* @private
|
7822
|
+
* @name delete
|
7823
|
+
* @memberOf ListCache
|
7824
|
+
* @param {string} key The key of the value to remove.
|
7825
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
7826
|
+
*/
|
7827
|
+
|
7828
|
+
|
7829
|
+
function listCacheDelete(key) {
|
7830
|
+
var data = this.__data__,
|
7831
|
+
index = assocIndexOf(data, key);
|
7832
|
+
|
7833
|
+
if (index < 0) {
|
7834
|
+
return false;
|
7835
|
+
}
|
7836
|
+
|
7837
|
+
var lastIndex = data.length - 1;
|
7838
|
+
|
7839
|
+
if (index == lastIndex) {
|
7840
|
+
data.pop();
|
7841
|
+
} else {
|
7842
|
+
splice.call(data, index, 1);
|
7843
|
+
}
|
7844
|
+
|
7845
|
+
--this.size;
|
7846
|
+
return true;
|
7847
|
+
}
|
7848
|
+
/**
|
7849
|
+
* Gets the list cache value for `key`.
|
7850
|
+
*
|
7851
|
+
* @private
|
7852
|
+
* @name get
|
7853
|
+
* @memberOf ListCache
|
7854
|
+
* @param {string} key The key of the value to get.
|
7855
|
+
* @returns {*} Returns the entry value.
|
7856
|
+
*/
|
7857
|
+
|
7858
|
+
|
7859
|
+
function listCacheGet(key) {
|
7860
|
+
var data = this.__data__,
|
7861
|
+
index = assocIndexOf(data, key);
|
7862
|
+
return index < 0 ? undefined : data[index][1];
|
7863
|
+
}
|
7864
|
+
/**
|
7865
|
+
* Checks if a list cache value for `key` exists.
|
7866
|
+
*
|
7867
|
+
* @private
|
7868
|
+
* @name has
|
7869
|
+
* @memberOf ListCache
|
7870
|
+
* @param {string} key The key of the entry to check.
|
7871
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
7872
|
+
*/
|
7873
|
+
|
7874
|
+
|
7875
|
+
function listCacheHas(key) {
|
7876
|
+
return assocIndexOf(this.__data__, key) > -1;
|
7877
|
+
}
|
7878
|
+
/**
|
7879
|
+
* Sets the list cache `key` to `value`.
|
7880
|
+
*
|
7881
|
+
* @private
|
7882
|
+
* @name set
|
7883
|
+
* @memberOf ListCache
|
7884
|
+
* @param {string} key The key of the value to set.
|
7885
|
+
* @param {*} value The value to set.
|
7886
|
+
* @returns {Object} Returns the list cache instance.
|
7887
|
+
*/
|
7888
|
+
|
7889
|
+
|
7890
|
+
function listCacheSet(key, value) {
|
7891
|
+
var data = this.__data__,
|
7892
|
+
index = assocIndexOf(data, key);
|
7893
|
+
|
7894
|
+
if (index < 0) {
|
7895
|
+
++this.size;
|
7896
|
+
data.push([key, value]);
|
7897
|
+
} else {
|
7898
|
+
data[index][1] = value;
|
7899
|
+
}
|
7900
|
+
|
7901
|
+
return this;
|
7902
|
+
} // Add methods to `ListCache`.
|
7903
|
+
|
7904
|
+
|
7905
|
+
ListCache.prototype.clear = listCacheClear;
|
7906
|
+
ListCache.prototype['delete'] = listCacheDelete;
|
7907
|
+
ListCache.prototype.get = listCacheGet;
|
7908
|
+
ListCache.prototype.has = listCacheHas;
|
7909
|
+
ListCache.prototype.set = listCacheSet;
|
7910
|
+
/**
|
7911
|
+
* Creates a map cache object to store key-value pairs.
|
7912
|
+
*
|
7913
|
+
* @private
|
7914
|
+
* @constructor
|
7915
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
7916
|
+
*/
|
7917
|
+
|
7918
|
+
function MapCache(entries) {
|
7919
|
+
var index = -1,
|
7920
|
+
length = entries == null ? 0 : entries.length;
|
7921
|
+
this.clear();
|
7922
|
+
|
7923
|
+
while (++index < length) {
|
7924
|
+
var entry = entries[index];
|
7925
|
+
this.set(entry[0], entry[1]);
|
7926
|
+
}
|
7927
|
+
}
|
7928
|
+
/**
|
7929
|
+
* Removes all key-value entries from the map.
|
7930
|
+
*
|
7931
|
+
* @private
|
7932
|
+
* @name clear
|
7933
|
+
* @memberOf MapCache
|
7934
|
+
*/
|
7935
|
+
|
7936
|
+
|
7937
|
+
function mapCacheClear() {
|
7938
|
+
this.size = 0;
|
7939
|
+
this.__data__ = {
|
7940
|
+
'hash': new Hash(),
|
7941
|
+
'map': new (Map || ListCache)(),
|
7942
|
+
'string': new Hash()
|
7943
|
+
};
|
7944
|
+
}
|
7945
|
+
/**
|
7946
|
+
* Removes `key` and its value from the map.
|
7947
|
+
*
|
7948
|
+
* @private
|
7949
|
+
* @name delete
|
7950
|
+
* @memberOf MapCache
|
7951
|
+
* @param {string} key The key of the value to remove.
|
7952
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
7953
|
+
*/
|
7954
|
+
|
7955
|
+
|
7956
|
+
function mapCacheDelete(key) {
|
7957
|
+
var result = getMapData(this, key)['delete'](key);
|
7958
|
+
this.size -= result ? 1 : 0;
|
7959
|
+
return result;
|
7960
|
+
}
|
7961
|
+
/**
|
7962
|
+
* Gets the map value for `key`.
|
7963
|
+
*
|
7964
|
+
* @private
|
7965
|
+
* @name get
|
7966
|
+
* @memberOf MapCache
|
7967
|
+
* @param {string} key The key of the value to get.
|
7968
|
+
* @returns {*} Returns the entry value.
|
7969
|
+
*/
|
7970
|
+
|
7971
|
+
|
7972
|
+
function mapCacheGet(key) {
|
7973
|
+
return getMapData(this, key).get(key);
|
7974
|
+
}
|
7975
|
+
/**
|
7976
|
+
* Checks if a map value for `key` exists.
|
7977
|
+
*
|
7978
|
+
* @private
|
7979
|
+
* @name has
|
7980
|
+
* @memberOf MapCache
|
7981
|
+
* @param {string} key The key of the entry to check.
|
7982
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
7983
|
+
*/
|
7984
|
+
|
7985
|
+
|
7986
|
+
function mapCacheHas(key) {
|
7987
|
+
return getMapData(this, key).has(key);
|
7988
|
+
}
|
7989
|
+
/**
|
7990
|
+
* Sets the map `key` to `value`.
|
7991
|
+
*
|
7992
|
+
* @private
|
7993
|
+
* @name set
|
7994
|
+
* @memberOf MapCache
|
7995
|
+
* @param {string} key The key of the value to set.
|
7996
|
+
* @param {*} value The value to set.
|
7997
|
+
* @returns {Object} Returns the map cache instance.
|
7998
|
+
*/
|
7999
|
+
|
8000
|
+
|
8001
|
+
function mapCacheSet(key, value) {
|
8002
|
+
var data = getMapData(this, key),
|
8003
|
+
size = data.size;
|
8004
|
+
data.set(key, value);
|
8005
|
+
this.size += data.size == size ? 0 : 1;
|
8006
|
+
return this;
|
8007
|
+
} // Add methods to `MapCache`.
|
8008
|
+
|
8009
|
+
|
8010
|
+
MapCache.prototype.clear = mapCacheClear;
|
8011
|
+
MapCache.prototype['delete'] = mapCacheDelete;
|
8012
|
+
MapCache.prototype.get = mapCacheGet;
|
8013
|
+
MapCache.prototype.has = mapCacheHas;
|
8014
|
+
MapCache.prototype.set = mapCacheSet;
|
8015
|
+
/**
|
8016
|
+
*
|
8017
|
+
* Creates an array cache object to store unique values.
|
8018
|
+
*
|
8019
|
+
* @private
|
8020
|
+
* @constructor
|
8021
|
+
* @param {Array} [values] The values to cache.
|
8022
|
+
*/
|
8023
|
+
|
8024
|
+
function SetCache(values) {
|
8025
|
+
var index = -1,
|
8026
|
+
length = values == null ? 0 : values.length;
|
8027
|
+
this.__data__ = new MapCache();
|
8028
|
+
|
8029
|
+
while (++index < length) {
|
8030
|
+
this.add(values[index]);
|
8031
|
+
}
|
8032
|
+
}
|
8033
|
+
/**
|
8034
|
+
* Adds `value` to the array cache.
|
8035
|
+
*
|
8036
|
+
* @private
|
8037
|
+
* @name add
|
8038
|
+
* @memberOf SetCache
|
8039
|
+
* @alias push
|
8040
|
+
* @param {*} value The value to cache.
|
8041
|
+
* @returns {Object} Returns the cache instance.
|
8042
|
+
*/
|
8043
|
+
|
8044
|
+
|
8045
|
+
function setCacheAdd(value) {
|
8046
|
+
this.__data__.set(value, HASH_UNDEFINED);
|
8047
|
+
|
8048
|
+
return this;
|
8049
|
+
}
|
8050
|
+
/**
|
8051
|
+
* Checks if `value` is in the array cache.
|
8052
|
+
*
|
8053
|
+
* @private
|
8054
|
+
* @name has
|
8055
|
+
* @memberOf SetCache
|
8056
|
+
* @param {*} value The value to search for.
|
8057
|
+
* @returns {number} Returns `true` if `value` is found, else `false`.
|
8058
|
+
*/
|
8059
|
+
|
8060
|
+
|
8061
|
+
function setCacheHas(value) {
|
8062
|
+
return this.__data__.has(value);
|
8063
|
+
} // Add methods to `SetCache`.
|
8064
|
+
|
8065
|
+
|
8066
|
+
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
8067
|
+
SetCache.prototype.has = setCacheHas;
|
8068
|
+
/**
|
8069
|
+
* Creates a stack cache object to store key-value pairs.
|
8070
|
+
*
|
8071
|
+
* @private
|
8072
|
+
* @constructor
|
8073
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
8074
|
+
*/
|
8075
|
+
|
8076
|
+
function Stack(entries) {
|
8077
|
+
var data = this.__data__ = new ListCache(entries);
|
8078
|
+
this.size = data.size;
|
8079
|
+
}
|
8080
|
+
/**
|
8081
|
+
* Removes all key-value entries from the stack.
|
8082
|
+
*
|
8083
|
+
* @private
|
8084
|
+
* @name clear
|
8085
|
+
* @memberOf Stack
|
8086
|
+
*/
|
8087
|
+
|
8088
|
+
|
8089
|
+
function stackClear() {
|
8090
|
+
this.__data__ = new ListCache();
|
8091
|
+
this.size = 0;
|
8092
|
+
}
|
8093
|
+
/**
|
8094
|
+
* Removes `key` and its value from the stack.
|
8095
|
+
*
|
8096
|
+
* @private
|
8097
|
+
* @name delete
|
8098
|
+
* @memberOf Stack
|
8099
|
+
* @param {string} key The key of the value to remove.
|
8100
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
8101
|
+
*/
|
8102
|
+
|
8103
|
+
|
8104
|
+
function stackDelete(key) {
|
8105
|
+
var data = this.__data__,
|
8106
|
+
result = data['delete'](key);
|
8107
|
+
this.size = data.size;
|
8108
|
+
return result;
|
8109
|
+
}
|
8110
|
+
/**
|
8111
|
+
* Gets the stack value for `key`.
|
8112
|
+
*
|
8113
|
+
* @private
|
8114
|
+
* @name get
|
8115
|
+
* @memberOf Stack
|
8116
|
+
* @param {string} key The key of the value to get.
|
8117
|
+
* @returns {*} Returns the entry value.
|
8118
|
+
*/
|
8119
|
+
|
8120
|
+
|
8121
|
+
function stackGet(key) {
|
8122
|
+
return this.__data__.get(key);
|
8123
|
+
}
|
8124
|
+
/**
|
8125
|
+
* Checks if a stack value for `key` exists.
|
8126
|
+
*
|
8127
|
+
* @private
|
8128
|
+
* @name has
|
8129
|
+
* @memberOf Stack
|
8130
|
+
* @param {string} key The key of the entry to check.
|
8131
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
8132
|
+
*/
|
8133
|
+
|
8134
|
+
|
8135
|
+
function stackHas(key) {
|
8136
|
+
return this.__data__.has(key);
|
8137
|
+
}
|
8138
|
+
/**
|
8139
|
+
* Sets the stack `key` to `value`.
|
8140
|
+
*
|
8141
|
+
* @private
|
8142
|
+
* @name set
|
8143
|
+
* @memberOf Stack
|
8144
|
+
* @param {string} key The key of the value to set.
|
8145
|
+
* @param {*} value The value to set.
|
8146
|
+
* @returns {Object} Returns the stack cache instance.
|
8147
|
+
*/
|
8148
|
+
|
8149
|
+
|
8150
|
+
function stackSet(key, value) {
|
8151
|
+
var data = this.__data__;
|
8152
|
+
|
8153
|
+
if (data instanceof ListCache) {
|
8154
|
+
var pairs = data.__data__;
|
8155
|
+
|
8156
|
+
if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
8157
|
+
pairs.push([key, value]);
|
8158
|
+
this.size = ++data.size;
|
8159
|
+
return this;
|
8160
|
+
}
|
8161
|
+
|
8162
|
+
data = this.__data__ = new MapCache(pairs);
|
8163
|
+
}
|
8164
|
+
|
8165
|
+
data.set(key, value);
|
8166
|
+
this.size = data.size;
|
8167
|
+
return this;
|
8168
|
+
} // Add methods to `Stack`.
|
8169
|
+
|
8170
|
+
|
8171
|
+
Stack.prototype.clear = stackClear;
|
8172
|
+
Stack.prototype['delete'] = stackDelete;
|
8173
|
+
Stack.prototype.get = stackGet;
|
8174
|
+
Stack.prototype.has = stackHas;
|
8175
|
+
Stack.prototype.set = stackSet;
|
8176
|
+
/**
|
8177
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
8178
|
+
*
|
8179
|
+
* @private
|
8180
|
+
* @param {*} value The value to query.
|
8181
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
8182
|
+
* @returns {Array} Returns the array of property names.
|
8183
|
+
*/
|
8184
|
+
|
8185
|
+
function arrayLikeKeys(value, inherited) {
|
8186
|
+
var isArr = isArray(value),
|
8187
|
+
isArg = !isArr && isArguments(value),
|
8188
|
+
isBuff = !isArr && !isArg && isBuffer(value),
|
8189
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray(value),
|
8190
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
8191
|
+
result = skipIndexes ? baseTimes(value.length, String) : [],
|
8192
|
+
length = result.length;
|
8193
|
+
|
8194
|
+
for (var key in value) {
|
8195
|
+
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && ( // Safari 9 has enumerable `arguments.length` in strict mode.
|
8196
|
+
key == 'length' || // Node.js 0.10 has enumerable non-index properties on buffers.
|
8197
|
+
isBuff && (key == 'offset' || key == 'parent') || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
8198
|
+
isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || // Skip index properties.
|
8199
|
+
isIndex(key, length)))) {
|
8200
|
+
result.push(key);
|
8201
|
+
}
|
8202
|
+
}
|
8203
|
+
|
8204
|
+
return result;
|
8205
|
+
}
|
8206
|
+
/**
|
8207
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
8208
|
+
*
|
8209
|
+
* @private
|
8210
|
+
* @param {Array} array The array to inspect.
|
8211
|
+
* @param {*} key The key to search for.
|
8212
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
8213
|
+
*/
|
8214
|
+
|
8215
|
+
|
8216
|
+
function assocIndexOf(array, key) {
|
8217
|
+
var length = array.length;
|
8218
|
+
|
8219
|
+
while (length--) {
|
8220
|
+
if (eq(array[length][0], key)) {
|
8221
|
+
return length;
|
8222
|
+
}
|
8223
|
+
}
|
8224
|
+
|
8225
|
+
return -1;
|
8226
|
+
}
|
8227
|
+
/**
|
8228
|
+
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
8229
|
+
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
8230
|
+
* symbols of `object`.
|
8231
|
+
*
|
8232
|
+
* @private
|
8233
|
+
* @param {Object} object The object to query.
|
8234
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
8235
|
+
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
8236
|
+
* @returns {Array} Returns the array of property names and symbols.
|
8237
|
+
*/
|
8238
|
+
|
8239
|
+
|
8240
|
+
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
8241
|
+
var result = keysFunc(object);
|
8242
|
+
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
|
8243
|
+
}
|
8244
|
+
/**
|
8245
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
8246
|
+
*
|
8247
|
+
* @private
|
8248
|
+
* @param {*} value The value to query.
|
8249
|
+
* @returns {string} Returns the `toStringTag`.
|
8250
|
+
*/
|
8251
|
+
|
8252
|
+
|
8253
|
+
function baseGetTag(value) {
|
8254
|
+
if (value == null) {
|
8255
|
+
return value === undefined ? undefinedTag : nullTag;
|
8256
|
+
}
|
8257
|
+
|
8258
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
|
8259
|
+
}
|
8260
|
+
/**
|
8261
|
+
* The base implementation of `_.isArguments`.
|
8262
|
+
*
|
8263
|
+
* @private
|
8264
|
+
* @param {*} value The value to check.
|
8265
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
8266
|
+
*/
|
8267
|
+
|
8268
|
+
|
8269
|
+
function baseIsArguments(value) {
|
8270
|
+
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
8271
|
+
}
|
8272
|
+
/**
|
8273
|
+
* The base implementation of `_.isEqual` which supports partial comparisons
|
8274
|
+
* and tracks traversed objects.
|
8275
|
+
*
|
8276
|
+
* @private
|
8277
|
+
* @param {*} value The value to compare.
|
8278
|
+
* @param {*} other The other value to compare.
|
8279
|
+
* @param {boolean} bitmask The bitmask flags.
|
8280
|
+
* 1 - Unordered comparison
|
8281
|
+
* 2 - Partial comparison
|
8282
|
+
* @param {Function} [customizer] The function to customize comparisons.
|
8283
|
+
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
|
8284
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
8285
|
+
*/
|
8286
|
+
|
8287
|
+
|
8288
|
+
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
8289
|
+
if (value === other) {
|
8290
|
+
return true;
|
8291
|
+
}
|
8292
|
+
|
8293
|
+
if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
|
8294
|
+
return value !== value && other !== other;
|
8295
|
+
}
|
8296
|
+
|
8297
|
+
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
8298
|
+
}
|
8299
|
+
/**
|
8300
|
+
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
8301
|
+
* deep comparisons and tracks traversed objects enabling objects with circular
|
8302
|
+
* references to be compared.
|
8303
|
+
*
|
8304
|
+
* @private
|
8305
|
+
* @param {Object} object The object to compare.
|
8306
|
+
* @param {Object} other The other object to compare.
|
8307
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
8308
|
+
* @param {Function} customizer The function to customize comparisons.
|
8309
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
8310
|
+
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
8311
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
8312
|
+
*/
|
8313
|
+
|
8314
|
+
|
8315
|
+
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
8316
|
+
var objIsArr = isArray(object),
|
8317
|
+
othIsArr = isArray(other),
|
8318
|
+
objTag = objIsArr ? arrayTag : getTag(object),
|
8319
|
+
othTag = othIsArr ? arrayTag : getTag(other);
|
8320
|
+
objTag = objTag == argsTag ? objectTag : objTag;
|
8321
|
+
othTag = othTag == argsTag ? objectTag : othTag;
|
8322
|
+
var objIsObj = objTag == objectTag,
|
8323
|
+
othIsObj = othTag == objectTag,
|
8324
|
+
isSameTag = objTag == othTag;
|
8325
|
+
|
8326
|
+
if (isSameTag && isBuffer(object)) {
|
8327
|
+
if (!isBuffer(other)) {
|
8328
|
+
return false;
|
8329
|
+
}
|
8330
|
+
|
8331
|
+
objIsArr = true;
|
8332
|
+
objIsObj = false;
|
8333
|
+
}
|
8334
|
+
|
8335
|
+
if (isSameTag && !objIsObj) {
|
8336
|
+
stack || (stack = new Stack());
|
8337
|
+
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
8338
|
+
}
|
8339
|
+
|
8340
|
+
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
8341
|
+
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
8342
|
+
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
8343
|
+
|
8344
|
+
if (objIsWrapped || othIsWrapped) {
|
8345
|
+
var objUnwrapped = objIsWrapped ? object.value() : object,
|
8346
|
+
othUnwrapped = othIsWrapped ? other.value() : other;
|
8347
|
+
stack || (stack = new Stack());
|
8348
|
+
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
8349
|
+
}
|
8350
|
+
}
|
8351
|
+
|
8352
|
+
if (!isSameTag) {
|
8353
|
+
return false;
|
8354
|
+
}
|
8355
|
+
|
8356
|
+
stack || (stack = new Stack());
|
8357
|
+
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
8358
|
+
}
|
8359
|
+
/**
|
8360
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
8361
|
+
*
|
8362
|
+
* @private
|
8363
|
+
* @param {*} value The value to check.
|
8364
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
8365
|
+
* else `false`.
|
8366
|
+
*/
|
8367
|
+
|
8368
|
+
|
8369
|
+
function baseIsNative(value) {
|
8370
|
+
if (!isObject(value) || isMasked(value)) {
|
8371
|
+
return false;
|
8372
|
+
}
|
8373
|
+
|
8374
|
+
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
8375
|
+
return pattern.test(toSource(value));
|
8376
|
+
}
|
8377
|
+
/**
|
8378
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
8379
|
+
*
|
8380
|
+
* @private
|
8381
|
+
* @param {*} value The value to check.
|
8382
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
8383
|
+
*/
|
8384
|
+
|
8385
|
+
|
8386
|
+
function baseIsTypedArray(value) {
|
8387
|
+
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
8388
|
+
}
|
8389
|
+
/**
|
8390
|
+
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
8391
|
+
*
|
8392
|
+
* @private
|
8393
|
+
* @param {Object} object The object to query.
|
8394
|
+
* @returns {Array} Returns the array of property names.
|
8395
|
+
*/
|
8396
|
+
|
8397
|
+
|
8398
|
+
function baseKeys(object) {
|
8399
|
+
if (!isPrototype(object)) {
|
8400
|
+
return nativeKeys(object);
|
8401
|
+
}
|
8402
|
+
|
8403
|
+
var result = [];
|
8404
|
+
|
8405
|
+
for (var key in Object(object)) {
|
8406
|
+
if (hasOwnProperty.call(object, key) && key != 'constructor') {
|
8407
|
+
result.push(key);
|
8408
|
+
}
|
8409
|
+
}
|
8410
|
+
|
8411
|
+
return result;
|
8412
|
+
}
|
8413
|
+
/**
|
8414
|
+
* A specialized version of `baseIsEqualDeep` for arrays with support for
|
8415
|
+
* partial deep comparisons.
|
8416
|
+
*
|
8417
|
+
* @private
|
8418
|
+
* @param {Array} array The array to compare.
|
8419
|
+
* @param {Array} other The other array to compare.
|
8420
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
8421
|
+
* @param {Function} customizer The function to customize comparisons.
|
8422
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
8423
|
+
* @param {Object} stack Tracks traversed `array` and `other` objects.
|
8424
|
+
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
8425
|
+
*/
|
8426
|
+
|
8427
|
+
|
8428
|
+
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
8429
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
|
8430
|
+
arrLength = array.length,
|
8431
|
+
othLength = other.length;
|
8432
|
+
|
8433
|
+
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
8434
|
+
return false;
|
8435
|
+
} // Assume cyclic values are equal.
|
8436
|
+
|
8437
|
+
|
8438
|
+
var stacked = stack.get(array);
|
8439
|
+
|
8440
|
+
if (stacked && stack.get(other)) {
|
8441
|
+
return stacked == other;
|
8442
|
+
}
|
8443
|
+
|
8444
|
+
var index = -1,
|
8445
|
+
result = true,
|
8446
|
+
seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined;
|
8447
|
+
stack.set(array, other);
|
8448
|
+
stack.set(other, array); // Ignore non-index properties.
|
8449
|
+
|
8450
|
+
while (++index < arrLength) {
|
8451
|
+
var arrValue = array[index],
|
8452
|
+
othValue = other[index];
|
8453
|
+
|
8454
|
+
if (customizer) {
|
8455
|
+
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
8456
|
+
}
|
8457
|
+
|
8458
|
+
if (compared !== undefined) {
|
8459
|
+
if (compared) {
|
8460
|
+
continue;
|
8461
|
+
}
|
8462
|
+
|
8463
|
+
result = false;
|
8464
|
+
break;
|
8465
|
+
} // Recursively compare arrays (susceptible to call stack limits).
|
8466
|
+
|
8467
|
+
|
8468
|
+
if (seen) {
|
8469
|
+
if (!arraySome(other, function (othValue, othIndex) {
|
8470
|
+
if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
8471
|
+
return seen.push(othIndex);
|
8472
|
+
}
|
8473
|
+
})) {
|
8474
|
+
result = false;
|
8475
|
+
break;
|
8476
|
+
}
|
8477
|
+
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
8478
|
+
result = false;
|
8479
|
+
break;
|
8480
|
+
}
|
8481
|
+
}
|
8482
|
+
|
8483
|
+
stack['delete'](array);
|
8484
|
+
stack['delete'](other);
|
8485
|
+
return result;
|
8486
|
+
}
|
8487
|
+
/**
|
8488
|
+
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
8489
|
+
* the same `toStringTag`.
|
8490
|
+
*
|
8491
|
+
* **Note:** This function only supports comparing values with tags of
|
8492
|
+
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
8493
|
+
*
|
8494
|
+
* @private
|
8495
|
+
* @param {Object} object The object to compare.
|
8496
|
+
* @param {Object} other The other object to compare.
|
8497
|
+
* @param {string} tag The `toStringTag` of the objects to compare.
|
8498
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
8499
|
+
* @param {Function} customizer The function to customize comparisons.
|
8500
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
8501
|
+
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
8502
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
8503
|
+
*/
|
8504
|
+
|
8505
|
+
|
8506
|
+
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
8507
|
+
switch (tag) {
|
8508
|
+
case dataViewTag:
|
8509
|
+
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
8510
|
+
return false;
|
8511
|
+
}
|
8512
|
+
|
8513
|
+
object = object.buffer;
|
8514
|
+
other = other.buffer;
|
8515
|
+
|
8516
|
+
case arrayBufferTag:
|
8517
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
|
8518
|
+
return false;
|
8519
|
+
}
|
8520
|
+
|
8521
|
+
return true;
|
8522
|
+
|
8523
|
+
case boolTag:
|
8524
|
+
case dateTag:
|
8525
|
+
case numberTag:
|
8526
|
+
// Coerce booleans to `1` or `0` and dates to milliseconds.
|
8527
|
+
// Invalid dates are coerced to `NaN`.
|
8528
|
+
return eq(+object, +other);
|
8529
|
+
|
8530
|
+
case errorTag:
|
8531
|
+
return object.name == other.name && object.message == other.message;
|
8532
|
+
|
8533
|
+
case regexpTag:
|
8534
|
+
case stringTag:
|
8535
|
+
// Coerce regexes to strings and treat strings, primitives and objects,
|
8536
|
+
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
|
8537
|
+
// for more details.
|
8538
|
+
return object == other + '';
|
8539
|
+
|
8540
|
+
case mapTag:
|
8541
|
+
var convert = mapToArray;
|
8542
|
+
|
8543
|
+
case setTag:
|
8544
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
8545
|
+
convert || (convert = setToArray);
|
8546
|
+
|
8547
|
+
if (object.size != other.size && !isPartial) {
|
8548
|
+
return false;
|
8549
|
+
} // Assume cyclic values are equal.
|
8550
|
+
|
8551
|
+
|
8552
|
+
var stacked = stack.get(object);
|
8553
|
+
|
8554
|
+
if (stacked) {
|
8555
|
+
return stacked == other;
|
8556
|
+
}
|
8557
|
+
|
8558
|
+
bitmask |= COMPARE_UNORDERED_FLAG; // Recursively compare objects (susceptible to call stack limits).
|
8559
|
+
|
8560
|
+
stack.set(object, other);
|
8561
|
+
var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
8562
|
+
stack['delete'](object);
|
8563
|
+
return result;
|
8564
|
+
|
8565
|
+
case symbolTag:
|
8566
|
+
if (symbolValueOf) {
|
8567
|
+
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
8568
|
+
}
|
8569
|
+
|
8570
|
+
}
|
8571
|
+
|
8572
|
+
return false;
|
8573
|
+
}
|
8574
|
+
/**
|
8575
|
+
* A specialized version of `baseIsEqualDeep` for objects with support for
|
8576
|
+
* partial deep comparisons.
|
8577
|
+
*
|
8578
|
+
* @private
|
8579
|
+
* @param {Object} object The object to compare.
|
8580
|
+
* @param {Object} other The other object to compare.
|
8581
|
+
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
8582
|
+
* @param {Function} customizer The function to customize comparisons.
|
8583
|
+
* @param {Function} equalFunc The function to determine equivalents of values.
|
8584
|
+
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
8585
|
+
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
8586
|
+
*/
|
8587
|
+
|
8588
|
+
|
8589
|
+
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
8590
|
+
var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
|
8591
|
+
objProps = getAllKeys(object),
|
8592
|
+
objLength = objProps.length,
|
8593
|
+
othProps = getAllKeys(other),
|
8594
|
+
othLength = othProps.length;
|
8595
|
+
|
8596
|
+
if (objLength != othLength && !isPartial) {
|
8597
|
+
return false;
|
8598
|
+
}
|
8599
|
+
|
8600
|
+
var index = objLength;
|
8601
|
+
|
8602
|
+
while (index--) {
|
8603
|
+
var key = objProps[index];
|
8604
|
+
|
8605
|
+
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
8606
|
+
return false;
|
8607
|
+
}
|
8608
|
+
} // Assume cyclic values are equal.
|
8609
|
+
|
8610
|
+
|
8611
|
+
var stacked = stack.get(object);
|
8612
|
+
|
8613
|
+
if (stacked && stack.get(other)) {
|
8614
|
+
return stacked == other;
|
8615
|
+
}
|
8616
|
+
|
8617
|
+
var result = true;
|
8618
|
+
stack.set(object, other);
|
8619
|
+
stack.set(other, object);
|
8620
|
+
var skipCtor = isPartial;
|
8621
|
+
|
8622
|
+
while (++index < objLength) {
|
8623
|
+
key = objProps[index];
|
8624
|
+
var objValue = object[key],
|
8625
|
+
othValue = other[key];
|
8626
|
+
|
8627
|
+
if (customizer) {
|
8628
|
+
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
8629
|
+
} // Recursively compare objects (susceptible to call stack limits).
|
8630
|
+
|
8631
|
+
|
8632
|
+
if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
8633
|
+
result = false;
|
8634
|
+
break;
|
8635
|
+
}
|
8636
|
+
|
8637
|
+
skipCtor || (skipCtor = key == 'constructor');
|
8638
|
+
}
|
8639
|
+
|
8640
|
+
if (result && !skipCtor) {
|
8641
|
+
var objCtor = object.constructor,
|
8642
|
+
othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal.
|
8643
|
+
|
8644
|
+
if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
8645
|
+
result = false;
|
8646
|
+
}
|
8647
|
+
}
|
8648
|
+
|
8649
|
+
stack['delete'](object);
|
8650
|
+
stack['delete'](other);
|
8651
|
+
return result;
|
8652
|
+
}
|
8653
|
+
/**
|
8654
|
+
* Creates an array of own enumerable property names and symbols of `object`.
|
8655
|
+
*
|
8656
|
+
* @private
|
8657
|
+
* @param {Object} object The object to query.
|
8658
|
+
* @returns {Array} Returns the array of property names and symbols.
|
8659
|
+
*/
|
8660
|
+
|
8661
|
+
|
8662
|
+
function getAllKeys(object) {
|
8663
|
+
return baseGetAllKeys(object, keys, getSymbols);
|
8664
|
+
}
|
8665
|
+
/**
|
8666
|
+
* Gets the data for `map`.
|
8667
|
+
*
|
8668
|
+
* @private
|
8669
|
+
* @param {Object} map The map to query.
|
8670
|
+
* @param {string} key The reference key.
|
8671
|
+
* @returns {*} Returns the map data.
|
8672
|
+
*/
|
8673
|
+
|
8674
|
+
|
8675
|
+
function getMapData(map, key) {
|
8676
|
+
var data = map.__data__;
|
8677
|
+
return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
|
8678
|
+
}
|
8679
|
+
/**
|
8680
|
+
* Gets the native function at `key` of `object`.
|
8681
|
+
*
|
8682
|
+
* @private
|
8683
|
+
* @param {Object} object The object to query.
|
8684
|
+
* @param {string} key The key of the method to get.
|
8685
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
8686
|
+
*/
|
8687
|
+
|
8688
|
+
|
8689
|
+
function getNative(object, key) {
|
8690
|
+
var value = getValue(object, key);
|
8691
|
+
return baseIsNative(value) ? value : undefined;
|
8692
|
+
}
|
8693
|
+
/**
|
8694
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
8695
|
+
*
|
8696
|
+
* @private
|
8697
|
+
* @param {*} value The value to query.
|
8698
|
+
* @returns {string} Returns the raw `toStringTag`.
|
8699
|
+
*/
|
8700
|
+
|
8701
|
+
|
8702
|
+
function getRawTag(value) {
|
8703
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag),
|
8704
|
+
tag = value[symToStringTag];
|
8705
|
+
|
8706
|
+
try {
|
8707
|
+
value[symToStringTag] = undefined;
|
8708
|
+
var unmasked = true;
|
8709
|
+
} catch (e) {}
|
8710
|
+
|
8711
|
+
var result = nativeObjectToString.call(value);
|
8712
|
+
|
8713
|
+
if (unmasked) {
|
8714
|
+
if (isOwn) {
|
8715
|
+
value[symToStringTag] = tag;
|
8716
|
+
} else {
|
8717
|
+
delete value[symToStringTag];
|
8718
|
+
}
|
8719
|
+
}
|
8720
|
+
|
8721
|
+
return result;
|
8722
|
+
}
|
8723
|
+
/**
|
8724
|
+
* Creates an array of the own enumerable symbols of `object`.
|
8725
|
+
*
|
8726
|
+
* @private
|
8727
|
+
* @param {Object} object The object to query.
|
8728
|
+
* @returns {Array} Returns the array of symbols.
|
8729
|
+
*/
|
8730
|
+
|
8731
|
+
|
8732
|
+
var getSymbols = !nativeGetSymbols ? stubArray : function (object) {
|
8733
|
+
if (object == null) {
|
8734
|
+
return [];
|
8735
|
+
}
|
8736
|
+
|
8737
|
+
object = Object(object);
|
8738
|
+
return arrayFilter(nativeGetSymbols(object), function (symbol) {
|
8739
|
+
return propertyIsEnumerable.call(object, symbol);
|
8740
|
+
});
|
8741
|
+
};
|
8742
|
+
/**
|
8743
|
+
* Gets the `toStringTag` of `value`.
|
8744
|
+
*
|
8745
|
+
* @private
|
8746
|
+
* @param {*} value The value to query.
|
8747
|
+
* @returns {string} Returns the `toStringTag`.
|
8748
|
+
*/
|
8749
|
+
|
8750
|
+
var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
8751
|
+
|
8752
|
+
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
|
8753
|
+
getTag = function getTag(value) {
|
8754
|
+
var result = baseGetTag(value),
|
8755
|
+
Ctor = result == objectTag ? value.constructor : undefined,
|
8756
|
+
ctorString = Ctor ? toSource(Ctor) : '';
|
8757
|
+
|
8758
|
+
if (ctorString) {
|
8759
|
+
switch (ctorString) {
|
8760
|
+
case dataViewCtorString:
|
8761
|
+
return dataViewTag;
|
8762
|
+
|
8763
|
+
case mapCtorString:
|
8764
|
+
return mapTag;
|
8765
|
+
|
8766
|
+
case promiseCtorString:
|
8767
|
+
return promiseTag;
|
8768
|
+
|
8769
|
+
case setCtorString:
|
8770
|
+
return setTag;
|
8771
|
+
|
8772
|
+
case weakMapCtorString:
|
8773
|
+
return weakMapTag;
|
8774
|
+
}
|
8775
|
+
}
|
8776
|
+
|
8777
|
+
return result;
|
8778
|
+
};
|
8779
|
+
}
|
8780
|
+
/**
|
8781
|
+
* Checks if `value` is a valid array-like index.
|
8782
|
+
*
|
8783
|
+
* @private
|
8784
|
+
* @param {*} value The value to check.
|
8785
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
8786
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
8787
|
+
*/
|
8788
|
+
|
8789
|
+
|
8790
|
+
function isIndex(value, length) {
|
8791
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
8792
|
+
return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
|
8793
|
+
}
|
8794
|
+
/**
|
8795
|
+
* Checks if `value` is suitable for use as unique object key.
|
8796
|
+
*
|
8797
|
+
* @private
|
8798
|
+
* @param {*} value The value to check.
|
8799
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
8800
|
+
*/
|
8801
|
+
|
8802
|
+
|
8803
|
+
function isKeyable(value) {
|
8804
|
+
var type = _typeof$4(value);
|
8805
|
+
|
8806
|
+
return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
|
8807
|
+
}
|
8808
|
+
/**
|
8809
|
+
* Checks if `func` has its source masked.
|
8810
|
+
*
|
8811
|
+
* @private
|
8812
|
+
* @param {Function} func The function to check.
|
8813
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
8814
|
+
*/
|
8815
|
+
|
8816
|
+
|
8817
|
+
function isMasked(func) {
|
8818
|
+
return !!maskSrcKey && maskSrcKey in func;
|
8819
|
+
}
|
8820
|
+
/**
|
8821
|
+
* Checks if `value` is likely a prototype object.
|
8822
|
+
*
|
8823
|
+
* @private
|
8824
|
+
* @param {*} value The value to check.
|
8825
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
8826
|
+
*/
|
8827
|
+
|
8828
|
+
|
8829
|
+
function isPrototype(value) {
|
8830
|
+
var Ctor = value && value.constructor,
|
8831
|
+
proto = typeof Ctor == 'function' && Ctor.prototype || objectProto;
|
8832
|
+
return value === proto;
|
8833
|
+
}
|
8834
|
+
/**
|
8835
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
8836
|
+
*
|
8837
|
+
* @private
|
8838
|
+
* @param {*} value The value to convert.
|
8839
|
+
* @returns {string} Returns the converted string.
|
8840
|
+
*/
|
8841
|
+
|
8842
|
+
|
8843
|
+
function objectToString(value) {
|
8844
|
+
return nativeObjectToString.call(value);
|
8845
|
+
}
|
8846
|
+
/**
|
8847
|
+
* Converts `func` to its source code.
|
8848
|
+
*
|
8849
|
+
* @private
|
8850
|
+
* @param {Function} func The function to convert.
|
8851
|
+
* @returns {string} Returns the source code.
|
8852
|
+
*/
|
8853
|
+
|
8854
|
+
|
8855
|
+
function toSource(func) {
|
8856
|
+
if (func != null) {
|
8857
|
+
try {
|
8858
|
+
return funcToString.call(func);
|
8859
|
+
} catch (e) {}
|
8860
|
+
|
8861
|
+
try {
|
8862
|
+
return func + '';
|
8863
|
+
} catch (e) {}
|
8864
|
+
}
|
8865
|
+
|
8866
|
+
return '';
|
8867
|
+
}
|
8868
|
+
/**
|
8869
|
+
* Performs a
|
8870
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
8871
|
+
* comparison between two values to determine if they are equivalent.
|
8872
|
+
*
|
8873
|
+
* @static
|
8874
|
+
* @memberOf _
|
8875
|
+
* @since 4.0.0
|
8876
|
+
* @category Lang
|
8877
|
+
* @param {*} value The value to compare.
|
8878
|
+
* @param {*} other The other value to compare.
|
8879
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
8880
|
+
* @example
|
8881
|
+
*
|
8882
|
+
* var object = { 'a': 1 };
|
8883
|
+
* var other = { 'a': 1 };
|
8884
|
+
*
|
8885
|
+
* _.eq(object, object);
|
8886
|
+
* // => true
|
8887
|
+
*
|
8888
|
+
* _.eq(object, other);
|
8889
|
+
* // => false
|
8890
|
+
*
|
8891
|
+
* _.eq('a', 'a');
|
8892
|
+
* // => true
|
8893
|
+
*
|
8894
|
+
* _.eq('a', Object('a'));
|
8895
|
+
* // => false
|
8896
|
+
*
|
8897
|
+
* _.eq(NaN, NaN);
|
8898
|
+
* // => true
|
8899
|
+
*/
|
8900
|
+
|
8901
|
+
|
8902
|
+
function eq(value, other) {
|
8903
|
+
return value === other || value !== value && other !== other;
|
8904
|
+
}
|
8905
|
+
/**
|
8906
|
+
* Checks if `value` is likely an `arguments` object.
|
8907
|
+
*
|
8908
|
+
* @static
|
8909
|
+
* @memberOf _
|
8910
|
+
* @since 0.1.0
|
8911
|
+
* @category Lang
|
8912
|
+
* @param {*} value The value to check.
|
8913
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
8914
|
+
* else `false`.
|
8915
|
+
* @example
|
8916
|
+
*
|
8917
|
+
* _.isArguments(function() { return arguments; }());
|
8918
|
+
* // => true
|
8919
|
+
*
|
8920
|
+
* _.isArguments([1, 2, 3]);
|
8921
|
+
* // => false
|
8922
|
+
*/
|
8923
|
+
|
8924
|
+
|
8925
|
+
var isArguments = baseIsArguments(function () {
|
8926
|
+
return arguments;
|
8927
|
+
}()) ? baseIsArguments : function (value) {
|
8928
|
+
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
|
8929
|
+
};
|
8930
|
+
/**
|
8931
|
+
* Checks if `value` is classified as an `Array` object.
|
8932
|
+
*
|
8933
|
+
* @static
|
8934
|
+
* @memberOf _
|
8935
|
+
* @since 0.1.0
|
8936
|
+
* @category Lang
|
8937
|
+
* @param {*} value The value to check.
|
8938
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
8939
|
+
* @example
|
8940
|
+
*
|
8941
|
+
* _.isArray([1, 2, 3]);
|
8942
|
+
* // => true
|
8943
|
+
*
|
8944
|
+
* _.isArray(document.body.children);
|
8945
|
+
* // => false
|
8946
|
+
*
|
8947
|
+
* _.isArray('abc');
|
8948
|
+
* // => false
|
8949
|
+
*
|
8950
|
+
* _.isArray(_.noop);
|
8951
|
+
* // => false
|
8952
|
+
*/
|
8953
|
+
|
8954
|
+
var isArray = Array.isArray;
|
8955
|
+
/**
|
8956
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
8957
|
+
* not a function and has a `value.length` that's an integer greater than or
|
8958
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
8959
|
+
*
|
8960
|
+
* @static
|
8961
|
+
* @memberOf _
|
8962
|
+
* @since 4.0.0
|
8963
|
+
* @category Lang
|
8964
|
+
* @param {*} value The value to check.
|
8965
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
8966
|
+
* @example
|
8967
|
+
*
|
8968
|
+
* _.isArrayLike([1, 2, 3]);
|
8969
|
+
* // => true
|
8970
|
+
*
|
8971
|
+
* _.isArrayLike(document.body.children);
|
8972
|
+
* // => true
|
8973
|
+
*
|
8974
|
+
* _.isArrayLike('abc');
|
8975
|
+
* // => true
|
8976
|
+
*
|
8977
|
+
* _.isArrayLike(_.noop);
|
8978
|
+
* // => false
|
8979
|
+
*/
|
8980
|
+
|
8981
|
+
function isArrayLike(value) {
|
8982
|
+
return value != null && isLength(value.length) && !isFunction(value);
|
8983
|
+
}
|
8984
|
+
/**
|
8985
|
+
* Checks if `value` is a buffer.
|
8986
|
+
*
|
8987
|
+
* @static
|
8988
|
+
* @memberOf _
|
8989
|
+
* @since 4.3.0
|
8990
|
+
* @category Lang
|
8991
|
+
* @param {*} value The value to check.
|
8992
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
8993
|
+
* @example
|
8994
|
+
*
|
8995
|
+
* _.isBuffer(new Buffer(2));
|
8996
|
+
* // => true
|
8997
|
+
*
|
8998
|
+
* _.isBuffer(new Uint8Array(2));
|
8999
|
+
* // => false
|
9000
|
+
*/
|
9001
|
+
|
9002
|
+
|
9003
|
+
var isBuffer = nativeIsBuffer || stubFalse;
|
9004
|
+
/**
|
9005
|
+
* Performs a deep comparison between two values to determine if they are
|
9006
|
+
* equivalent.
|
9007
|
+
*
|
9008
|
+
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
9009
|
+
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
9010
|
+
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
9011
|
+
* by their own, not inherited, enumerable properties. Functions and DOM
|
9012
|
+
* nodes are compared by strict equality, i.e. `===`.
|
9013
|
+
*
|
9014
|
+
* @static
|
9015
|
+
* @memberOf _
|
9016
|
+
* @since 0.1.0
|
9017
|
+
* @category Lang
|
9018
|
+
* @param {*} value The value to compare.
|
9019
|
+
* @param {*} other The other value to compare.
|
9020
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
9021
|
+
* @example
|
9022
|
+
*
|
9023
|
+
* var object = { 'a': 1 };
|
9024
|
+
* var other = { 'a': 1 };
|
9025
|
+
*
|
9026
|
+
* _.isEqual(object, other);
|
9027
|
+
* // => true
|
9028
|
+
*
|
9029
|
+
* object === other;
|
9030
|
+
* // => false
|
9031
|
+
*/
|
9032
|
+
|
9033
|
+
function isEqual(value, other) {
|
9034
|
+
return baseIsEqual(value, other);
|
9035
|
+
}
|
9036
|
+
/**
|
9037
|
+
* Checks if `value` is classified as a `Function` object.
|
9038
|
+
*
|
9039
|
+
* @static
|
9040
|
+
* @memberOf _
|
9041
|
+
* @since 0.1.0
|
9042
|
+
* @category Lang
|
9043
|
+
* @param {*} value The value to check.
|
9044
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
9045
|
+
* @example
|
9046
|
+
*
|
9047
|
+
* _.isFunction(_);
|
9048
|
+
* // => true
|
9049
|
+
*
|
9050
|
+
* _.isFunction(/abc/);
|
9051
|
+
* // => false
|
9052
|
+
*/
|
9053
|
+
|
9054
|
+
|
9055
|
+
function isFunction(value) {
|
9056
|
+
if (!isObject(value)) {
|
9057
|
+
return false;
|
9058
|
+
} // The use of `Object#toString` avoids issues with the `typeof` operator
|
9059
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
9060
|
+
|
9061
|
+
|
9062
|
+
var tag = baseGetTag(value);
|
9063
|
+
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
9064
|
+
}
|
9065
|
+
/**
|
9066
|
+
* Checks if `value` is a valid array-like length.
|
9067
|
+
*
|
9068
|
+
* **Note:** This method is loosely based on
|
9069
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
9070
|
+
*
|
9071
|
+
* @static
|
9072
|
+
* @memberOf _
|
9073
|
+
* @since 4.0.0
|
9074
|
+
* @category Lang
|
9075
|
+
* @param {*} value The value to check.
|
9076
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
9077
|
+
* @example
|
9078
|
+
*
|
9079
|
+
* _.isLength(3);
|
9080
|
+
* // => true
|
9081
|
+
*
|
9082
|
+
* _.isLength(Number.MIN_VALUE);
|
9083
|
+
* // => false
|
9084
|
+
*
|
9085
|
+
* _.isLength(Infinity);
|
9086
|
+
* // => false
|
9087
|
+
*
|
9088
|
+
* _.isLength('3');
|
9089
|
+
* // => false
|
9090
|
+
*/
|
9091
|
+
|
9092
|
+
|
9093
|
+
function isLength(value) {
|
9094
|
+
return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
9095
|
+
}
|
9096
|
+
/**
|
9097
|
+
* Checks if `value` is the
|
9098
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
9099
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
9100
|
+
*
|
9101
|
+
* @static
|
9102
|
+
* @memberOf _
|
9103
|
+
* @since 0.1.0
|
9104
|
+
* @category Lang
|
9105
|
+
* @param {*} value The value to check.
|
9106
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
9107
|
+
* @example
|
9108
|
+
*
|
9109
|
+
* _.isObject({});
|
9110
|
+
* // => true
|
9111
|
+
*
|
9112
|
+
* _.isObject([1, 2, 3]);
|
9113
|
+
* // => true
|
9114
|
+
*
|
9115
|
+
* _.isObject(_.noop);
|
9116
|
+
* // => true
|
9117
|
+
*
|
9118
|
+
* _.isObject(null);
|
9119
|
+
* // => false
|
9120
|
+
*/
|
9121
|
+
|
9122
|
+
|
9123
|
+
function isObject(value) {
|
9124
|
+
var type = _typeof$4(value);
|
9125
|
+
|
9126
|
+
return value != null && (type == 'object' || type == 'function');
|
9127
|
+
}
|
9128
|
+
/**
|
9129
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
9130
|
+
* and has a `typeof` result of "object".
|
9131
|
+
*
|
9132
|
+
* @static
|
9133
|
+
* @memberOf _
|
9134
|
+
* @since 4.0.0
|
9135
|
+
* @category Lang
|
9136
|
+
* @param {*} value The value to check.
|
9137
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
9138
|
+
* @example
|
9139
|
+
*
|
9140
|
+
* _.isObjectLike({});
|
9141
|
+
* // => true
|
9142
|
+
*
|
9143
|
+
* _.isObjectLike([1, 2, 3]);
|
9144
|
+
* // => true
|
9145
|
+
*
|
9146
|
+
* _.isObjectLike(_.noop);
|
9147
|
+
* // => false
|
9148
|
+
*
|
9149
|
+
* _.isObjectLike(null);
|
9150
|
+
* // => false
|
9151
|
+
*/
|
9152
|
+
|
9153
|
+
|
9154
|
+
function isObjectLike(value) {
|
9155
|
+
return value != null && _typeof$4(value) == 'object';
|
9156
|
+
}
|
9157
|
+
/**
|
9158
|
+
* Checks if `value` is classified as a typed array.
|
9159
|
+
*
|
9160
|
+
* @static
|
9161
|
+
* @memberOf _
|
9162
|
+
* @since 3.0.0
|
9163
|
+
* @category Lang
|
9164
|
+
* @param {*} value The value to check.
|
9165
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
9166
|
+
* @example
|
9167
|
+
*
|
9168
|
+
* _.isTypedArray(new Uint8Array);
|
9169
|
+
* // => true
|
9170
|
+
*
|
9171
|
+
* _.isTypedArray([]);
|
9172
|
+
* // => false
|
9173
|
+
*/
|
9174
|
+
|
9175
|
+
|
9176
|
+
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
9177
|
+
/**
|
9178
|
+
* Creates an array of the own enumerable property names of `object`.
|
9179
|
+
*
|
9180
|
+
* **Note:** Non-object values are coerced to objects. See the
|
9181
|
+
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
9182
|
+
* for more details.
|
9183
|
+
*
|
9184
|
+
* @static
|
9185
|
+
* @since 0.1.0
|
9186
|
+
* @memberOf _
|
9187
|
+
* @category Object
|
9188
|
+
* @param {Object} object The object to query.
|
9189
|
+
* @returns {Array} Returns the array of property names.
|
9190
|
+
* @example
|
9191
|
+
*
|
9192
|
+
* function Foo() {
|
9193
|
+
* this.a = 1;
|
9194
|
+
* this.b = 2;
|
9195
|
+
* }
|
9196
|
+
*
|
9197
|
+
* Foo.prototype.c = 3;
|
9198
|
+
*
|
9199
|
+
* _.keys(new Foo);
|
9200
|
+
* // => ['a', 'b'] (iteration order is not guaranteed)
|
9201
|
+
*
|
9202
|
+
* _.keys('hi');
|
9203
|
+
* // => ['0', '1']
|
9204
|
+
*/
|
9205
|
+
|
9206
|
+
function keys(object) {
|
9207
|
+
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
9208
|
+
}
|
9209
|
+
/**
|
9210
|
+
* This method returns a new empty array.
|
9211
|
+
*
|
9212
|
+
* @static
|
9213
|
+
* @memberOf _
|
9214
|
+
* @since 4.13.0
|
9215
|
+
* @category Util
|
9216
|
+
* @returns {Array} Returns the new empty array.
|
9217
|
+
* @example
|
9218
|
+
*
|
9219
|
+
* var arrays = _.times(2, _.stubArray);
|
9220
|
+
*
|
9221
|
+
* console.log(arrays);
|
9222
|
+
* // => [[], []]
|
9223
|
+
*
|
9224
|
+
* console.log(arrays[0] === arrays[1]);
|
9225
|
+
* // => false
|
9226
|
+
*/
|
9227
|
+
|
9228
|
+
|
9229
|
+
function stubArray() {
|
9230
|
+
return [];
|
9231
|
+
}
|
9232
|
+
/**
|
9233
|
+
* This method returns `false`.
|
9234
|
+
*
|
9235
|
+
* @static
|
9236
|
+
* @memberOf _
|
9237
|
+
* @since 4.13.0
|
9238
|
+
* @category Util
|
9239
|
+
* @returns {boolean} Returns `false`.
|
9240
|
+
* @example
|
9241
|
+
*
|
9242
|
+
* _.times(2, _.stubFalse);
|
9243
|
+
* // => [false, false]
|
9244
|
+
*/
|
9245
|
+
|
9246
|
+
|
9247
|
+
function stubFalse() {
|
9248
|
+
return false;
|
9249
|
+
}
|
9250
|
+
|
9251
|
+
module.exports = isEqual;
|
9252
|
+
})(lodash_isequal, lodash_isequal.exports);
|
9253
|
+
|
9254
|
+
var isEqual = lodash_isequal.exports;
|
9255
|
+
|
8416
9256
|
function _createSuper$b(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$c(); return function _createSuperInternal() { var Super = _getPrototypeOf$4(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$4(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$4(this, result); }; }
|
8417
9257
|
|
8418
9258
|
function _isNativeReflectConstruct$c() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
@@ -8574,7 +9414,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
8574
9414
|
case 9:
|
8575
9415
|
updateAttributes = parseAttributes(value.value, "Retrieved malformed attributes from the server for user: ".concat(this.state.identity), log$a);
|
8576
9416
|
|
8577
|
-
if (!
|
9417
|
+
if (!isEqual(this.state.attributes, updateAttributes)) {
|
8578
9418
|
this.state.attributes = updateAttributes;
|
8579
9419
|
updateReasons.push('attributes');
|
8580
9420
|
}
|
@@ -15353,7 +16193,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
15353
16193
|
}();
|
15354
16194
|
|
15355
16195
|
var logInstance = new Logger("");
|
15356
|
-
var version = "0.12.
|
16196
|
+
var version = "0.12.1-rc.2";
|
15357
16197
|
/**
|
15358
16198
|
* Settings container for the Twilsock client library
|
15359
16199
|
*/
|
@@ -29892,7 +30732,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
29892
30732
|
|
29893
30733
|
__decorate([declarativeTypeValidator.validateTypes(declarativeTypeValidator.nonEmptyString), __metadata("design:type", Function), __metadata("design:paramtypes", [String]), __metadata("design:returntype", void 0)], InstantQuery.prototype, "updateIndexName", null);
|
29894
30734
|
|
29895
|
-
var version$1 = "3.0.
|
30735
|
+
var version$1 = "3.0.6-rc.2";
|
29896
30736
|
|
29897
30737
|
function _createSuper$9(Derived) {
|
29898
30738
|
var hasNativeReflectConstruct = _isNativeReflectConstruct$a();
|
@@ -33880,7 +34720,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
33880
34720
|
return Network;
|
33881
34721
|
}();
|
33882
34722
|
|
33883
|
-
var version = "0.5.
|
34723
|
+
var version = "0.5.2-rc.2";
|
33884
34724
|
|
33885
34725
|
var _class, _temp;
|
33886
34726
|
|
@@ -34328,7 +35168,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
34328
35168
|
var updateReasons = [];
|
34329
35169
|
var updateAttributes = parseAttributes(data.attributes, 'Retrieved malformed attributes from the server for participant: ' + this.state.sid, log$7);
|
34330
35170
|
|
34331
|
-
if (data.attributes && !
|
35171
|
+
if (data.attributes && !isEqual(this.state.attributes, updateAttributes)) {
|
34332
35172
|
this.state.attributes = updateAttributes;
|
34333
35173
|
updateReasons.push('attributes');
|
34334
35174
|
}
|
@@ -35660,7 +36500,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
35660
36500
|
|
35661
36501
|
var updatedAttributes = parseAttributes(data.attributes, "Got malformed attributes for the message ".concat(this.sid), log$5);
|
35662
36502
|
|
35663
|
-
if (!
|
36503
|
+
if (!isEqual(this.state.attributes, updatedAttributes)) {
|
35664
36504
|
this.state.attributes = updatedAttributes;
|
35665
36505
|
updateReasons.push('attributes');
|
35666
36506
|
}
|
@@ -37223,7 +38063,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
37223
38063
|
break;
|
37224
38064
|
|
37225
38065
|
case fieldMappings.attributes:
|
37226
|
-
if (
|
38066
|
+
if (isEqual(this.channelState.attributes, update.attributes)) {
|
37227
38067
|
break;
|
37228
38068
|
}
|
37229
38069
|
|
@@ -37259,7 +38099,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
37259
38099
|
updateReasons.add(localKey);
|
37260
38100
|
}
|
37261
38101
|
|
37262
|
-
if (
|
38102
|
+
if (isEqual(this.channelState.lastMessage, {})) {
|
37263
38103
|
delete this.channelState.lastMessage;
|
37264
38104
|
}
|
37265
38105
|
|
@@ -37272,7 +38112,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
37272
38112
|
state.dateUpdated = new Date(state.dateUpdated);
|
37273
38113
|
}
|
37274
38114
|
|
37275
|
-
if (
|
38115
|
+
if (isEqual(this.channelState.state, state)) {
|
37276
38116
|
break;
|
37277
38117
|
}
|
37278
38118
|
|
@@ -37406,7 +38246,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
37406
38246
|
while (1) {
|
37407
38247
|
switch (_context5.prev = _context5.next) {
|
37408
38248
|
case 0:
|
37409
|
-
return _context5.abrupt("return", this.participantsEntity.addNonChatParticipant(proxyAddress, address, attributes
|
38249
|
+
return _context5.abrupt("return", this.participantsEntity.addNonChatParticipant(proxyAddress, address, attributes));
|
37410
38250
|
|
37411
38251
|
case 1:
|
37412
38252
|
case "end":
|
@@ -38700,7 +39540,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
38700
39540
|
conversationsMap = _context4.sent;
|
38701
39541
|
_context4.next = 5;
|
38702
39542
|
return conversationsMap.getItems({
|
38703
|
-
|
39543
|
+
key: sid
|
38704
39544
|
});
|
38705
39545
|
|
38706
39546
|
case 5:
|
@@ -38938,7 +39778,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
38938
39778
|
updateData.lastConsumedMessageIndex = data.lastConsumedMessageIndex;
|
38939
39779
|
}
|
38940
39780
|
|
38941
|
-
if (!
|
39781
|
+
if (!isEqual(updateData, {})) {
|
38942
39782
|
conversation._update(updateData);
|
38943
39783
|
}
|
38944
39784
|
|
@@ -39642,7 +40482,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
39642
40482
|
this.data = data.data || {};
|
39643
40483
|
};
|
39644
40484
|
|
39645
|
-
var version = "2.0.
|
40485
|
+
var version = "2.0.1-rc.5";
|
39646
40486
|
|
39647
40487
|
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
39648
40488
|
|
@@ -40726,6 +41566,13 @@ this.Twilio.Conversations = (function (exports) {
|
|
40726
41566
|
* The factory method will automatically trigger connection.
|
40727
41567
|
* Do not use it if you need finer-grained control.
|
40728
41568
|
*
|
41569
|
+
* Since this method returns an already-initialized client, some of the events
|
41570
|
+
* will be lost because they happen *before* the initialization. It is
|
41571
|
+
* recommended that `client.onWithReplay` is used as opposed to `client.on`
|
41572
|
+
* for subscribing to client events. The `client.onWithReplay` will re-emit
|
41573
|
+
* the most recent value for a given event if it emitted before the
|
41574
|
+
* subscription.
|
41575
|
+
*
|
40729
41576
|
* @param token Access token.
|
40730
41577
|
* @param options Options to customize the client.
|
40731
41578
|
* @returns Returns a fully initialized client.
|
@@ -40892,6 +41739,7 @@ this.Twilio.Conversations = (function (exports) {
|
|
40892
41739
|
exports.Media = Media;
|
40893
41740
|
exports.Message = Message;
|
40894
41741
|
exports.MessageBuilder = MessageBuilder;
|
41742
|
+
exports.NotificationTypes = NotificationTypes;
|
40895
41743
|
exports.Participant = Participant;
|
40896
41744
|
exports.PushNotification = PushNotification;
|
40897
41745
|
exports.RestPaginator = RestPaginator;
|