1(function webpackUniversalModuleDefinition(root, factory) { 2 if(typeof exports === 'object' && typeof module === 'object') 3 module.exports = factory(); 4 else if(typeof define === 'function' && define.amd) 5 define([], factory); 6 else if(typeof exports === 'object') 7 exports["json2csv"] = factory(); 8 else 9 root["json2csv"] = factory(); 10})(this, function() { 11return /******/ (function(modules) { // webpackBootstrap 12/******/ // The module cache 13/******/ var installedModules = {}; 14 15/******/ // The require function 16/******/ function __webpack_require__(moduleId) { 17 18/******/ // Check if module is in cache 19/******/ if(installedModules[moduleId]) 20/******/ return installedModules[moduleId].exports; 21 22/******/ // Create a new module (and put it into the cache) 23/******/ var module = installedModules[moduleId] = { 24/******/ exports: {}, 25/******/ id: moduleId, 26/******/ loaded: false 27/******/ }; 28 29/******/ // Execute the module function 30/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 31 32/******/ // Flag the module as loaded 33/******/ module.loaded = true; 34 35/******/ // Return the exports of the module 36/******/ return module.exports; 37/******/ } 38 39 40/******/ // expose the modules object (__webpack_modules__) 41/******/ __webpack_require__.m = modules; 42 43/******/ // expose the module cache 44/******/ __webpack_require__.c = installedModules; 45 46/******/ // __webpack_public_path__ 47/******/ __webpack_require__.p = ""; 48 49/******/ // Load entry module and return exports 50/******/ return __webpack_require__(0); 51/******/ }) 52/************************************************************************/ 53/******/ ([ 54/* 0 */ 55/***/ function(module, exports, __webpack_require__) { 56 57 /* WEBPACK VAR INJECTION */(function(process) {/** 58 * Module dependencies. 59 */ 60 var os = __webpack_require__(2); 61 var lodashGet = __webpack_require__(3); 62 var lodashFlatten = __webpack_require__(4); 63 var lodashUniq = __webpack_require__(5); 64 var lodashSet = __webpack_require__(6); 65 var lodashCloneDeep = __webpack_require__(7); 66 var flatten = __webpack_require__(9); 67 68 /** 69 * @name Json2CsvParams 70 * @typedef {Object} 71 * @property {Array} data - array of JSON objects 72 * @property {Array} [fields] - see documentation for details 73 * @property {String[]} [fieldNames] - names for fields at the same indexes. Must be same length as fields array 74 * (Optional. Maintained for backwards compatibility. Use fields config object for more features) 75 * @property {String} [del=","] - delimiter of columns 76 * @property {String} [defaultValue="<empty>"] - default value to use when missing data 77 * @property {String} [quotes='"'] - quotes around cell values and column names 78 * @property {String} [doubleQuotes='""'] - the value to replace double quotes in strings 79 * @property {Boolean} [hasCSVColumnTitle=true] - determines whether or not CSV file will contain a title column 80 * @property {String} [eol=''] - it gets added to each row of data 81 * @property {String} [newLine] - overrides the default OS line ending (\n on Unix \r\n on Windows) 82 * @property {Boolean} [flatten=false] - flattens nested JSON using flat (https://www.npmjs.com/package/flat) 83 * @property {String[]} [unwindPath] - similar to MongoDB's $unwind, Deconstructs an array field from the input JSON to output a row for each element 84 * @property {Boolean} [excelStrings] - converts string data into normalized Excel style data 85 * @property {Boolean} [includeEmptyRows=false] - includes empty rows 86 * @property {Boolean} [withBOM=false] - includes BOM character at the beginning of the csv 87 */ 88 89 /** 90 * Main function that converts json to csv. 91 * 92 * @param {Json2CsvParams} params Function parameters containing data, fields, 93 * delimiter (default is ','), hasCSVColumnTitle (default is true) 94 * and default value (default is '') 95 * @param {Function} [callback] Callback function 96 * if error, returning error in call back. 97 * if csv is created successfully, returning csv output to callback. 98 */ 99 module.exports = function (params, callback) { 100 var hasCallback = typeof callback === 'function'; 101 var err; 102 103 try { 104 checkParams(params); 105 } catch (err) { 106 if (hasCallback) { 107 return process.nextTick(function () { 108 callback(err); 109 }); 110 } else { 111 throw err; 112 } 113 } 114 115 var titles = createColumnTitles(params); 116 var csv = createColumnContent(params, titles); 117 118 if (hasCallback) { 119 return process.nextTick(function () { 120 callback(null, csv); 121 }); 122 } else { 123 return csv; 124 } 125 }; 126 127 128 /** 129 * Check passing params. 130 * 131 * Note that this modifies params. 132 * 133 * @param {Json2CsvParams} params Function parameters containing data, fields, 134 * delimiter, default value, mark quotes and hasCSVColumnTitle 135 */ 136 function checkParams(params) { 137 params.data = params.data || []; 138 139 // if data is an Object, not in array [{}], then just create 1 item array. 140 // So from now all data in array of object format. 141 if (!Array.isArray(params.data)) { 142 params.data = [params.data]; 143 } 144 145 if (params.flatten) { 146 params.data = params.data.map(flatten); 147 } 148 149 // Set params.fields default to first data element's keys 150 if (!params.fields && (params.data.length === 0 || typeof params.data[0] !== 'object')) { 151 throw new Error('params should include "fields" and/or non-empty "data" array of objects'); 152 } 153 154 if (!params.fields) { 155 var dataFields = params.data.map(function (item) { 156 return Object.keys(item); 157 }); 158 159 dataFields = lodashFlatten(dataFields); 160 params.fields = lodashUniq(dataFields); 161 } 162 163 164 //#check fieldNames 165 if (params.fieldNames && params.fieldNames.length !== params.fields.length) { 166 throw new Error('fieldNames and fields should be of the same length, if fieldNames is provided.'); 167 } 168 169 // Get fieldNames from fields 170 params.fieldNames = params.fields.map(function (field, i) { 171 if (params.fieldNames && typeof field === 'string') { 172 return params.fieldNames[i]; 173 } 174 return (typeof field === 'string') ? field : (field.label || field.value); 175 }); 176 177 //#check delimiter 178 params.del = params.del || ','; 179 180 //#check end of line character 181 params.eol = params.eol || ''; 182 183 //#check quotation mark 184 params.quotes = typeof params.quotes === 'string' ? params.quotes : '"'; 185 186 //#check double quotes 187 params.doubleQuotes = typeof params.doubleQuotes === 'string' ? params.doubleQuotes : Array(3).join(params.quotes); 188 189 //#check default value 190 params.defaultValue = params.defaultValue; 191 192 //#check hasCSVColumnTitle, if it is not explicitly set to false then true. 193 params.hasCSVColumnTitle = params.hasCSVColumnTitle !== false; 194 195 //#check include empty rows, defaults to false 196 params.includeEmptyRows = params.includeEmptyRows || false; 197 198 //#check with BOM, defaults to false 199 params.withBOM = params.withBOM || false; 200 201 //#check unwindPath, defaults to empty array 202 params.unwindPath = params.unwindPath || []; 203 204 // if unwindPath is not in array [{}], then just create 1 item array. 205 if (!Array.isArray(params.unwindPath)) { 206 params.unwindPath = [params.unwindPath]; 207 } 208 } 209
210 /** 211 * Create the title row with all the provided fields as column headings 212 * 213 * @param {Json2CsvParams} params Function parameters containing data, fields and delimiter 214 * @returns {String} titles as a string 215 */ 216 function createColumnTitles(params) { 217 var str = ''; 218 219 //if CSV has column title, then create it 220 if (params.hasCSVColumnTitle) { 221 params.fieldNames.forEach(function (element) { 222 if (str !== '') { 223 str += params.del; 224 } 225 str += JSON.stringify(element).replace(/\"/g, params.quotes); 226 }); 227 } 228 229 return str; 230 } 231 232 /** 233 * Replace the quotation marks of the field element if needed (can be a not string-like item) 234 * 235 * @param {string} stringifiedElement The field element after JSON.stringify() 236 * @param {string} quotes The params.quotes value. At this point we know that is not equal to double (") 237 */ 238 function replaceQuotationMarks(stringifiedElement, quotes) { 239 var lastCharIndex = stringifiedElement.length - 1; 240 241 //check if it's an string-like element 242 if (stringifiedElement[0] === '"' && stringifiedElement[lastCharIndex] === '"') { 243 //split the stringified field element because Strings are immutable 244 var splitElement = stringifiedElement.split(''); 245 246 //replace the quotation marks 247 splitElement[0] = quotes; 248 splitElement[lastCharIndex] = quotes; 249 250 //join again 251 stringifiedElement = splitElement.join(''); 252 } 253 254 return stringifiedElement; 255 } 256 257 /** 258 * Create the content column by column and row by row below the title 259 * 260 * @param {Object} params Function parameters containing data, fields and delimiter 261 * @param {String} str Title row as a string 262 * @returns {String} csv string 263 */ 264 function createColumnContent(params, str) { 265 createDataRows(params.data, params.unwindPath).forEach(function (dataElement) { 266 //if null do nothing, if empty object without includeEmptyRows do nothing 267 if (dataElement && (Object.getOwnPropertyNames(dataElement).length > 0 || params.includeEmptyRows)) { 268 var line = ''; 269 var eol = params.newLine || os.EOL || '\n'; 270 271 params.fields.forEach(function (fieldElement) { 272 var val; 273 var defaultValue = params.defaultValue; 274 var stringify = true; 275 if (typeof fieldElement === 'object' && 'default' in fieldElement) { 276 defaultValue = fieldElement.default; 277 } 278 279 if (fieldElement && (typeof fieldElement === 'string' || typeof fieldElement.value === 'string')) { 280 var path = (typeof fieldElement === 'string') ? fieldElement : fieldElement.value; 281 val = lodashGet(dataElement, path, defaultValue); 282 } else if (fieldElement && typeof fieldElement.value === 'function') { 283 var field = { 284 label: fieldElement.label, 285 default: fieldElement.default 286 }; 287 val = fieldElement.value(dataElement, field, params.data); 288 if (fieldElement.stringify !== undefined) { 289 stringify = fieldElement.stringify; 290 } 291 } 292 293 if (val === null || val === undefined){ 294 val = defaultValue; 295 } 296 297 if (val !== undefined) { 298 if (params.preserveNewLinesInValues && typeof val === 'string') { 299 val = val 300 .replace(/\n/g, '\u2028') 301 .replace(/\r/g, '\u2029'); 302 } 303 304 var stringifiedElement = val; 305 if (stringify) { 306 stringifiedElement = JSON.stringify(val); 307 } 308 309 if (params.preserveNewLinesInValues && typeof val === 'string') { 310 stringifiedElement = stringifiedElement 311 .replace(/\u2028/g, '\n') 312 .replace(/\u2029/g, '\r'); 313 } 314 315 if (typeof val === 'object') { 316 // In some cases (e.g. val is a Date), stringifiedElement is already a quoted string. 317 // Strip the leading and trailing quotes if so, so we don't end up double-quoting it 318 stringifiedElement = replaceQuotationMarks(stringifiedElement, ''); 319 320 // If val is a normal object, we want to escape its JSON so any commas etc 321 // don't get interpreted as field separators
322 stringifiedElement = JSON.stringify(stringifiedElement); 323 } 324 325 if (params.quotes !== '"') { 326 stringifiedElement = replaceQuotationMarks(stringifiedElement, params.quotes); 327 } 328 329 //JSON.stringify('\\') results in a string with two backslash 330 //characters in it. I.e. '\\\\'. 331 stringifiedElement = stringifiedElement.replace(/\\\\/g, '\\'); 332 333 if (params.excelStrings && typeof val === 'string') { 334 stringifiedElement = '"="' + stringifiedElement + '""'; 335 } 336 337 line += stringifiedElement; 338 } 339 340 line += params.del; 341 }); 342 343 //remove last delimeter by its length 344 line = line.substring(0, line.length - params.del.length); 345 //Replace single quotes with double quotes. Single quotes are preceeded by 346 //a backslash. Be careful not to remove backslash content from the string. 347 line = line.split('\\\\').map(function (portion) { 348 return portion.replace(/\\"/g, params.doubleQuotes); 349 }).join('\\\\'); 350 //Remove the final excess backslashes from the stringified value. 351 line = line.replace(/\\\\/g, '\\'); 352 //If header exists, add it, otherwise, print only content 353 if (str !== '') { 354 str += eol + line + params.eol; 355 } else { 356 str = line + params.eol; 357 } 358 } 359 }); 360 // Add BOM character if required 361 if (params.withBOM) { 362 str = '\ufeff' + str; 363 } 364 365 return str; 366 } 367 368 /** 369 * Performs the unwind recursively in specified sequence 370 * 371 * @param {Array} originalData The params.data value. Original array of JSON objects 372 * @param {String[]} unwindPaths The params.unwindPath value. Unwind strings to be used to deconstruct array 373 * @returns {Array} Array of objects containing all rows after unwind of chosen paths 374 */ 375 function createDataRows(originalData, unwindPaths) { 376 var dataRows = []; 377 if (unwindPaths.length) { 378 originalData.forEach(function(dataElement) { 379 var dataRow = [dataElement]; 380 381 unwindPaths.forEach(function(unwindPath) { 382 dataRow = unwindRows(dataRow, unwindPath); 383 }); 384 385 Array.prototype.push.apply(dataRows, dataRow); 386 }); 387 } else { 388 dataRows = originalData; 389 } 390 391 return dataRows; 392 } 393 394 /** 395 * Performs the unwind logic if necessary to convert single JSON document into multiple rows 396 * 397 * @param {Array} inputRows Array contaning single or multiple rows to unwind 398 * @param {String} unwindPath Single path to do unwind 399 * @returns {Array} Array of rows processed 400 */ 401 function unwindRows(inputRows, unwindPath) { 402 var outputRows = []; 403 inputRows.forEach(function(dataEl) { 404 var unwindArray = lodashGet(dataEl, unwindPath); 405 var isArr = Array.isArray(unwindArray); 406 407 if (isArr && unwindArray.length) { 408 unwindArray.forEach(function(unwindEl) { 409 var dataCopy = lodashCloneDeep(dataEl); 410 lodashSet(dataCopy, unwindPath, unwindEl); 411 outputRows.push(dataCopy); 412 }); 413 } else if (isArr && !unwindArray.length) { 414 var dataCopy = lodashCloneDeep(dataEl); 415 lodashSet(dataCopy, unwindPath, undefined); 416 outputRows.push(dataCopy); 417 } else { 418 outputRows.push(dataEl); 419 } 420 }); 421 return outputRows; 422 } 423 424 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) 425 426/***/ }, 427/* 1 */ 428/***/ function(module, exports) { 429 430 // shim for using process in browser 431 var process = module.exports = {}; 432 433 // cached from whatever global is present so that test runners that stub it 434 // don't break things. But we need to wrap it in a try catch in case it is 435 // wrapped in strict mode code which doesn't define any globals. It's inside a 436 // function because try/catches deoptimize in certain engines. 437 438 var cachedSetTimeout; 439 var cachedClearTimeout; 440 441 (function () { 442 try { 443 cachedSetTimeout = setTimeout; 444 } catch (e) { 445 cachedSetTimeout = function () { 446 throw new Error('setTimeout is not defined'); 447 } 448 } 449 try { 450 cachedClearTimeout = clearTimeout; 451 } catch (e) { 452 cachedClearTimeout = function () { 453 throw new Error('clearTimeout is not defined'); 454 } 455 } 456 } ()) 457 function runTimeout(fun) { 458 if (cachedSetTimeout === setTimeout) { 459 //normal enviroments in sane situations 460 return setTimeout(fun, 0); 461 } 462 try { 463 // when when somebody has screwed with setTimeout but no I.E. maddness 464 return cachedSetTimeout(fun, 0); 465 } catch(e){ 466 try { 467 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 468 return cachedSetTimeout.call(null, fun, 0); 469 } catch(e){ 470 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error 471 return cachedSetTimeout.call(this, fun, 0); 472 } 473 } 474 475 476 } 477 function runClearTimeout(marker) { 478 if (cachedClearTimeout === clearTimeout) { 479 //normal enviroments in sane situations 480 return clearTimeout(marker); 481 } 482 try { 483 // when when somebody has screwed with setTimeout but no I.E. maddness 484 return cachedClearTimeout(marker); 485 } catch (e){ 486 try { 487 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 488 return cachedClearTimeout.call(null, marker); 489 } catch (e){ 490 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. 491 // Some versions of I.E. have different rules for clearTimeout vs setTimeout 492 return cachedClearTimeout.call(this, marker); 493 } 494 } 495 496 497 498 } 499 var queue = []; 500 var draining = false;
vendor: 5,642 bytes, lines 501-716
501 var currentQueue; 502 var queueIndex = -1; 503 504 function cleanUpNextTick() { 505 if (!draining || !currentQueue) { 506 return; 507 } 508 draining = false; 509 if (currentQueue.length) { 510 queue = currentQueue.concat(queue); 511 } else { 512 queueIndex = -1; 513 } 514 if (queue.length) { 515 drainQueue(); 516 } 517 } 518 519 function drainQueue() { 520 if (draining) { 521 return; 522 } 523 var timeout = runTimeout(cleanUpNextTick); 524 draining = true; 525 526 var len = queue.length; 527 while(len) { 528 currentQueue = queue; 529 queue = []; 530 while (++queueIndex < len) { 531 if (currentQueue) { 532 currentQueue[queueIndex].run(); 533 } 534 } 535 queueIndex = -1; 536 len = queue.length; 537 } 538 currentQueue = null; 539 draining = false; 540 runClearTimeout(timeout); 541 } 542 543 process.nextTick = function (fun) { 544 var args = new Array(arguments.length - 1); 545 if (arguments.length > 1) { 546 for (var i = 1; i < arguments.length; i++) { 547 args[i - 1] = arguments[i]; 548 } 549 } 550 queue.push(new Item(fun, args)); 551 if (queue.length === 1 && !draining) { 552 runTimeout(drainQueue); 553 } 554 }; 555 556 // v8 likes predictible objects 557 function Item(fun, array) { 558 this.fun = fun; 559 this.array = array; 560 } 561 Item.prototype.run = function () { 562 this.fun.apply(null, this.array); 563 }; 564 process.title = 'browser'; 565 process.browser = true; 566 process.env = {}; 567 process.argv = []; 568 process.version = ''; // empty string to avoid regexp issues 569 process.versions = {}; 570 571 function noop() {} 572 573 process.on = noop; 574 process.addListener = noop; 575 process.once = noop; 576 process.off = noop; 577 process.removeListener = noop; 578 process.removeAllListeners = noop; 579 process.emit = noop; 580 581 process.binding = function (name) { 582 throw new Error('process.binding is not supported'); 583 }; 584 585 process.cwd = function () { return '/' }; 586 process.chdir = function (dir) { 587 throw new Error('process.chdir is not supported'); 588 }; 589 process.umask = function() { return 0; }; 590 591 592/***/ }, 593/* 2 */ 594/***/ function(module, exports) { 595 596 exports.endianness = function () { return 'LE' }; 597 598 exports.hostname = function () { 599 if (typeof location !== 'undefined') { 600 return location.hostname 601 } 602 else return ''; 603 }; 604 605 exports.loadavg = function () { return [] }; 606 607 exports.uptime = function () { return 0 }; 608 609 exports.freemem = function () { 610 return Number.MAX_VALUE; 611 }; 612 613 exports.totalmem = function () { 614 return Number.MAX_VALUE; 615 }; 616 617 exports.cpus = function () { return [] }; 618 619 exports.type = function () { return 'Browser' }; 620 621 exports.release = function () { 622 if (typeof navigator !== 'undefined') { 623 return navigator.appVersion; 624 } 625 return ''; 626 }; 627 628 exports.networkInterfaces 629 = exports.getNetworkInterfaces 630 = function () { return {} }; 631 632 exports.arch = function () { return 'javascript' }; 633 634 exports.platform = function () { return 'browser' }; 635 636 exports.tmpdir = exports.tmpDir = function () { 637 return '/tmp'; 638 }; 639 640 exports.EOL = '\n'; 641 642 643/***/ }, 644/* 3 */ 645/***/ function(module, exports) { 646 647 /* WEBPACK VAR INJECTION */(function(global) {/** 648 * lodash (Custom Build) <https://lodash.com/> 649 * Build: `lodash modularize exports="npm" -o ./` 650 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 651 * Released under MIT license <https://lodash.com/license> 652 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 653 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 654 */ 655 656 /** Used as the `TypeError` message for "Functions" methods. */ 657 var FUNC_ERROR_TEXT = 'Expected a function'; 658 659 /** Used to stand-in for `undefined` hash values. */ 660 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 661 662 /** Used as references for various `Number` constants. */ 663 var INFINITY = 1 / 0; 664 665 /** `Object#toString` result references. */ 666 var funcTag = '[object Function]', 667 genTag = '[object GeneratorFunction]', 668 symbolTag = '[object Symbol]'; 669 670 /** Used to match property names within property paths. */ 671 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, 672 reIsPlainProp = /^\w*$/, 673 reLeadingDot = /^\./, 674 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 675 676 /** 677 * Used to match `RegExp` 678 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 679 */ 680 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 681 682 /** Used to match backslashes in property paths. */ 683 var reEscapeChar = /\\(\\)?/g; 684 685 /** Used to detect host constructors (Safari). */ 686 var reIsHostCtor = /^\[object .+?Constructor\]$/; 687 688 /** Detect free variable `global` from Node.js. */ 689 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 690 691 /** Detect free variable `self`. */ 692 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 693 694 /** Used as a reference to the global object. */ 695 var root = freeGlobal || freeSelf || Function('return this')(); 696 697 /** 698 * Gets the value at `key` of `object`. 699 * 700 * @private 701 * @param {Object} [object] The object to query. 702 * @param {string} key The key of the property to get. 703 * @returns {*} Returns the property value. 704 */ 705 function getValue(object, key) { 706 return object == null ? undefined : object[key]; 707 } 708 709 /** 710 * Checks if `value` is a host object in IE < 9. 711 * 712 * @private 713 * @param {*} value The value to check. 714 * @returns {boolean} Returns `true` if `value` is a host object, else `false`. 715 */ 716 function isHostObject(value) {
vendor: 4,540 bytes, lines 717-888
717 // Many host objects are `Object` objects that can coerce to strings 718 // despite having improperly defined `toString` methods. 719 var result = false; 720 if (value != null && typeof value.toString != 'function') { 721 try { 722 result = !!(value + ''); 723 } catch (e) {} 724 } 725 return result; 726 } 727 728 /** Used for built-in method references. */ 729 var arrayProto = Array.prototype, 730 funcProto = Function.prototype, 731 objectProto = Object.prototype; 732 733 /** Used to detect overreaching core-js shims. */ 734 var coreJsData = root['__core-js_shared__']; 735 736 /** Used to detect methods masquerading as native. */ 737 var maskSrcKey = (function() { 738 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 739 return uid ? ('Symbol(src)_1.' + uid) : ''; 740 }()); 741 742 /** Used to resolve the decompiled source of functions. */ 743 var funcToString = funcProto.toString; 744 745 /** Used to check objects for own properties. */ 746 var hasOwnProperty = objectProto.hasOwnProperty; 747 748 /** 749 * Used to resolve the 750 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 751 * of values. 752 */ 753 var objectToString = objectProto.toString; 754 755 /** Used to detect if a method is native. */ 756 var reIsNative = RegExp('^' + 757 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 758 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 759 ); 760 761 /** Built-in value references. */ 762 var Symbol = root.Symbol, 763 splice = arrayProto.splice; 764 765 /* Built-in method references that are verified to be native. */ 766 var Map = getNative(root, 'Map'), 767 nativeCreate = getNative(Object, 'create'); 768 769 /** Used to convert symbols to primitives and strings. */ 770 var symbolProto = Symbol ? Symbol.prototype : undefined, 771 symbolToString = symbolProto ? symbolProto.toString : undefined; 772 773 /** 774 * Creates a hash object. 775 * 776 * @private 777 * @constructor 778 * @param {Array} [entries] The key-value pairs to cache. 779 */ 780 function Hash(entries) { 781 var index = -1, 782 length = entries ? entries.length : 0; 783 784 this.clear(); 785 while (++index < length) { 786 var entry = entries[index]; 787 this.set(entry[0], entry[1]); 788 } 789 } 790 791 /** 792 * Removes all key-value entries from the hash. 793 * 794 * @private 795 * @name clear 796 * @memberOf Hash 797 */ 798 function hashClear() { 799 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 800 } 801 802 /** 803 * Removes `key` and its value from the hash. 804 * 805 * @private 806 * @name delete 807 * @memberOf Hash 808 * @param {Object} hash The hash to modify. 809 * @param {string} key The key of the value to remove. 810 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 811 */ 812 function hashDelete(key) { 813 return this.has(key) && delete this.__data__[key]; 814 } 815 816 /** 817 * Gets the hash value for `key`. 818 * 819 * @private 820 * @name get 821 * @memberOf Hash 822 * @param {string} key The key of the value to get. 823 * @returns {*} Returns the entry value. 824 */ 825 function hashGet(key) { 826 var data = this.__data__; 827 if (nativeCreate) { 828 var result = data[key]; 829 return result === HASH_UNDEFINED ? undefined : result; 830 } 831 return hasOwnProperty.call(data, key) ? data[key] : undefined; 832 } 833 834 /** 835 * Checks if a hash value for `key` exists. 836 * 837 * @private 838 * @name has 839 * @memberOf Hash 840 * @param {string} key The key of the entry to check. 841 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 842 */ 843 function hashHas(key) { 844 var data = this.__data__; 845 return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); 846 } 847 848 /** 849 * Sets the hash `key` to `value`. 850 * 851 * @private 852 * @name set 853 * @memberOf Hash 854 * @param {string} key The key of the value to set. 855 * @param {*} value The value to set. 856 * @returns {Object} Returns the hash instance. 857 */ 858 function hashSet(key, value) { 859 var data = this.__data__; 860 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; 861 return this; 862 } 863 864 // Add methods to `Hash`. 865 Hash.prototype.clear = hashClear; 866 Hash.prototype['delete'] = hashDelete; 867 Hash.prototype.get = hashGet; 868 Hash.prototype.has = hashHas; 869 Hash.prototype.set = hashSet; 870 871 /** 872 * Creates an list cache object. 873 * 874 * @private 875 * @constructor 876 * @param {Array} [entries] The key-value pairs to cache. 877 */ 878 function ListCache(entries) { 879 var index = -1, 880 length = entries ? entries.length : 0; 881 882 this.clear(); 883 while (++index < length) { 884 var entry = entries[index]; 885 this.set(entry[0], entry[1]); 886 } 887 } 888
vendor: 4,451 bytes, lines 889-1082
889 /** 890 * Removes all key-value entries from the list cache. 891 * 892 * @private 893 * @name clear 894 * @memberOf ListCache 895 */ 896 function listCacheClear() { 897 this.__data__ = []; 898 } 899 900 /** 901 * Removes `key` and its value from the list cache. 902 * 903 * @private 904 * @name delete 905 * @memberOf ListCache 906 * @param {string} key The key of the value to remove. 907 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 908 */ 909 function listCacheDelete(key) { 910 var data = this.__data__, 911 index = assocIndexOf(data, key); 912 913 if (index < 0) { 914 return false; 915 } 916 var lastIndex = data.length - 1; 917 if (index == lastIndex) { 918 data.pop(); 919 } else { 920 splice.call(data, index, 1); 921 } 922 return true; 923 } 924 925 /** 926 * Gets the list cache value for `key`. 927 * 928 * @private 929 * @name get 930 * @memberOf ListCache 931 * @param {string} key The key of the value to get. 932 * @returns {*} Returns the entry value. 933 */ 934 function listCacheGet(key) { 935 var data = this.__data__, 936 index = assocIndexOf(data, key); 937 938 return index < 0 ? undefined : data[index][1]; 939 } 940 941 /** 942 * Checks if a list cache value for `key` exists. 943 * 944 * @private 945 * @name has 946 * @memberOf ListCache 947 * @param {string} key The key of the entry to check. 948 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 949 */ 950 function listCacheHas(key) { 951 return assocIndexOf(this.__data__, key) > -1; 952 } 953 954 /** 955 * Sets the list cache `key` to `value`. 956 * 957 * @private 958 * @name set 959 * @memberOf ListCache 960 * @param {string} key The key of the value to set. 961 * @param {*} value The value to set. 962 * @returns {Object} Returns the list cache instance. 963 */ 964 function listCacheSet(key, value) { 965 var data = this.__data__, 966 index = assocIndexOf(data, key); 967 968 if (index < 0) { 969 data.push([key, value]); 970 } else { 971 data[index][1] = value; 972 } 973 return this; 974 } 975 976 // Add methods to `ListCache`. 977 ListCache.prototype.clear = listCacheClear; 978 ListCache.prototype['delete'] = listCacheDelete; 979 ListCache.prototype.get = listCacheGet; 980 ListCache.prototype.has = listCacheHas; 981 ListCache.prototype.set = listCacheSet; 982 983 /** 984 * Creates a map cache object to store key-value pairs. 985 * 986 * @private 987 * @constructor 988 * @param {Array} [entries] The key-value pairs to cache. 989 */ 990 function MapCache(entries) { 991 var index = -1, 992 length = entries ? entries.length : 0; 993 994 this.clear(); 995 while (++index < length) { 996 var entry = entries[index]; 997 this.set(entry[0], entry[1]); 998 } 999 } 1000 1001 /** 1002 * Removes all key-value entries from the map. 1003 * 1004 * @private 1005 * @name clear 1006 * @memberOf MapCache 1007 */ 1008 function mapCacheClear() { 1009 this.__data__ = { 1010 'hash': new Hash, 1011 'map': new (Map || ListCache), 1012 'string': new Hash 1013 }; 1014 } 1015 1016 /** 1017 * Removes `key` and its value from the map. 1018 * 1019 * @private 1020 * @name delete 1021 * @memberOf MapCache 1022 * @param {string} key The key of the value to remove. 1023 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 1024 */ 1025 function mapCacheDelete(key) { 1026 return getMapData(this, key)['delete'](key); 1027 } 1028 1029 /** 1030 * Gets the map value for `key`. 1031 * 1032 * @private 1033 * @name get 1034 * @memberOf MapCache 1035 * @param {string} key The key of the value to get. 1036 * @returns {*} Returns the entry value. 1037 */ 1038 function mapCacheGet(key) { 1039 return getMapData(this, key).get(key); 1040 } 1041 1042 /** 1043 * Checks if a map value for `key` exists. 1044 * 1045 * @private 1046 * @name has 1047 * @memberOf MapCache 1048 * @param {string} key The key of the entry to check. 1049 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 1050 */ 1051 function mapCacheHas(key) { 1052 return getMapData(this, key).has(key); 1053 } 1054 1055 /** 1056 * Sets the map `key` to `value`. 1057 * 1058 * @private 1059 * @name set 1060 * @memberOf MapCache 1061 * @param {string} key The key of the value to set. 1062 * @param {*} value The value to set. 1063 * @returns {Object} Returns the map cache instance. 1064 */ 1065 function mapCacheSet(key, value) { 1066 getMapData(this, key).set(key, value); 1067 return this; 1068 } 1069 1070 // Add methods to `MapCache`. 1071 MapCache.prototype.clear = mapCacheClear; 1072 MapCache.prototype['delete'] = mapCacheDelete; 1073 MapCache.prototype.get = mapCacheGet; 1074 MapCache.prototype.has = mapCacheHas; 1075 MapCache.prototype.set = mapCacheSet; 1076 1077 /** 1078 * Gets the index at which the `key` is found in `array` of key-value pairs. 1079 * 1080 * @private 1081 * @param {Array} array The array to inspect. 1082 * @param {*}
vendor: 15,518 bytes, lines 1082-1657
1082 key The key to search for. 1083 * @returns {number} Returns the index of the matched value, else `-1`. 1084 */ 1085 function assocIndexOf(array, key) { 1086 var length = array.length; 1087 while (length--) { 1088 if (eq(array[length][0], key)) { 1089 return length; 1090 } 1091 } 1092 return -1; 1093 } 1094 1095 /** 1096 * The base implementation of `_.get` without support for default values. 1097 * 1098 * @private 1099 * @param {Object} object The object to query. 1100 * @param {Array|string} path The path of the property to get. 1101 * @returns {*} Returns the resolved value. 1102 */ 1103 function baseGet(object, path) { 1104 path = isKey(path, object) ? [path] : castPath(path); 1105 1106 var index = 0, 1107 length = path.length; 1108 1109 while (object != null && index < length) { 1110 object = object[toKey(path[index++])]; 1111 } 1112 return (index && index == length) ? object : undefined; 1113 } 1114 1115 /** 1116 * The base implementation of `_.isNative` without bad shim checks. 1117 * 1118 * @private 1119 * @param {*} value The value to check. 1120 * @returns {boolean} Returns `true` if `value` is a native function, 1121 * else `false`. 1122 */ 1123 function baseIsNative(value) { 1124 if (!isObject(value) || isMasked(value)) { 1125 return false; 1126 } 1127 var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; 1128 return pattern.test(toSource(value)); 1129 } 1130 1131 /** 1132 * The base implementation of `_.toString` which doesn't convert nullish 1133 * values to empty strings. 1134 * 1135 * @private 1136 * @param {*} value The value to process. 1137 * @returns {string} Returns the string. 1138 */ 1139 function baseToString(value) { 1140 // Exit early for strings to avoid a performance hit in some environments. 1141 if (typeof value == 'string') { 1142 return value; 1143 } 1144 if (isSymbol(value)) { 1145 return symbolToString ? symbolToString.call(value) : ''; 1146 } 1147 var result = (value + ''); 1148 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 1149 } 1150 1151 /** 1152 * Casts `value` to a path array if it's not one. 1153 * 1154 * @private 1155 * @param {*} value The value to inspect. 1156 * @returns {Array} Returns the cast property path array. 1157 */ 1158 function castPath(value) { 1159 return isArray(value) ? value : stringToPath(value); 1160 } 1161 1162 /** 1163 * Gets the data for `map`. 1164 * 1165 * @private 1166 * @param {Object} map The map to query. 1167 * @param {string} key The reference key. 1168 * @returns {*} Returns the map data. 1169 */ 1170 function getMapData(map, key) { 1171 var data = map.__data__; 1172 return isKeyable(key) 1173 ? data[typeof key == 'string' ? 'string' : 'hash'] 1174 : data.map; 1175 } 1176 1177 /** 1178 * Gets the native function at `key` of `object`. 1179 * 1180 * @private 1181 * @param {Object} object The object to query. 1182 * @param {string} key The key of the method to get. 1183 * @returns {*} Returns the function if it's native, else `undefined`. 1184 */ 1185 function getNative(object, key) { 1186 var value = getValue(object, key); 1187 return baseIsNative(value) ? value : undefined; 1188 } 1189 1190 /** 1191 * Checks if `value` is a property name and not a property path. 1192 * 1193 * @private 1194 * @param {*} value The value to check. 1195 * @param {Object} [object] The object to query keys on. 1196 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 1197 */ 1198 function isKey(value, object) { 1199 if (isArray(value)) { 1200 return false; 1201 } 1202 var type = typeof value; 1203 if (type == 'number' || type == 'symbol' || type == 'boolean' || 1204 value == null || isSymbol(value)) { 1205 return true; 1206 } 1207 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || 1208 (object != null && value in Object(object)); 1209 } 1210 1211 /** 1212 * Checks if `value` is suitable for use as unique object key. 1213 * 1214 * @private 1215 * @param {*} value The value to check. 1216 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 1217 */ 1218 function isKeyable(value) { 1219 var type = typeof value; 1220 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') 1221 ? (value !== '__proto__') 1222 : (value === null); 1223 } 1224 1225 /** 1226 * Checks if `func` has its source masked. 1227 * 1228 * @private 1229 * @param {Function} func The function to check. 1230 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 1231 */ 1232 function isMasked(func) { 1233 return !!maskSrcKey && (maskSrcKey in func); 1234 } 1235 1236 /** 1237 * Converts `string` to a property path array. 1238 * 1239 * @private 1240 * @param {string} string The string to convert. 1241 * @returns {Array} Returns the property path array. 1242 */ 1243 var stringToPath = memoize(function(string) { 1244 string = toString(string); 1245 1246 var result = []; 1247 if (reLeadingDot.test(string)) { 1248 result.push(''); 1249 } 1250 string.replace(rePropName, function(match, number, quote, string) { 1251 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); 1252 }); 1253 return result; 1254 }); 1255 1256 /** 1257 * Converts `value` to a string key if it's not a string or symbol. 1258 * 1259 * @private 1260 * @param {*} value The value to inspect. 1261 * @returns {string|symbol} Returns the key. 1262 */ 1263 function toKey(value) { 1264 if (typeof value == 'string' || isSymbol(value)) { 1265 return value; 1266 } 1267 var result = (value + ''); 1268 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 1269 } 1270 1271 /** 1272 * Converts `func` to its source code. 1273 * 1274 * @private 1275 * @param {Function} func The function to process. 1276 * @returns {string} Returns the source code. 1277 */ 1278 function toSource(func) { 1279 if (func != null) { 1280 try { 1281 return funcToString.call(func); 1282 } catch (e) {} 1283 try { 1284 return (func + ''); 1285 } catch (e) {} 1286 } 1287 return ''; 1288 } 1289 1290 /** 1291 * Creates a function that memoizes the result of `func`. If `resolver` is 1292 * provided, it determines the cache key for storing the result based on the 1293 * arguments provided to the memoized function. By default, the first argument 1294 * provided to the memoized function is used as the map cache key. The `func` 1295 * is invoked with the `this` binding of the memoized function. 1296 * 1297 * **Note:** The cache is exposed as the `cache` property on the memoized 1298 * function. Its creation may be customized by replacing the `_.memoize.Cache` 1299 * constructor with one whose instances implement the 1300 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) 1301 * method interface of `delete`, `get`, `has`, and `set`. 1302 * 1303 * @static 1304 * @memberOf _ 1305 * @since 0.1.0 1306 * @category Function 1307 * @param {Function} func The function to have its output memoized. 1308 * @param {Function} [resolver] The function to resolve the cache key. 1309 * @returns {Function} Returns the new memoized function. 1310 * @example 1311 * 1312 * var object = { 'a': 1, 'b': 2 }; 1313 * var other = { 'c': 3, 'd': 4 }; 1314 * 1315 * var values = _.memoize(_.values); 1316 * values(object); 1317 * // => [1, 2] 1318 * 1319 * values(other); 1320 * // => [3, 4] 1321 * 1322 * object.a = 2; 1323 * values(object); 1324 * // => [1, 2] 1325 * 1326 * // Modify the result cache. 1327 * values.cache.set(object, ['a', 'b']); 1328 * values(object); 1329 * // => ['a', 'b'] 1330 * 1331 * // Replace `_.memoize.Cache`. 1332 * _.memoize.Cache = WeakMap; 1333 */ 1334 function memoize(func, resolver) { 1335 if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { 1336 throw new TypeError(FUNC_ERROR_TEXT); 1337 } 1338 var memoized = function() { 1339 var args = arguments, 1340 key = resolver ? resolver.apply(this, args) : args[0], 1341 cache = memoized.cache; 1342 1343 if (cache.has(key)) { 1344 return cache.get(key); 1345 } 1346 var result = func.apply(this, args); 1347 memoized.cache = cache.set(key, result); 1348 return result; 1349 }; 1350 memoized.cache = new (memoize.Cache || MapCache); 1351 return memoized; 1352 } 1353 1354 // Assign cache to `_.memoize`. 1355 memoize.Cache = MapCache; 1356 1357 /** 1358 * Performs a 1359 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 1360 * comparison between two values to determine if they are equivalent. 1361 * 1362 * @static 1363 * @memberOf _ 1364 * @since 4.0.0 1365 * @category Lang 1366 * @param {*} value The value to compare. 1367 * @param {*} other The other value to compare. 1368 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 1369 * @example 1370 * 1371 * var object = { 'a': 1 }; 1372 * var other = { 'a': 1 }; 1373 * 1374 * _.eq(object, object); 1375 * // => true 1376 * 1377 * _.eq(object, other); 1378 * // => false 1379 * 1380 * _.eq('a', 'a'); 1381 * // => true 1382 * 1383 * _.eq('a', Object('a')); 1384 * // => false 1385 * 1386 * _.eq(NaN, NaN); 1387 * // => true 1388 */ 1389 function eq(value, other) { 1390 return value === other || (value !== value && other !== other); 1391 } 1392 1393 /** 1394 * Checks if `value` is classified as an `Array` object. 1395 * 1396 * @static 1397 * @memberOf _ 1398 * @since 0.1.0 1399 * @category Lang 1400 * @param {*} value The value to check. 1401 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 1402 * @example 1403 * 1404 * _.isArray([1, 2, 3]); 1405 * // => true 1406 * 1407 * _.isArray(document.body.children); 1408 * // => false 1409 * 1410 * _.isArray('abc'); 1411 * // => false 1412 * 1413 * _.isArray(_.noop); 1414 * // => false 1415 */ 1416 var isArray = Array.isArray; 1417 1418 /** 1419 * Checks if `value` is classified as a `Function` object. 1420 * 1421 * @static 1422 * @memberOf _ 1423 * @since 0.1.0 1424 * @category Lang 1425 * @param {*} value The value to check. 1426 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 1427 * @example 1428 * 1429 * _.isFunction(_); 1430 * // => true 1431 * 1432 * _.isFunction(/abc/); 1433 * // => false 1434 */ 1435 function isFunction(value) { 1436 // The use of `Object#toString` avoids issues with the `typeof` operator 1437 // in Safari 8-9 which returns 'object' for typed array and other constructors. 1438 var tag = isObject(value) ? objectToString.call(value) : ''; 1439 return tag == funcTag || tag == genTag; 1440 } 1441 1442 /** 1443 * Checks if `value` is the 1444 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 1445 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 1446 * 1447 * @static 1448 * @memberOf _ 1449 * @since 0.1.0 1450 * @category Lang 1451 * @param {*} value The value to check. 1452 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 1453 * @example 1454 * 1455 * _.isObject({}); 1456 * // => true 1457 * 1458 * _.isObject([1, 2, 3]); 1459 * // => true 1460 * 1461 * _.isObject(_.noop); 1462 * // => true 1463 * 1464 * _.isObject(null); 1465 * // => false 1466 */ 1467 function isObject(value) { 1468 var type = typeof value; 1469 return !!value && (type == 'object' || type == 'function'); 1470 } 1471 1472 /** 1473 * Checks if `value` is object-like. A value is object-like if it's not `null` 1474 * and has a `typeof` result of "object". 1475 * 1476 * @static 1477 * @memberOf _ 1478 * @since 4.0.0 1479 * @category Lang 1480 * @param {*} value The value to check. 1481 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 1482 * @example 1483 * 1484 * _.isObjectLike({}); 1485 * // => true 1486 * 1487 * _.isObjectLike([1, 2, 3]); 1488 * // => true 1489 * 1490 * _.isObjectLike(_.noop); 1491 * // => false 1492 * 1493 * _.isObjectLike(null); 1494 * // => false 1495 */ 1496 function isObjectLike(value) { 1497 return !!value && typeof value == 'object'; 1498 } 1499 1500 /** 1501 * Checks if `value` is classified as a `Symbol` primitive or object. 1502 * 1503 * @static 1504 * @memberOf _ 1505 * @since 4.0.0 1506 * @category Lang 1507 * @param {*} value The value to check. 1508 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 1509 * @example 1510 * 1511 * _.isSymbol(Symbol.iterator); 1512 * // => true 1513 * 1514 * _.isSymbol('abc'); 1515 * // => false 1516 */ 1517 function isSymbol(value) { 1518 return typeof value == 'symbol' || 1519 (isObjectLike(value) && objectToString.call(value) == symbolTag); 1520 } 1521 1522 /** 1523 * Converts `value` to a string. An empty string is returned for `null` 1524 * and `undefined` values. The sign of `-0` is preserved. 1525 * 1526 * @static 1527 * @memberOf _ 1528 * @since 4.0.0 1529 * @category Lang 1530 * @param {*} value The value to process. 1531 * @returns {string} Returns the string. 1532 * @example 1533 * 1534 * _.toString(null); 1535 * // => '' 1536 * 1537 * _.toString(-0); 1538 * // => '-0' 1539 * 1540 * _.toString([1, 2, 3]); 1541 * // => '1,2,3' 1542 */ 1543 function toString(value) { 1544 return value == null ? '' : baseToString(value); 1545 } 1546 1547 /** 1548 * Gets the value at `path` of `object`. If the resolved value is 1549 * `undefined`, the `defaultValue` is returned in its place. 1550 * 1551 * @static 1552 * @memberOf _ 1553 * @since 3.7.0 1554 * @category Object 1555 * @param {Object} object The object to query. 1556 * @param {Array|string} path The path of the property to get. 1557 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 1558 * @returns {*} Returns the resolved value. 1559 * @example 1560 * 1561 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 1562 * 1563 * _.get(object, 'a[0].b.c'); 1564 * // => 3 1565 * 1566 * _.get(object, ['a', '0', 'b', 'c']); 1567 * // => 3 1568 * 1569 * _.get(object, 'a.b.c', 'default'); 1570 * // => 'default' 1571 */ 1572 function get(object, path, defaultValue) { 1573 var result = object == null ? undefined : baseGet(object, path); 1574 return result === undefined ? defaultValue : result; 1575 } 1576 1577 module.exports = get; 1578 1579 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 1580 1581/***/ }, 1582/* 4 */ 1583/***/ function(module, exports) { 1584 1585 /* WEBPACK VAR INJECTION */(function(global) {/** 1586 * lodash (Custom Build) <https://lodash.com/> 1587 * Build: `lodash modularize exports="npm" -o ./` 1588 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 1589 * Released under MIT license <https://lodash.com/license> 1590 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 1591 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 1592 */ 1593 1594 /** Used as references for various `Number` constants. */ 1595 var MAX_SAFE_INTEGER = 9007199254740991; 1596 1597 /** `Object#toString` result references. */ 1598 var argsTag = '[object Arguments]', 1599 funcTag = '[object Function]', 1600 genTag = '[object GeneratorFunction]'; 1601 1602 /** Detect free variable `global` from Node.js. */ 1603 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 1604 1605 /** Detect free variable `self`. */ 1606 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 1607 1608 /** Used as a reference to the global object. */ 1609 var root = freeGlobal || freeSelf || Function('return this')(); 1610 1611 /** 1612 * Appends the elements of `values` to `array`. 1613 * 1614 * @private 1615 * @param {Array} array The array to modify. 1616 * @param {Array} values The values to append. 1617 * @returns {Array} Returns `array`. 1618 */ 1619 function arrayPush(array, values) { 1620 var index = -1, 1621 length = values.length, 1622 offset = array.length; 1623 1624 while (++index < length) { 1625 array[offset + index] = values[index]; 1626 } 1627 return array; 1628 } 1629 1630 /** Used for built-in method references. */ 1631 var objectProto = Object.prototype; 1632 1633 /** Used to check objects for own properties. */ 1634 var hasOwnProperty = objectProto.hasOwnProperty; 1635 1636 /** 1637 * Used to resolve the 1638 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 1639 * of values. 1640 */ 1641 var objectToString = objectProto.toString; 1642 1643 /** Built-in value references. */ 1644 var Symbol = root.Symbol, 1645 propertyIsEnumerable = objectProto.propertyIsEnumerable, 1646 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; 1647 1648 /** 1649 * The base implementation of `_.flatten` with support for restricting flattening. 1650 * 1651 * @private 1652 * @param {Array} array The array to flatten. 1653 * @param {number} depth The maximum recursion depth. 1654 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 1655 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 1656 * @param {Array} [result=[]] The initial result value. 1657 * @returns {Array} Returns the new flattened array.
vendor: 4,361 bytes, lines 1658-1837
1658 */ 1659 function baseFlatten(array, depth, predicate, isStrict, result) { 1660 var index = -1, 1661 length = array.length; 1662 1663 predicate || (predicate = isFlattenable); 1664 result || (result = []); 1665 1666 while (++index < length) { 1667 var value = array[index]; 1668 if (depth > 0 && predicate(value)) { 1669 if (depth > 1) { 1670 // Recursively flatten arrays (susceptible to call stack limits). 1671 baseFlatten(value, depth - 1, predicate, isStrict, result); 1672 } else { 1673 arrayPush(result, value); 1674 } 1675 } else if (!isStrict) { 1676 result[result.length] = value; 1677 } 1678 } 1679 return result; 1680 } 1681 1682 /** 1683 * Checks if `value` is a flattenable `arguments` object or array. 1684 * 1685 * @private 1686 * @param {*} value The value to check. 1687 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 1688 */ 1689 function isFlattenable(value) { 1690 return isArray(value) || isArguments(value) || 1691 !!(spreadableSymbol && value && value[spreadableSymbol]); 1692 } 1693 1694 /** 1695 * Flattens `array` a single level deep. 1696 * 1697 * @static 1698 * @memberOf _ 1699 * @since 0.1.0 1700 * @category Array 1701 * @param {Array} array The array to flatten. 1702 * @returns {Array} Returns the new flattened array. 1703 * @example 1704 * 1705 * _.flatten([1, [2, [3, [4]], 5]]); 1706 * // => [1, 2, [3, [4]], 5] 1707 */ 1708 function flatten(array) { 1709 var length = array ? array.length : 0; 1710 return length ? baseFlatten(array, 1) : []; 1711 } 1712 1713 /** 1714 * Checks if `value` is likely an `arguments` object. 1715 * 1716 * @static 1717 * @memberOf _ 1718 * @since 0.1.0 1719 * @category Lang 1720 * @param {*} value The value to check. 1721 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 1722 * else `false`. 1723 * @example 1724 * 1725 * _.isArguments(function() { return arguments; }()); 1726 * // => true 1727 * 1728 * _.isArguments([1, 2, 3]); 1729 * // => false 1730 */ 1731 function isArguments(value) { 1732 // Safari 8.1 makes `arguments.callee` enumerable in strict mode. 1733 return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && 1734 (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); 1735 } 1736 1737 /** 1738 * Checks if `value` is classified as an `Array` object. 1739 * 1740 * @static 1741 * @memberOf _ 1742 * @since 0.1.0 1743 * @category Lang 1744 * @param {*} value The value to check. 1745 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 1746 * @example 1747 * 1748 * _.isArray([1, 2, 3]); 1749 * // => true 1750 * 1751 * _.isArray(document.body.children); 1752 * // => false 1753 * 1754 * _.isArray('abc'); 1755 * // => false 1756 * 1757 * _.isArray(_.noop); 1758 * // => false 1759 */ 1760 var isArray = Array.isArray; 1761 1762 /** 1763 * Checks if `value` is array-like. A value is considered array-like if it's 1764 * not a function and has a `value.length` that's an integer greater than or 1765 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 1766 * 1767 * @static 1768 * @memberOf _ 1769 * @since 4.0.0 1770 * @category Lang 1771 * @param {*} value The value to check. 1772 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 1773 * @example 1774 * 1775 * _.isArrayLike([1, 2, 3]); 1776 * // => true 1777 * 1778 * _.isArrayLike(document.body.children); 1779 * // => true 1780 * 1781 * _.isArrayLike('abc'); 1782 * // => true 1783 * 1784 * _.isArrayLike(_.noop); 1785 * // => false 1786 */ 1787 function isArrayLike(value) { 1788 return value != null && isLength(value.length) && !isFunction(value); 1789 } 1790 1791 /** 1792 * This method is like `_.isArrayLike` except that it also checks if `value` 1793 * is an object. 1794 * 1795 * @static 1796 * @memberOf _ 1797 * @since 4.0.0 1798 * @category Lang 1799 * @param {*} value The value to check. 1800 * @returns {boolean} Returns `true` if `value` is an array-like object, 1801 * else `false`. 1802 * @example 1803 * 1804 * _.isArrayLikeObject([1, 2, 3]); 1805 * // => true 1806 * 1807 * _.isArrayLikeObject(document.body.children); 1808 * // => true 1809 * 1810 * _.isArrayLikeObject('abc'); 1811 * // => false 1812 * 1813 * _.isArrayLikeObject(_.noop); 1814 * // => false 1815 */ 1816 function isArrayLikeObject(value) { 1817 return isObjectLike(value) && isArrayLike(value); 1818 } 1819 1820 /** 1821 * Checks if `value` is classified as a `Function` object. 1822 * 1823 * @static 1824 * @memberOf _ 1825 * @since 0.1.0 1826 * @category Lang 1827 * @param {*} value The value to check. 1828 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 1829 * @example 1830 * 1831 * _.isFunction(_); 1832 * // => true 1833 * 1834 * _.isFunction(/abc/); 1835 * // => false 1836 */ 1837 function isFunction(value) {
vendor: 5,006 bytes, lines 1838-2013
1838 // The use of `Object#toString` avoids issues with the `typeof` operator 1839 // in Safari 8-9 which returns 'object' for typed array and other constructors. 1840 var tag = isObject(value) ? objectToString.call(value) : ''; 1841 return tag == funcTag || tag == genTag; 1842 } 1843 1844 /** 1845 * Checks if `value` is a valid array-like length. 1846 * 1847 * **Note:** This method is loosely based on 1848 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 1849 * 1850 * @static 1851 * @memberOf _ 1852 * @since 4.0.0 1853 * @category Lang 1854 * @param {*} value The value to check. 1855 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 1856 * @example 1857 * 1858 * _.isLength(3); 1859 * // => true 1860 * 1861 * _.isLength(Number.MIN_VALUE); 1862 * // => false 1863 * 1864 * _.isLength(Infinity); 1865 * // => false 1866 * 1867 * _.isLength('3'); 1868 * // => false 1869 */ 1870 function isLength(value) { 1871 return typeof value == 'number' && 1872 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 1873 } 1874 1875 /** 1876 * Checks if `value` is the 1877 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 1878 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 1879 * 1880 * @static 1881 * @memberOf _ 1882 * @since 0.1.0 1883 * @category Lang 1884 * @param {*} value The value to check. 1885 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 1886 * @example 1887 * 1888 * _.isObject({}); 1889 * // => true 1890 * 1891 * _.isObject([1, 2, 3]); 1892 * // => true 1893 * 1894 * _.isObject(_.noop); 1895 * // => true 1896 * 1897 * _.isObject(null); 1898 * // => false 1899 */ 1900 function isObject(value) { 1901 var type = typeof value; 1902 return !!value && (type == 'object' || type == 'function'); 1903 } 1904 1905 /** 1906 * Checks if `value` is object-like. A value is object-like if it's not `null` 1907 * and has a `typeof` result of "object". 1908 * 1909 * @static 1910 * @memberOf _ 1911 * @since 4.0.0 1912 * @category Lang 1913 * @param {*} value The value to check. 1914 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 1915 * @example 1916 * 1917 * _.isObjectLike({}); 1918 * // => true 1919 * 1920 * _.isObjectLike([1, 2, 3]); 1921 * // => true 1922 * 1923 * _.isObjectLike(_.noop); 1924 * // => false 1925 * 1926 * _.isObjectLike(null); 1927 * // => false 1928 */ 1929 function isObjectLike(value) { 1930 return !!value && typeof value == 'object'; 1931 } 1932 1933 module.exports = flatten; 1934 1935 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 1936 1937/***/ }, 1938/* 5 */ 1939/***/ function(module, exports) { 1940 1941 /* WEBPACK VAR INJECTION */(function(global) {/** 1942 * lodash (Custom Build) <https://lodash.com/> 1943 * Build: `lodash modularize exports="npm" -o ./` 1944 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 1945 * Released under MIT license <https://lodash.com/license> 1946 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 1947 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 1948 */ 1949 1950 /** Used as the size to enable large array optimizations. */ 1951 var LARGE_ARRAY_SIZE = 200; 1952 1953 /** Used to stand-in for `undefined` hash values. */ 1954 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 1955 1956 /** Used as references for various `Number` constants. */ 1957 var INFINITY = 1 / 0; 1958 1959 /** `Object#toString` result references. */ 1960 var funcTag = '[object Function]', 1961 genTag = '[object GeneratorFunction]'; 1962 1963 /** 1964 * Used to match `RegExp` 1965 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 1966 */ 1967 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 1968 1969 /** Used to detect host constructors (Safari). */ 1970 var reIsHostCtor = /^\[object .+?Constructor\]$/; 1971 1972 /** Detect free variable `global` from Node.js. */ 1973 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 1974 1975 /** Detect free variable `self`. */ 1976 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 1977 1978 /** Used as a reference to the global object. */ 1979 var root = freeGlobal || freeSelf || Function('return this')(); 1980 1981 /** 1982 * A specialized version of `_.includes` for arrays without support for 1983 * specifying an index to search from. 1984 * 1985 * @private 1986 * @param {Array} [array] The array to inspect. 1987 * @param {*} target The value to search for. 1988 * @returns {boolean} Returns `true` if `target` is found, else `false`. 1989 */ 1990 function arrayIncludes(array, value) { 1991 var length = array ? array.length : 0; 1992 return !!length && baseIndexOf(array, value, 0) > -1; 1993 } 1994 1995 /** 1996 * This function is like `arrayIncludes` except that it accepts a comparator. 1997 * 1998 * @private 1999 * @param {Array} [array] The array to inspect. 2000 * @param {*} target The value to search for. 2001 * @param {Function} comparator The comparator invoked per element. 2002 * @returns {boolean} Returns `true` if `target` is found, else `false`. 2003 */ 2004 function arrayIncludesWith(array, value, comparator) { 2005 var index = -1, 2006 length = array ? array.length : 0; 2007 2008 while (++index < length) { 2009 if (comparator(value, array[index])) { 2010 return true; 2011 } 2012 } 2013 return false;
vendor: 18,943 bytes, lines 2014-2783
2014 } 2015 2016 /** 2017 * The base implementation of `_.findIndex` and `_.findLastIndex` without 2018 * support for iteratee shorthands. 2019 * 2020 * @private 2021 * @param {Array} array The array to inspect. 2022 * @param {Function} predicate The function invoked per iteration. 2023 * @param {number} fromIndex The index to search from. 2024 * @param {boolean} [fromRight] Specify iterating from right to left. 2025 * @returns {number} Returns the index of the matched value, else `-1`. 2026 */ 2027 function baseFindIndex(array, predicate, fromIndex, fromRight) { 2028 var length = array.length, 2029 index = fromIndex + (fromRight ? 1 : -1); 2030 2031 while ((fromRight ? index-- : ++index < length)) { 2032 if (predicate(array[index], index, array)) { 2033 return index; 2034 } 2035 } 2036 return -1; 2037 } 2038 2039 /** 2040 * The base implementation of `_.indexOf` without `fromIndex` bounds checks. 2041 * 2042 * @private 2043 * @param {Array} array The array to inspect. 2044 * @param {*} value The value to search for. 2045 * @param {number} fromIndex The index to search from. 2046 * @returns {number} Returns the index of the matched value, else `-1`. 2047 */ 2048 function baseIndexOf(array, value, fromIndex) { 2049 if (value !== value) { 2050 return baseFindIndex(array, baseIsNaN, fromIndex); 2051 } 2052 var index = fromIndex - 1, 2053 length = array.length; 2054 2055 while (++index < length) { 2056 if (array[index] === value) { 2057 return index; 2058 } 2059 } 2060 return -1; 2061 } 2062 2063 /** 2064 * The base implementation of `_.isNaN` without support for number objects. 2065 * 2066 * @private 2067 * @param {*} value The value to check. 2068 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 2069 */ 2070 function baseIsNaN(value) { 2071 return value !== value; 2072 } 2073 2074 /** 2075 * Checks if a cache value for `key` exists. 2076 * 2077 * @private 2078 * @param {Object} cache The cache to query. 2079 * @param {string} key The key of the entry to check. 2080 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 2081 */ 2082 function cacheHas(cache, key) { 2083 return cache.has(key); 2084 } 2085 2086 /** 2087 * Gets the value at `key` of `object`. 2088 * 2089 * @private 2090 * @param {Object} [object] The object to query. 2091 * @param {string} key The key of the property to get. 2092 * @returns {*} Returns the property value. 2093 */ 2094 function getValue(object, key) { 2095 return object == null ? undefined : object[key]; 2096 } 2097 2098 /** 2099 * Checks if `value` is a host object in IE < 9. 2100 * 2101 * @private 2102 * @param {*} value The value to check. 2103 * @returns {boolean} Returns `true` if `value` is a host object, else `false`. 2104 */ 2105 function isHostObject(value) { 2106 // Many host objects are `Object` objects that can coerce to strings 2107 // despite having improperly defined `toString` methods. 2108 var result = false; 2109 if (value != null && typeof value.toString != 'function') { 2110 try { 2111 result = !!(value + ''); 2112 } catch (e) {} 2113 } 2114 return result; 2115 } 2116 2117 /** 2118 * Converts `set` to an array of its values. 2119 * 2120 * @private 2121 * @param {Object} set The set to convert. 2122 * @returns {Array} Returns the values. 2123 */ 2124 function setToArray(set) { 2125 var index = -1, 2126 result = Array(set.size); 2127 2128 set.forEach(function(value) { 2129 result[++index] = value; 2130 }); 2131 return result; 2132 } 2133 2134 /** Used for built-in method references. */ 2135 var arrayProto = Array.prototype, 2136 funcProto = Function.prototype, 2137 objectProto = Object.prototype; 2138 2139 /** Used to detect overreaching core-js shims. */ 2140 var coreJsData = root['__core-js_shared__']; 2141 2142 /** Used to detect methods masquerading as native. */ 2143 var maskSrcKey = (function() { 2144 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 2145 return uid ? ('Symbol(src)_1.' + uid) : ''; 2146 }()); 2147 2148 /** Used to resolve the decompiled source of functions. */ 2149 var funcToString = funcProto.toString; 2150 2151 /** Used to check objects for own properties. */ 2152 var hasOwnProperty = objectProto.hasOwnProperty; 2153 2154 /** 2155 * Used to resolve the 2156 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 2157 * of values. 2158 */ 2159 var objectToString = objectProto.toString; 2160 2161 /** Used to detect if a method is native. */ 2162 var reIsNative = RegExp('^' + 2163 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 2164 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 2165 ); 2166 2167 /** Built-in value references. */ 2168 var splice = arrayProto.splice; 2169 2170 /* Built-in method references that are verified to be native. */ 2171 var Map = getNative(root, 'Map'), 2172 Set = getNative(root, 'Set'), 2173 nativeCreate = getNative(Object, 'create'); 2174 2175 /** 2176 * Creates a hash object. 2177 * 2178 * @private 2179 * @constructor 2180 * @param {Array} [entries] The key-value pairs to cache. 2181 */ 2182 function Hash(entries) { 2183 var index = -1, 2184 length = entries ? entries.length : 0; 2185 2186 this.clear(); 2187 while (++index < length) { 2188 var entry = entries[index]; 2189 this.set(entry[0], entry[1]); 2190 } 2191 } 2192 2193 /** 2194 * Removes all key-value entries from the hash. 2195 * 2196 * @private 2197 * @name clear 2198 * @memberOf Hash 2199 */ 2200 function hashClear() { 2201 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 2202 } 2203 2204 /** 2205 * Removes `key` and its value from the hash. 2206 * 2207 * @private 2208 * @name delete 2209 * @memberOf Hash 2210 * @param {Object} hash The hash to modify. 2211 * @param {string} key The key of the value to remove. 2212 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 2213 */ 2214 function hashDelete(key) { 2215 return this.has(key) && delete this.__data__[key]; 2216 } 2217 2218 /** 2219 * Gets the hash value for `key`. 2220 * 2221 * @private 2222 * @name get 2223 * @memberOf Hash 2224 * @param {string} key The key of the value to get. 2225 * @returns {*} Returns the entry value. 2226 */ 2227 function hashGet(key) { 2228 var data = this.__data__; 2229 if (nativeCreate) { 2230 var result = data[key]; 2231 return result === HASH_UNDEFINED ? undefined : result; 2232 } 2233 return hasOwnProperty.call(data, key) ? data[key] : undefined; 2234 } 2235 2236 /** 2237 * Checks if a hash value for `key` exists. 2238 * 2239 * @private 2240 * @name has 2241 * @memberOf Hash 2242 * @param {string} key The key of the entry to check. 2243 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 2244 */ 2245 function hashHas(key) { 2246 var data = this.__data__; 2247 return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); 2248 } 2249 2250 /** 2251 * Sets the hash `key` to `value`. 2252 * 2253 * @private 2254 * @name set 2255 * @memberOf Hash 2256 * @param {string} key The key of the value to set. 2257 * @param {*} value The value to set. 2258 * @returns {Object} Returns the hash instance. 2259 */ 2260 function hashSet(key, value) { 2261 var data = this.__data__; 2262 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; 2263 return this; 2264 } 2265 2266 // Add methods to `Hash`. 2267 Hash.prototype.clear = hashClear; 2268 Hash.prototype['delete'] = hashDelete; 2269 Hash.prototype.get = hashGet; 2270 Hash.prototype.has = hashHas; 2271 Hash.prototype.set = hashSet; 2272 2273 /** 2274 * Creates an list cache object. 2275 * 2276 * @private 2277 * @constructor 2278 * @param {Array} [entries] The key-value pairs to cache. 2279 */ 2280 function ListCache(entries) { 2281 var index = -1, 2282 length = entries ? entries.length : 0; 2283 2284 this.clear(); 2285 while (++index < length) { 2286 var entry = entries[index]; 2287 this.set(entry[0], entry[1]); 2288 } 2289 } 2290 2291 /** 2292 * Removes all key-value entries from the list cache. 2293 * 2294 * @private 2295 * @name clear 2296 * @memberOf ListCache 2297 */ 2298 function listCacheClear() { 2299 this.__data__ = []; 2300 } 2301 2302 /** 2303 * Removes `key` and its value from the list cache. 2304 * 2305 * @private 2306 * @name delete 2307 * @memberOf ListCache 2308 * @param {string} key The key of the value to remove. 2309 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 2310 */ 2311 function listCacheDelete(key) { 2312 var data = this.__data__, 2313 index = assocIndexOf(data, key); 2314 2315 if (index < 0) { 2316 return false; 2317 } 2318 var lastIndex = data.length - 1; 2319 if (index == lastIndex) { 2320 data.pop(); 2321 } else { 2322 splice.call(data, index, 1); 2323 } 2324 return true; 2325 } 2326 2327 /** 2328 * Gets the list cache value for `key`. 2329 * 2330 * @private 2331 * @name get 2332 * @memberOf ListCache 2333 * @param {string} key The key of the value to get. 2334 * @returns {*} Returns the entry value. 2335 */ 2336 function listCacheGet(key) { 2337 var data = this.__data__, 2338 index = assocIndexOf(data, key); 2339 2340 return index < 0 ? undefined : data[index][1]; 2341 } 2342 2343 /** 2344 * Checks if a list cache value for `key` exists. 2345 * 2346 * @private 2347 * @name has 2348 * @memberOf ListCache 2349 * @param {string} key The key of the entry to check. 2350 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 2351 */ 2352 function listCacheHas(key) { 2353 return assocIndexOf(this.__data__, key) > -1; 2354 } 2355 2356 /** 2357 * Sets the list cache `key` to `value`. 2358 * 2359 * @private 2360 * @name set 2361 * @memberOf ListCache 2362 * @param {string} key The key of the value to set. 2363 * @param {*} value The value to set. 2364 * @returns {Object} Returns the list cache instance. 2365 */ 2366 function listCacheSet(key, value) { 2367 var data = this.__data__, 2368 index = assocIndexOf(data, key); 2369 2370 if (index < 0) { 2371 data.push([key, value]); 2372 } else { 2373 data[index][1] = value; 2374 } 2375 return this; 2376 } 2377 2378 // Add methods to `ListCache`. 2379 ListCache.prototype.clear = listCacheClear; 2380 ListCache.prototype['delete'] = listCacheDelete; 2381 ListCache.prototype.get = listCacheGet; 2382 ListCache.prototype.has = listCacheHas; 2383 ListCache.prototype.set = listCacheSet; 2384 2385 /** 2386 * Creates a map cache object to store key-value pairs. 2387 * 2388 * @private 2389 * @constructor 2390 * @param {Array} [entries] The key-value pairs to cache. 2391 */ 2392 function MapCache(entries) { 2393 var index = -1, 2394 length = entries ? entries.length : 0; 2395 2396 this.clear(); 2397 while (++index < length) { 2398 var entry = entries[index]; 2399 this.set(entry[0], entry[1]); 2400 } 2401 } 2402 2403 /** 2404 * Removes all key-value entries from the map. 2405 * 2406 * @private 2407 * @name clear 2408 * @memberOf MapCache 2409 */ 2410 function mapCacheClear() { 2411 this.__data__ = { 2412 'hash': new Hash, 2413 'map': new (Map || ListCache), 2414 'string': new Hash 2415 }; 2416 } 2417 2418 /** 2419 * Removes `key` and its value from the map. 2420 * 2421 * @private 2422 * @name delete 2423 * @memberOf MapCache 2424 * @param {string} key The key of the value to remove. 2425 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 2426 */ 2427 function mapCacheDelete(key) { 2428 return getMapData(this, key)['delete'](key); 2429 } 2430 2431 /** 2432 * Gets the map value for `key`. 2433 * 2434 * @private 2435 * @name get 2436 * @memberOf MapCache 2437 * @param {string} key The key of the value to get. 2438 * @returns {*} Returns the entry value. 2439 */ 2440 function mapCacheGet(key) { 2441 return getMapData(this, key).get(key); 2442 } 2443 2444 /** 2445 * Checks if a map value for `key` exists. 2446 * 2447 * @private 2448 * @name has 2449 * @memberOf MapCache 2450 * @param {string} key The key of the entry to check. 2451 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 2452 */ 2453 function mapCacheHas(key) { 2454 return getMapData(this, key).has(key); 2455 } 2456 2457 /** 2458 * Sets the map `key` to `value`. 2459 * 2460 * @private 2461 * @name set 2462 * @memberOf MapCache 2463 * @param {string} key The key of the value to set. 2464 * @param {*} value The value to set. 2465 * @returns {Object} Returns the map cache instance. 2466 */ 2467 function mapCacheSet(key, value) { 2468 getMapData(this, key).set(key, value); 2469 return this; 2470 } 2471 2472 // Add methods to `MapCache`. 2473 MapCache.prototype.clear = mapCacheClear; 2474 MapCache.prototype['delete'] = mapCacheDelete; 2475 MapCache.prototype.get = mapCacheGet; 2476 MapCache.prototype.has = mapCacheHas; 2477 MapCache.prototype.set = mapCacheSet; 2478 2479 /** 2480 * 2481 * Creates an array cache object to store unique values. 2482 * 2483 * @private 2484 * @constructor 2485 * @param {Array} [values] The values to cache. 2486 */ 2487 function SetCache(values) { 2488 var index = -1, 2489 length = values ? values.length : 0; 2490 2491 this.__data__ = new MapCache; 2492 while (++index < length) { 2493 this.add(values[index]); 2494 } 2495 } 2496 2497 /** 2498 * Adds `value` to the array cache. 2499 * 2500 * @private 2501 * @name add 2502 * @memberOf SetCache 2503 * @alias push 2504 * @param {*} value The value to cache. 2505 * @returns {Object} Returns the cache instance. 2506 */ 2507 function setCacheAdd(value) { 2508 this.__data__.set(value, HASH_UNDEFINED); 2509 return this; 2510 } 2511 2512 /** 2513 * Checks if `value` is in the array cache. 2514 * 2515 * @private 2516 * @name has 2517 * @memberOf SetCache 2518 * @param {*} value The value to search for. 2519 * @returns {number} Returns `true` if `value` is found, else `false`. 2520 */ 2521 function setCacheHas(value) { 2522 return this.__data__.has(value); 2523 } 2524 2525 // Add methods to `SetCache`. 2526 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 2527 SetCache.prototype.has = setCacheHas; 2528 2529 /** 2530 * Gets the index at which the `key` is found in `array` of key-value pairs. 2531 * 2532 * @private 2533 * @param {Array} array The array to inspect. 2534 * @param {*} key The key to search for. 2535 * @returns {number} Returns the index of the matched value, else `-1`. 2536 */ 2537 function assocIndexOf(array, key) { 2538 var length = array.length; 2539 while (length--) { 2540 if (eq(array[length][0], key)) { 2541 return length; 2542 } 2543 } 2544 return -1; 2545 } 2546 2547 /** 2548 * The base implementation of `_.isNative` without bad shim checks. 2549 * 2550 * @private 2551 * @param {*} value The value to check. 2552 * @returns {boolean} Returns `true` if `value` is a native function, 2553 * else `false`. 2554 */ 2555 function baseIsNative(value) { 2556 if (!isObject(value) || isMasked(value)) { 2557 return false; 2558 } 2559 var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; 2560 return pattern.test(toSource(value)); 2561 } 2562 2563 /** 2564 * The base implementation of `_.uniqBy` without support for iteratee shorthands. 2565 * 2566 * @private 2567 * @param {Array} array The array to inspect. 2568 * @param {Function} [iteratee] The iteratee invoked per element. 2569 * @param {Function} [comparator] The comparator invoked per element. 2570 * @returns {Array} Returns the new duplicate free array. 2571 */ 2572 function baseUniq(array, iteratee, comparator) { 2573 var index = -1, 2574 includes = arrayIncludes, 2575 length = array.length, 2576 isCommon = true, 2577 result = [], 2578 seen = result; 2579 2580 if (comparator) { 2581 isCommon = false; 2582 includes = arrayIncludesWith; 2583 } 2584 else if (length >= LARGE_ARRAY_SIZE) { 2585 var set = iteratee ? null : createSet(array); 2586 if (set) { 2587 return setToArray(set); 2588 } 2589 isCommon = false; 2590 includes = cacheHas; 2591 seen = new SetCache; 2592 } 2593 else { 2594 seen = iteratee ? [] : result; 2595 } 2596 outer: 2597 while (++index < length) { 2598 var value = array[index], 2599 computed = iteratee ? iteratee(value) : value; 2600 2601 value = (comparator || value !== 0) ? value : 0; 2602 if (isCommon && computed === computed) { 2603 var seenIndex = seen.length; 2604 while (seenIndex--) { 2605 if (seen[seenIndex] === computed) { 2606 continue outer; 2607 } 2608 } 2609 if (iteratee) { 2610 seen.push(computed); 2611 } 2612 result.push(value); 2613 } 2614 else if (!includes(seen, computed, comparator)) { 2615 if (seen !== result) { 2616 seen.push(computed); 2617 } 2618 result.push(value); 2619 } 2620 } 2621 return result; 2622 } 2623 2624 /** 2625 * Creates a set object of `values`. 2626 * 2627 * @private 2628 * @param {Array} values The values to add to the set. 2629 * @returns {Object} Returns the new set. 2630 */ 2631 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { 2632 return new Set(values); 2633 }; 2634 2635 /** 2636 * Gets the data for `map`. 2637 * 2638 * @private 2639 * @param {Object} map The map to query. 2640 * @param {string} key The reference key. 2641 * @returns {*} Returns the map data. 2642 */ 2643 function getMapData(map, key) { 2644 var data = map.__data__; 2645 return isKeyable(key) 2646 ? data[typeof key == 'string' ? 'string' : 'hash'] 2647 : data.map; 2648 } 2649 2650 /** 2651 * Gets the native function at `key` of `object`. 2652 * 2653 * @private 2654 * @param {Object} object The object to query. 2655 * @param {string} key The key of the method to get. 2656 * @returns {*} Returns the function if it's native, else `undefined`. 2657 */ 2658 function getNative(object, key) { 2659 var value = getValue(object, key); 2660 return baseIsNative(value) ? value : undefined; 2661 } 2662 2663 /** 2664 * Checks if `value` is suitable for use as unique object key. 2665 * 2666 * @private 2667 * @param {*} value The value to check. 2668 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 2669 */ 2670 function isKeyable(value) { 2671 var type = typeof value; 2672 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') 2673 ? (value !== '__proto__') 2674 : (value === null); 2675 } 2676 2677 /** 2678 * Checks if `func` has its source masked. 2679 * 2680 * @private 2681 * @param {Function} func The function to check. 2682 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 2683 */ 2684 function isMasked(func) { 2685 return !!maskSrcKey && (maskSrcKey in func); 2686 } 2687 2688 /** 2689 * Converts `func` to its source code. 2690 * 2691 * @private 2692 * @param {Function} func The function to process. 2693 * @returns {string} Returns the source code. 2694 */ 2695 function toSource(func) { 2696 if (func != null) { 2697 try { 2698 return funcToString.call(func); 2699 } catch (e) {} 2700 try { 2701 return (func + ''); 2702 } catch (e) {} 2703 } 2704 return ''; 2705 } 2706 2707 /** 2708 * Creates a duplicate-free version of an array, using 2709 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 2710 * for equality comparisons, in which only the first occurrence of each 2711 * element is kept. 2712 * 2713 * @static 2714 * @memberOf _ 2715 * @since 0.1.0 2716 * @category Array 2717 * @param {Array} array The array to inspect. 2718 * @returns {Array} Returns the new duplicate free array. 2719 * @example 2720 * 2721 * _.uniq([2, 1, 2]); 2722 * // => [2, 1] 2723 */ 2724 function uniq(array) { 2725 return (array && array.length) 2726 ? baseUniq(array) 2727 : []; 2728 } 2729 2730 /** 2731 * Performs a 2732 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 2733 * comparison between two values to determine if they are equivalent. 2734 * 2735 * @static 2736 * @memberOf _ 2737 * @since 4.0.0 2738 * @category Lang 2739 * @param {*} value The value to compare. 2740 * @param {*} other The other value to compare. 2741 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 2742 * @example 2743 * 2744 * var object = { 'a': 1 }; 2745 * var other = { 'a': 1 }; 2746 * 2747 * _.eq(object, object); 2748 * // => true 2749 * 2750 * _.eq(object, other); 2751 * // => false 2752 * 2753 * _.eq('a', 'a'); 2754 * // => true 2755 * 2756 * _.eq('a', Object('a')); 2757 * // => false 2758 * 2759 * _.eq(NaN, NaN); 2760 * // => true 2761 */ 2762 function eq(value, other) { 2763 return value === other || (value !== value && other !== other); 2764 } 2765 2766 /** 2767 * Checks if `value` is classified as a `Function` object. 2768 * 2769 * @static 2770 * @memberOf _ 2771 * @since 0.1.0 2772 * @category Lang 2773 * @param {*} value The value to check. 2774 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 2775 * @example 2776 * 2777 * _.isFunction(_); 2778 * // => true 2779 * 2780 * _.isFunction(/abc/); 2781 * // => false 2782 */ 2783 function isFunction(value) {
2784 // The use of `Object#toString` avoids issues with the `typeof` operator 2785 // in Safari 8-9 which returns 'object' for typed array and other constructors. 2786 var tag = isObject(value) ? objectToString.call(value) : ''; 2787 return tag == funcTag || tag == genTag; 2788 } 2789 2790 /** 2791 * Checks if `value` is the 2792 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 2793 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 2794 * 2795 * @static 2796 * @memberOf _ 2797 * @since 0.1.0 2798 * @category Lang 2799 * @param {*} value The value to check. 2800 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 2801 * @example 2802 * 2803 * _.isObject({}); 2804 * // => true 2805 * 2806 * _.isObject([1, 2, 3]); 2807 * // => true 2808 * 2809 * _.isObject(_.noop); 2810 * // => true 2811 * 2812 * _.isObject(null); 2813 * // => false 2814 */ 2815 function isObject(value) { 2816 var type = typeof value; 2817 return !!value && (type == 'object' || type == 'function'); 2818 } 2819 2820 /** 2821 * This method returns `undefined`. 2822 * 2823 * @static 2824 * @memberOf _ 2825 * @since 2.3.0 2826 * @category Util 2827 * @example 2828 * 2829 * _.times(2, _.noop); 2830 * // => [undefined, undefined] 2831 */ 2832 function noop() { 2833 // No operation performed. 2834 } 2835 2836 module.exports = uniq; 2837 2838 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 2839 2840/***/ }, 2841/* 6 */ 2842/***/ function(module, exports) { 2843 2844 /* WEBPACK VAR INJECTION */(function(global) {/** 2845 * lodash (Custom Build) <https://lodash.com/> 2846 * Build: `lodash modularize exports="npm" -o ./` 2847 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 2848 * Released under MIT license <https://lodash.com/license> 2849 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 2850 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 2851 */ 2852 2853 /** Used as the `TypeError` message for "Functions" methods. */ 2854 var FUNC_ERROR_TEXT = 'Expected a function'; 2855 2856 /** Used to stand-in for `undefined` hash values. */ 2857 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 2858 2859 /** Used as references for various `Number` constants. */ 2860 var INFINITY = 1 / 0, 2861 MAX_SAFE_INTEGER = 9007199254740991; 2862 2863 /** `Object#toString` result references. */ 2864 var funcTag = '[object Function]', 2865 genTag = '[object GeneratorFunction]', 2866 symbolTag = '[object Symbol]'; 2867 2868 /** Used to match property names within property paths. */ 2869 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, 2870 reIsPlainProp = /^\w*$/, 2871 reLeadingDot = /^\./, 2872 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 2873 2874 /** 2875 * Used to match `RegExp` 2876 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 2877 */ 2878 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 2879 2880 /** Used to match backslashes in property paths. */ 2881 var reEscapeChar = /\\(\\)?/g; 2882 2883 /** Used to detect host constructors (Safari). */ 2884 var reIsHostCtor = /^\[object .+?Constructor\]$/; 2885 2886 /** Used to detect unsigned integer values. */ 2887 var reIsUint = /^(?:0|[1-9]\d*)$/; 2888 2889 /** Detect free variable `global` from Node.js. */ 2890 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 2891 2892 /** Detect free variable `self`. */ 2893 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 2894 2895 /** Used as a reference to the global object. */ 2896 var root = freeGlobal || freeSelf || Function('return this')(); 2897 2898 /** 2899 * Gets the value at `key` of `object`. 2900 * 2901 * @private 2902 * @param {Object} [object] The object to query. 2903 * @param {string} key The key of the property to get. 2904 * @returns {*} Returns the property value. 2905 */ 2906 function getValue(object, key) { 2907 return object == null ? undefined : object[key]; 2908 } 2909 2910 /** 2911 * Checks if `value` is a host object in IE < 9. 2912 * 2913 * @private 2914 * @param {*} value The value to check. 2915 * @returns {boolean} Returns `true` if `value` is a host object, else `false`. 2916 */ 2917 function isHostObject(value) { 2918 // Many host objects are `Object` objects that can coerce to strings 2919 // despite having improperly defined `toString` methods. 2920 var result = false;
vendor: 4,385 bytes, lines 2921-3089
2921 if (value != null && typeof value.toString != 'function') { 2922 try { 2923 result = !!(value + ''); 2924 } catch (e) {} 2925 } 2926 return result; 2927 } 2928 2929 /** Used for built-in method references. */ 2930 var arrayProto = Array.prototype, 2931 funcProto = Function.prototype, 2932 objectProto = Object.prototype; 2933 2934 /** Used to detect overreaching core-js shims. */ 2935 var coreJsData = root['__core-js_shared__']; 2936 2937 /** Used to detect methods masquerading as native. */ 2938 var maskSrcKey = (function() { 2939 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 2940 return uid ? ('Symbol(src)_1.' + uid) : ''; 2941 }()); 2942 2943 /** Used to resolve the decompiled source of functions. */ 2944 var funcToString = funcProto.toString; 2945 2946 /** Used to check objects for own properties. */ 2947 var hasOwnProperty = objectProto.hasOwnProperty; 2948 2949 /** 2950 * Used to resolve the 2951 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 2952 * of values. 2953 */ 2954 var objectToString = objectProto.toString; 2955 2956 /** Used to detect if a method is native. */ 2957 var reIsNative = RegExp('^' + 2958 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 2959 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 2960 ); 2961 2962 /** Built-in value references. */ 2963 var Symbol = root.Symbol, 2964 splice = arrayProto.splice; 2965 2966 /* Built-in method references that are verified to be native. */ 2967 var Map = getNative(root, 'Map'), 2968 nativeCreate = getNative(Object, 'create'); 2969 2970 /** Used to convert symbols to primitives and strings. */ 2971 var symbolProto = Symbol ? Symbol.prototype : undefined, 2972 symbolToString = symbolProto ? symbolProto.toString : undefined; 2973 2974 /** 2975 * Creates a hash object. 2976 * 2977 * @private 2978 * @constructor 2979 * @param {Array} [entries] The key-value pairs to cache. 2980 */ 2981 function Hash(entries) { 2982 var index = -1, 2983 length = entries ? entries.length : 0; 2984 2985 this.clear(); 2986 while (++index < length) { 2987 var entry = entries[index]; 2988 this.set(entry[0], entry[1]); 2989 } 2990 } 2991 2992 /** 2993 * Removes all key-value entries from the hash. 2994 * 2995 * @private 2996 * @name clear 2997 * @memberOf Hash 2998 */ 2999 function hashClear() { 3000 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 3001 } 3002 3003 /** 3004 * Removes `key` and its value from the hash. 3005 * 3006 * @private 3007 * @name delete 3008 * @memberOf Hash 3009 * @param {Object} hash The hash to modify. 3010 * @param {string} key The key of the value to remove. 3011 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 3012 */ 3013 function hashDelete(key) { 3014 return this.has(key) && delete this.__data__[key]; 3015 } 3016 3017 /** 3018 * Gets the hash value for `key`. 3019 * 3020 * @private 3021 * @name get 3022 * @memberOf Hash 3023 * @param {string} key The key of the value to get. 3024 * @returns {*} Returns the entry value. 3025 */ 3026 function hashGet(key) { 3027 var data = this.__data__; 3028 if (nativeCreate) { 3029 var result = data[key]; 3030 return result === HASH_UNDEFINED ? undefined : result; 3031 } 3032 return hasOwnProperty.call(data, key) ? data[key] : undefined; 3033 } 3034 3035 /** 3036 * Checks if a hash value for `key` exists. 3037 * 3038 * @private 3039 * @name has 3040 * @memberOf Hash 3041 * @param {string} key The key of the entry to check. 3042 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 3043 */ 3044 function hashHas(key) { 3045 var data = this.__data__; 3046 return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); 3047 } 3048 3049 /** 3050 * Sets the hash `key` to `value`. 3051 * 3052 * @private 3053 * @name set 3054 * @memberOf Hash 3055 * @param {string} key The key of the value to set. 3056 * @param {*} value The value to set. 3057 * @returns {Object} Returns the hash instance. 3058 */ 3059 function hashSet(key, value) { 3060 var data = this.__data__; 3061 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; 3062 return this; 3063 } 3064 3065 // Add methods to `Hash`. 3066 Hash.prototype.clear = hashClear; 3067 Hash.prototype['delete'] = hashDelete; 3068 Hash.prototype.get = hashGet; 3069 Hash.prototype.has = hashHas; 3070 Hash.prototype.set = hashSet; 3071 3072 /** 3073 * Creates an list cache object. 3074 * 3075 * @private 3076 * @constructor 3077 * @param {Array} [entries] The key-value pairs to cache. 3078 */ 3079 function ListCache(entries) { 3080 var index = -1, 3081 length = entries ? entries.length : 0; 3082 3083 this.clear(); 3084 while (++index < length) { 3085 var entry = entries[index]; 3086 this.set(entry[0], entry[1]); 3087 } 3088 } 3089
vendor: 9,364 bytes, lines 3090-3454
3090 /** 3091 * Removes all key-value entries from the list cache. 3092 * 3093 * @private 3094 * @name clear 3095 * @memberOf ListCache 3096 */ 3097 function listCacheClear() { 3098 this.__data__ = []; 3099 } 3100 3101 /** 3102 * Removes `key` and its value from the list cache. 3103 * 3104 * @private 3105 * @name delete 3106 * @memberOf ListCache 3107 * @param {string} key The key of the value to remove. 3108 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 3109 */ 3110 function listCacheDelete(key) { 3111 var data = this.__data__, 3112 index = assocIndexOf(data, key); 3113 3114 if (index < 0) { 3115 return false; 3116 } 3117 var lastIndex = data.length - 1; 3118 if (index == lastIndex) { 3119 data.pop(); 3120 } else { 3121 splice.call(data, index, 1); 3122 } 3123 return true; 3124 } 3125 3126 /** 3127 * Gets the list cache value for `key`. 3128 * 3129 * @private 3130 * @name get 3131 * @memberOf ListCache 3132 * @param {string} key The key of the value to get. 3133 * @returns {*} Returns the entry value. 3134 */ 3135 function listCacheGet(key) { 3136 var data = this.__data__, 3137 index = assocIndexOf(data, key); 3138 3139 return index < 0 ? undefined : data[index][1]; 3140 } 3141 3142 /** 3143 * Checks if a list cache value for `key` exists. 3144 * 3145 * @private 3146 * @name has 3147 * @memberOf ListCache 3148 * @param {string} key The key of the entry to check. 3149 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 3150 */ 3151 function listCacheHas(key) { 3152 return assocIndexOf(this.__data__, key) > -1; 3153 } 3154 3155 /** 3156 * Sets the list cache `key` to `value`. 3157 * 3158 * @private 3159 * @name set 3160 * @memberOf ListCache 3161 * @param {string} key The key of the value to set. 3162 * @param {*} value The value to set. 3163 * @returns {Object} Returns the list cache instance. 3164 */ 3165 function listCacheSet(key, value) { 3166 var data = this.__data__, 3167 index = assocIndexOf(data, key); 3168 3169 if (index < 0) { 3170 data.push([key, value]); 3171 } else { 3172 data[index][1] = value; 3173 } 3174 return this; 3175 } 3176 3177 // Add methods to `ListCache`. 3178 ListCache.prototype.clear = listCacheClear; 3179 ListCache.prototype['delete'] = listCacheDelete; 3180 ListCache.prototype.get = listCacheGet; 3181 ListCache.prototype.has = listCacheHas; 3182 ListCache.prototype.set = listCacheSet; 3183 3184 /** 3185 * Creates a map cache object to store key-value pairs. 3186 * 3187 * @private 3188 * @constructor 3189 * @param {Array} [entries] The key-value pairs to cache. 3190 */ 3191 function MapCache(entries) { 3192 var index = -1, 3193 length = entries ? entries.length : 0; 3194 3195 this.clear(); 3196 while (++index < length) { 3197 var entry = entries[index]; 3198 this.set(entry[0], entry[1]); 3199 } 3200 } 3201 3202 /** 3203 * Removes all key-value entries from the map. 3204 * 3205 * @private 3206 * @name clear 3207 * @memberOf MapCache 3208 */ 3209 function mapCacheClear() { 3210 this.__data__ = { 3211 'hash': new Hash, 3212 'map': new (Map || ListCache), 3213 'string': new Hash 3214 }; 3215 } 3216 3217 /** 3218 * Removes `key` and its value from the map. 3219 * 3220 * @private 3221 * @name delete 3222 * @memberOf MapCache 3223 * @param {string} key The key of the value to remove. 3224 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 3225 */ 3226 function mapCacheDelete(key) { 3227 return getMapData(this, key)['delete'](key); 3228 } 3229 3230 /** 3231 * Gets the map value for `key`. 3232 * 3233 * @private 3234 * @name get 3235 * @memberOf MapCache 3236 * @param {string} key The key of the value to get. 3237 * @returns {*} Returns the entry value. 3238 */ 3239 function mapCacheGet(key) { 3240 return getMapData(this, key).get(key); 3241 } 3242 3243 /** 3244 * Checks if a map value for `key` exists. 3245 * 3246 * @private 3247 * @name has 3248 * @memberOf MapCache 3249 * @param {string} key The key of the entry to check. 3250 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 3251 */ 3252 function mapCacheHas(key) { 3253 return getMapData(this, key).has(key); 3254 } 3255 3256 /** 3257 * Sets the map `key` to `value`. 3258 * 3259 * @private 3260 * @name set 3261 * @memberOf MapCache 3262 * @param {string} key The key of the value to set. 3263 * @param {*} value The value to set. 3264 * @returns {Object} Returns the map cache instance. 3265 */ 3266 function mapCacheSet(key, value) { 3267 getMapData(this, key).set(key, value); 3268 return this; 3269 } 3270 3271 // Add methods to `MapCache`. 3272 MapCache.prototype.clear = mapCacheClear; 3273 MapCache.prototype['delete'] = mapCacheDelete; 3274 MapCache.prototype.get = mapCacheGet; 3275 MapCache.prototype.has = mapCacheHas; 3276 MapCache.prototype.set = mapCacheSet; 3277 3278 /** 3279 * Assigns `value` to `key` of `object` if the existing value is not equivalent 3280 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 3281 * for equality comparisons. 3282 * 3283 * @private 3284 * @param {Object} object The object to modify. 3285 * @param {string} key The key of the property to assign. 3286 * @param {*} value The value to assign. 3287 */ 3288 function assignValue(object, key, value) { 3289 var objValue = object[key]; 3290 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || 3291 (value === undefined && !(key in object))) { 3292 object[key] = value; 3293 } 3294 } 3295 3296 /** 3297 * Gets the index at which the `key` is found in `array` of key-value pairs. 3298 * 3299 * @private 3300 * @param {Array} array The array to inspect. 3301 * @param {*} key The key to search for. 3302 * @returns {number} Returns the index of the matched value, else `-1`. 3303 */ 3304 function assocIndexOf(array, key) { 3305 var length = array.length; 3306 while (length--) { 3307 if (eq(array[length][0], key)) { 3308 return length; 3309 } 3310 } 3311 return -1; 3312 } 3313 3314 /** 3315 * The base implementation of `_.isNative` without bad shim checks. 3316 * 3317 * @private 3318 * @param {*} value The value to check. 3319 * @returns {boolean} Returns `true` if `value` is a native function, 3320 * else `false`. 3321 */ 3322 function baseIsNative(value) { 3323 if (!isObject(value) || isMasked(value)) { 3324 return false; 3325 } 3326 var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; 3327 return pattern.test(toSource(value)); 3328 } 3329 3330 /** 3331 * The base implementation of `_.set`. 3332 * 3333 * @private 3334 * @param {Object} object The object to modify. 3335 * @param {Array|string} path The path of the property to set. 3336 * @param {*} value The value to set. 3337 * @param {Function} [customizer] The function to customize path creation. 3338 * @returns {Object} Returns `object`. 3339 */ 3340 function baseSet(object, path, value, customizer) { 3341 if (!isObject(object)) { 3342 return object; 3343 } 3344 path = isKey(path, object) ? [path] : castPath(path); 3345 3346 var index = -1, 3347 length = path.length, 3348 lastIndex = length - 1, 3349 nested = object; 3350 3351 while (nested != null && ++index < length) { 3352 var key = toKey(path[index]), 3353 newValue = value; 3354 3355 if (index != lastIndex) { 3356 var objValue = nested[key]; 3357 newValue = customizer ? customizer(objValue, key, nested) : undefined; 3358 if (newValue === undefined) { 3359 newValue = isObject(objValue) 3360 ? objValue 3361 : (isIndex(path[index + 1]) ? [] : {}); 3362 } 3363 } 3364 assignValue(nested, key, newValue); 3365 nested = nested[key]; 3366 } 3367 return object; 3368 } 3369 3370 /** 3371 * The base implementation of `_.toString` which doesn't convert nullish 3372 * values to empty strings. 3373 * 3374 * @private 3375 * @param {*} value The value to process. 3376 * @returns {string} Returns the string. 3377 */ 3378 function baseToString(value) { 3379 // Exit early for strings to avoid a performance hit in some environments. 3380 if (typeof value == 'string') { 3381 return value; 3382 } 3383 if (isSymbol(value)) { 3384 return symbolToString ? symbolToString.call(value) : ''; 3385 } 3386 var result = (value + ''); 3387 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 3388 } 3389 3390 /** 3391 * Casts `value` to a path array if it's not one. 3392 * 3393 * @private 3394 * @param {*} value The value to inspect. 3395 * @returns {Array} Returns the cast property path array. 3396 */ 3397 function castPath(value) { 3398 return isArray(value) ? value : stringToPath(value); 3399 } 3400 3401 /** 3402 * Gets the data for `map`. 3403 * 3404 * @private 3405 * @param {Object} map The map to query. 3406 * @param {string} key The reference key. 3407 * @returns {*} Returns the map data. 3408 */ 3409 function getMapData(map, key) { 3410 var data = map.__data__; 3411 return isKeyable(key) 3412 ? data[typeof key == 'string' ? 'string' : 'hash'] 3413 : data.map; 3414 } 3415 3416 /** 3417 * Gets the native function at `key` of `object`. 3418 * 3419 * @private 3420 * @param {Object} object The object to query. 3421 * @param {string} key The key of the method to get. 3422 * @returns {*} Returns the function if it's native, else `undefined`. 3423 */ 3424 function getNative(object, key) { 3425 var value = getValue(object, key); 3426 return baseIsNative(value) ? value : undefined; 3427 } 3428 3429 /** 3430 * Checks if `value` is a valid array-like index. 3431 * 3432 * @private 3433 * @param {*} value The value to check. 3434 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 3435 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 3436 */ 3437 function isIndex(value, length) { 3438 length = length == null ? MAX_SAFE_INTEGER : length; 3439 return !!length && 3440 (typeof value == 'number' || reIsUint.test(value)) && 3441 (value > -1 && value % 1 == 0 && value < length); 3442 } 3443 3444 /** 3445 * Checks if `value` is a property name and not a property path. 3446 * 3447 * @private 3448 * @param {*} value The value to check. 3449 * @param {Object} [object] The object to query keys on. 3450 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 3451 */ 3452 function isKey(value, object) { 3453 if (isArray(value)) { 3454 return false;
vendor: 6,073 bytes, lines 3455-3689
3455 } 3456 var type = typeof value; 3457 if (type == 'number' || type == 'symbol' || type == 'boolean' || 3458 value == null || isSymbol(value)) { 3459 return true; 3460 } 3461 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || 3462 (object != null && value in Object(object)); 3463 } 3464 3465 /** 3466 * Checks if `value` is suitable for use as unique object key. 3467 * 3468 * @private 3469 * @param {*} value The value to check. 3470 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 3471 */ 3472 function isKeyable(value) { 3473 var type = typeof value; 3474 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') 3475 ? (value !== '__proto__') 3476 : (value === null); 3477 } 3478 3479 /** 3480 * Checks if `func` has its source masked. 3481 * 3482 * @private 3483 * @param {Function} func The function to check. 3484 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 3485 */ 3486 function isMasked(func) { 3487 return !!maskSrcKey && (maskSrcKey in func); 3488 } 3489 3490 /** 3491 * Converts `string` to a property path array. 3492 * 3493 * @private 3494 * @param {string} string The string to convert. 3495 * @returns {Array} Returns the property path array. 3496 */ 3497 var stringToPath = memoize(function(string) { 3498 string = toString(string); 3499 3500 var result = []; 3501 if (reLeadingDot.test(string)) { 3502 result.push(''); 3503 } 3504 string.replace(rePropName, function(match, number, quote, string) { 3505 result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); 3506 }); 3507 return result; 3508 }); 3509 3510 /** 3511 * Converts `value` to a string key if it's not a string or symbol. 3512 * 3513 * @private 3514 * @param {*} value The value to inspect. 3515 * @returns {string|symbol} Returns the key. 3516 */ 3517 function toKey(value) { 3518 if (typeof value == 'string' || isSymbol(value)) { 3519 return value; 3520 } 3521 var result = (value + ''); 3522 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 3523 } 3524 3525 /** 3526 * Converts `func` to its source code. 3527 * 3528 * @private 3529 * @param {Function} func The function to process. 3530 * @returns {string} Returns the source code. 3531 */ 3532 function toSource(func) { 3533 if (func != null) { 3534 try { 3535 return funcToString.call(func); 3536 } catch (e) {} 3537 try { 3538 return (func + ''); 3539 } catch (e) {} 3540 } 3541 return ''; 3542 } 3543 3544 /** 3545 * Creates a function that memoizes the result of `func`. If `resolver` is 3546 * provided, it determines the cache key for storing the result based on the 3547 * arguments provided to the memoized function. By default, the first argument 3548 * provided to the memoized function is used as the map cache key. The `func` 3549 * is invoked with the `this` binding of the memoized function. 3550 * 3551 * **Note:** The cache is exposed as the `cache` property on the memoized 3552 * function. Its creation may be customized by replacing the `_.memoize.Cache` 3553 * constructor with one whose instances implement the 3554 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) 3555 * method interface of `delete`, `get`, `has`, and `set`. 3556 * 3557 * @static 3558 * @memberOf _ 3559 * @since 0.1.0 3560 * @category Function 3561 * @param {Function} func The function to have its output memoized. 3562 * @param {Function} [resolver] The function to resolve the cache key. 3563 * @returns {Function} Returns the new memoized function. 3564 * @example 3565 * 3566 * var object = { 'a': 1, 'b': 2 }; 3567 * var other = { 'c': 3, 'd': 4 }; 3568 * 3569 * var values = _.memoize(_.values); 3570 * values(object); 3571 * // => [1, 2] 3572 * 3573 * values(other); 3574 * // => [3, 4] 3575 * 3576 * object.a = 2; 3577 * values(object); 3578 * // => [1, 2] 3579 * 3580 * // Modify the result cache. 3581 * values.cache.set(object, ['a', 'b']); 3582 * values(object); 3583 * // => ['a', 'b'] 3584 * 3585 * // Replace `_.memoize.Cache`. 3586 * _.memoize.Cache = WeakMap; 3587 */ 3588 function memoize(func, resolver) { 3589 if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { 3590 throw new TypeError(FUNC_ERROR_TEXT); 3591 } 3592 var memoized = function() { 3593 var args = arguments, 3594 key = resolver ? resolver.apply(this, args) : args[0], 3595 cache = memoized.cache; 3596 3597 if (cache.has(key)) { 3598 return cache.get(key); 3599 } 3600 var result = func.apply(this, args); 3601 memoized.cache = cache.set(key, result); 3602 return result; 3603 }; 3604 memoized.cache = new (memoize.Cache || MapCache); 3605 return memoized; 3606 } 3607 3608 // Assign cache to `_.memoize`. 3609 memoize.Cache = MapCache; 3610 3611 /** 3612 * Performs a 3613 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 3614 * comparison between two values to determine if they are equivalent. 3615 * 3616 * @static 3617 * @memberOf _ 3618 * @since 4.0.0 3619 * @category Lang 3620 * @param {*} value The value to compare. 3621 * @param {*} other The other value to compare. 3622 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 3623 * @example 3624 * 3625 * var object = { 'a': 1 }; 3626 * var other = { 'a': 1 }; 3627 * 3628 * _.eq(object, object); 3629 * // => true 3630 * 3631 * _.eq(object, other); 3632 * // => false 3633 * 3634 * _.eq('a', 'a'); 3635 * // => true 3636 * 3637 * _.eq('a', Object('a')); 3638 * // => false 3639 * 3640 * _.eq(NaN, NaN); 3641 * // => true 3642 */ 3643 function eq(value, other) { 3644 return value === other || (value !== value && other !== other); 3645 } 3646 3647 /** 3648 * Checks if `value` is classified as an `Array` object. 3649 * 3650 * @static 3651 * @memberOf _ 3652 * @since 0.1.0 3653 * @category Lang 3654 * @param {*} value The value to check. 3655 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 3656 * @example 3657 * 3658 * _.isArray([1, 2, 3]); 3659 * // => true 3660 * 3661 * _.isArray(document.body.children); 3662 * // => false 3663 * 3664 * _.isArray('abc'); 3665 * // => false 3666 * 3667 * _.isArray(_.noop); 3668 * // => false 3669 */ 3670 var isArray = Array.isArray; 3671 3672 /** 3673 * Checks if `value` is classified as a `Function` object. 3674 * 3675 * @static 3676 * @memberOf _ 3677 * @since 0.1.0 3678 * @category Lang 3679 * @param {*} value The value to check. 3680 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 3681 * @example 3682 * 3683 * _.isFunction(_); 3684 * // => true 3685 * 3686 * _.isFunction(/abc/); 3687 * // => false 3688 */ 3689 function isFunction(value) {
3690 // The use of `Object#toString` avoids issues with the `typeof` operator 3691 // in Safari 8-9 which returns 'object' for typed array and other constructors. 3692 var tag = isObject(value) ? objectToString.call(value) : ''; 3693 return tag == funcTag || tag == genTag; 3694 } 3695 3696 /** 3697 * Checks if `value` is the 3698 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 3699 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 3700 * 3701 * @static 3702 * @memberOf _ 3703 * @since 0.1.0 3704 * @category Lang 3705 * @param {*} value The value to check. 3706 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 3707 * @example 3708 * 3709 * _.isObject({}); 3710 * // => true 3711 * 3712 * _.isObject([1, 2, 3]); 3713 * // => true 3714 * 3715 * _.isObject(_.noop); 3716 * // => true 3717 * 3718 * _.isObject(null); 3719 * // => false 3720 */ 3721 function isObject(value) { 3722 var type = typeof value; 3723 return !!value && (type == 'object' || type == 'function'); 3724 } 3725 3726 /** 3727 * Checks if `value` is object-like. A value is object-like if it's not `null` 3728 * and has a `typeof` result of "object". 3729 * 3730 * @static 3731 * @memberOf _ 3732 * @since 4.0.0 3733 * @category Lang 3734 * @param {*} value The value to check. 3735 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 3736 * @example 3737 * 3738 * _.isObjectLike({}); 3739 * // => true 3740 * 3741 * _.isObjectLike([1, 2, 3]); 3742 * // => true 3743 * 3744 * _.isObjectLike(_.noop); 3745 * // => false 3746 * 3747 * _.isObjectLike(null); 3748 * // => false 3749 */ 3750 function isObjectLike(value) { 3751 return !!value && typeof value == 'object'; 3752 } 3753 3754 /** 3755 * Checks if `value` is classified as a `Symbol` primitive or object. 3756 * 3757 * @static 3758 * @memberOf _ 3759 * @since 4.0.0 3760 * @category Lang 3761 * @param {*} value The value to check. 3762 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 3763 * @example 3764 * 3765 * _.isSymbol(Symbol.iterator); 3766 * // => true 3767 * 3768 * _.isSymbol('abc'); 3769 * // => false 3770 */ 3771 function isSymbol(value) { 3772 return typeof value == 'symbol' || 3773 (isObjectLike(value) && objectToString.call(value) == symbolTag); 3774 } 3775 3776 /** 3777 * Converts `value` to a string. An empty string is returned for `null` 3778 * and `undefined` values. The sign of `-0` is preserved. 3779 * 3780 * @static 3781 * @memberOf _ 3782 * @since 4.0.0 3783 * @category Lang 3784 * @param {*} value The value to process. 3785 * @returns {string} Returns the string. 3786 * @example 3787 * 3788 * _.toString(null); 3789 * // => '' 3790 * 3791 * _.toString(-0); 3792 * // => '-0' 3793 * 3794 * _.toString([1, 2, 3]); 3795 * // => '1,2,3' 3796 */ 3797 function toString(value) { 3798 return value == null ? '' : baseToString(value); 3799 } 3800 3801 /** 3802 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, 3803 * it's created. Arrays are created for missing index properties while objects 3804 * are created for all other missing properties. Use `_.setWith` to customize 3805 * `path` creation. 3806 * 3807 * **Note:** This method mutates `object`. 3808 * 3809 * @static 3810 * @memberOf _ 3811 * @since 3.7.0 3812 * @category Object 3813 * @param {Object} object The object to modify. 3814 * @param {Array|string} path The path of the property to set. 3815 * @param {*} value The value to set. 3816 * @returns {Object} Returns `object`. 3817 * @example 3818 * 3819 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 3820 * 3821 * _.set(object, 'a[0].b.c', 4); 3822 * console.log(object.a[0].b.c); 3823 * // => 4 3824 * 3825 * _.set(object, ['x', '0', 'y', 'z'], 5); 3826 * console.log(object.x[0].y.z); 3827 * // => 5 3828 */ 3829 function set(object, path, value) { 3830 return object == null ? object : baseSet(object, path, value); 3831 } 3832 3833 module.exports = set; 3834 3835 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 3836 3837/***/ }, 3838/* 7 */ 3839/***/ function(module, exports, __webpack_require__) { 3840 3841 /* WEBPACK VAR INJECTION */(function(global, module) {/** 3842 * lodash (Custom Build) <https://lodash.com/> 3843 * Build: `lodash modularize exports="npm" -o ./` 3844 * Copyright jQuery Foundation and other contributors <https://jquery.org/> 3845 * Released under MIT license <https://lodash.com/license> 3846 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 3847 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 3848 */ 3849 3850 /** Used as the size to enable large array optimizations. */ 3851 var LARGE_ARRAY_SIZE = 200; 3852 3853 /** Used to stand-in for `undefined` hash values. */ 3854 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 3855 3856 /** Used as references for various `Number` constants. */ 3857 var MAX_SAFE_INTEGER = 9007199254740991; 3858 3859 /** `Object#toString` result references. */ 3860 var argsTag = '[object Arguments]', 3861 arrayTag = '[object Array]', 3862 boolTag = '[object Boolean]', 3863 dateTag = '[object Date]', 3864 errorTag = '[object Error]', 3865 funcTag = '[object Function]', 3866 genTag = '[object GeneratorFunction]', 3867 mapTag = '[object Map]', 3868 numberTag = '[object Number]', 3869 objectTag = '[object Object]', 3870 promiseTag = '[object Promise]', 3871 regexpTag = '[object RegExp]', 3872 setTag = '[object Set]', 3873 stringTag = '[object String]', 3874 symbolTag = '[object Symbol]', 3875 weakMapTag = '[object WeakMap]'; 3876 3877 var arrayBufferTag = '[object ArrayBuffer]', 3878 dataViewTag = '[object DataView]', 3879 float32Tag = '[object Float32Array]',
vendor: 4,746 bytes, lines 3880-4031
3880 float64Tag = '[object Float64Array]', 3881 int8Tag = '[object Int8Array]', 3882 int16Tag = '[object Int16Array]', 3883 int32Tag = '[object Int32Array]', 3884 uint8Tag = '[object Uint8Array]', 3885 uint8ClampedTag = '[object Uint8ClampedArray]', 3886 uint16Tag = '[object Uint16Array]', 3887 uint32Tag = '[object Uint32Array]'; 3888 3889 /** 3890 * Used to match `RegExp` 3891 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 3892 */ 3893 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; 3894 3895 /** Used to match `RegExp` flags from their coerced string values. */ 3896 var reFlags = /\w*$/; 3897 3898 /** Used to detect host constructors (Safari). */ 3899 var reIsHostCtor = /^\[object .+?Constructor\]$/; 3900 3901 /** Used to detect unsigned integer values. */ 3902 var reIsUint = /^(?:0|[1-9]\d*)$/; 3903 3904 /** Used to identify `toStringTag` values supported by `_.clone`. */ 3905 var cloneableTags = {}; 3906 cloneableTags[argsTag] = cloneableTags[arrayTag] = 3907 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = 3908 cloneableTags[boolTag] = cloneableTags[dateTag] = 3909 cloneableTags[float32Tag] = cloneableTags[float64Tag] = 3910 cloneableTags[int8Tag] = cloneableTags[int16Tag] = 3911 cloneableTags[int32Tag] = cloneableTags[mapTag] = 3912 cloneableTags[numberTag] = cloneableTags[objectTag] = 3913 cloneableTags[regexpTag] = cloneableTags[setTag] = 3914 cloneableTags[stringTag] = cloneableTags[symbolTag] = 3915 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = 3916 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 3917 cloneableTags[errorTag] = cloneableTags[funcTag] = 3918 cloneableTags[weakMapTag] = false; 3919 3920 /** Detect free variable `global` from Node.js. */ 3921 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 3922 3923 /** Detect free variable `self`. */ 3924 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 3925 3926 /** Used as a reference to the global object. */ 3927 var root = freeGlobal || freeSelf || Function('return this')(); 3928 3929 /** Detect free variable `exports`. */ 3930 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; 3931 3932 /** Detect free variable `module`. */ 3933 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; 3934 3935 /** Detect the popular CommonJS extension `module.exports`. */ 3936 var moduleExports = freeModule && freeModule.exports === freeExports; 3937 3938 /** 3939 * Adds the key-value `pair` to `map`. 3940 * 3941 * @private 3942 * @param {Object} map The map to modify. 3943 * @param {Array} pair The key-value pair to add. 3944 * @returns {Object} Returns `map`. 3945 */ 3946 function addMapEntry(map, pair) { 3947 // Don't return `map.set` because it's not chainable in IE 11. 3948 map.set(pair[0], pair[1]); 3949 return map; 3950 } 3951 3952 /** 3953 * Adds `value` to `set`. 3954 * 3955 * @private 3956 * @param {Object} set The set to modify. 3957 * @param {*} value The value to add. 3958 * @returns {Object} Returns `set`. 3959 */ 3960 function addSetEntry(set, value) { 3961 // Don't return `set.add` because it's not chainable in IE 11. 3962 set.add(value); 3963 return set; 3964 } 3965 3966 /** 3967 * A specialized version of `_.forEach` for arrays without support for 3968 * iteratee shorthands. 3969 * 3970 * @private 3971 * @param {Array} [array] The array to iterate over. 3972 * @param {Function} iteratee The function invoked per iteration. 3973 * @returns {Array} Returns `array`. 3974 */ 3975 function arrayEach(array, iteratee) { 3976 var index = -1, 3977 length = array ? array.length : 0; 3978 3979 while (++index < length) { 3980 if (iteratee(array[index], index, array) === false) { 3981 break; 3982 } 3983 } 3984 return array; 3985 } 3986 3987 /** 3988 * Appends the elements of `values` to `array`. 3989 * 3990 * @private 3991 * @param {Array} array The array to modify. 3992 * @param {Array} values The values to append. 3993 * @returns {Array} Returns `array`. 3994 */ 3995 function arrayPush(array, values) { 3996 var index = -1, 3997 length = values.length, 3998 offset = array.length; 3999 4000 while (++index < length) { 4001 array[offset + index] = values[index]; 4002 } 4003 return array; 4004 } 4005 4006 /** 4007 * A specialized version of `_.reduce` for arrays without support for 4008 * iteratee shorthands. 4009 * 4010 * @private 4011 * @param {Array} [array] The array to iterate over. 4012 * @param {Function} iteratee The function invoked per iteration. 4013 * @param {*} [accumulator] The initial value. 4014 * @param {boolean} [initAccum] Specify using the first element of `array` as 4015 * the initial value. 4016 * @returns {*} Returns the accumulated value. 4017 */ 4018 function arrayReduce(array, iteratee, accumulator, initAccum) { 4019 var index = -1, 4020 length = array ? array.length : 0; 4021 4022 if (initAccum && length) { 4023 accumulator = array[++index]; 4024 } 4025 while (++index < length) { 4026 accumulator = iteratee(accumulator, array[index], index, array); 4027 } 4028 return accumulator; 4029 } 4030 4031 /**
4032 * The base implementation of `_.times` without support for iteratee shorthands 4033 * or max array length checks. 4034 * 4035 * @private 4036 * @param {number} n The number of times to invoke `iteratee`. 4037 * @param {Function} iteratee The function invoked per iteration. 4038 * @returns {Array} Returns the array of results. 4039 */ 4040 function baseTimes(n, iteratee) { 4041 var index = -1, 4042 result = Array(n); 4043 4044 while (++index < n) { 4045 result[index] = iteratee(index); 4046 } 4047 return result; 4048 } 4049 4050 /** 4051 * Gets the value at `key` of `object`. 4052 * 4053 * @private 4054 * @param {Object} [object] The object to query. 4055 * @param {string} key The key of the property to get. 4056 * @returns {*} Returns the property value. 4057 */ 4058 function getValue(object, key) { 4059 return object == null ? undefined : object[key]; 4060 } 4061 4062 /** 4063 * Checks if `value` is a host object in IE < 9. 4064 * 4065 * @private 4066 * @param {*} value The value to check. 4067 * @returns {boolean} Returns `true` if `value` is a host object, else `false`. 4068 */ 4069 function isHostObject(value) { 4070 // Many host objects are `Object` objects that can coerce to strings 4071 // despite having improperly defined `toString` methods. 4072 var result = false;
vendor: 31,019 bytes, lines 4073-5227
4073 if (value != null && typeof value.toString != 'function') { 4074 try { 4075 result = !!(value + ''); 4076 } catch (e) {} 4077 } 4078 return result; 4079 } 4080 4081 /** 4082 * Converts `map` to its key-value pairs. 4083 * 4084 * @private 4085 * @param {Object} map The map to convert. 4086 * @returns {Array} Returns the key-value pairs. 4087 */ 4088 function mapToArray(map) { 4089 var index = -1, 4090 result = Array(map.size); 4091 4092 map.forEach(function(value, key) { 4093 result[++index] = [key, value]; 4094 }); 4095 return result; 4096 } 4097 4098 /** 4099 * Creates a unary function that invokes `func` with its argument transformed. 4100 * 4101 * @private 4102 * @param {Function} func The function to wrap. 4103 * @param {Function} transform The argument transform. 4104 * @returns {Function} Returns the new function. 4105 */ 4106 function overArg(func, transform) { 4107 return function(arg) { 4108 return func(transform(arg)); 4109 }; 4110 } 4111 4112 /** 4113 * Converts `set` to an array of its values. 4114 * 4115 * @private 4116 * @param {Object} set The set to convert. 4117 * @returns {Array} Returns the values. 4118 */ 4119 function setToArray(set) { 4120 var index = -1, 4121 result = Array(set.size); 4122 4123 set.forEach(function(value) { 4124 result[++index] = value; 4125 }); 4126 return result; 4127 } 4128 4129 /** Used for built-in method references. */ 4130 var arrayProto = Array.prototype, 4131 funcProto = Function.prototype, 4132 objectProto = Object.prototype; 4133 4134 /** Used to detect overreaching core-js shims. */ 4135 var coreJsData = root['__core-js_shared__']; 4136 4137 /** Used to detect methods masquerading as native. */ 4138 var maskSrcKey = (function() { 4139 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 4140 return uid ? ('Symbol(src)_1.' + uid) : ''; 4141 }()); 4142 4143 /** Used to resolve the decompiled source of functions. */ 4144 var funcToString = funcProto.toString; 4145 4146 /** Used to check objects for own properties. */ 4147 var hasOwnProperty = objectProto.hasOwnProperty; 4148 4149 /** 4150 * Used to resolve the 4151 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 4152 * of values. 4153 */ 4154 var objectToString = objectProto.toString; 4155 4156 /** Used to detect if a method is native. */ 4157 var reIsNative = RegExp('^' + 4158 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 4159 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 4160 ); 4161 4162 /** Built-in value references. */ 4163 var Buffer = moduleExports ? root.Buffer : undefined, 4164 Symbol = root.Symbol, 4165 Uint8Array = root.Uint8Array, 4166 getPrototype = overArg(Object.getPrototypeOf, Object), 4167 objectCreate = Object.create, 4168 propertyIsEnumerable = objectProto.propertyIsEnumerable, 4169 splice = arrayProto.splice; 4170 4171 /* Built-in method references for those with the same name as other `lodash` methods. */ 4172 var nativeGetSymbols = Object.getOwnPropertySymbols, 4173 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, 4174 nativeKeys = overArg(Object.keys, Object); 4175 4176 /* Built-in method references that are verified to be native. */ 4177 var DataView = getNative(root, 'DataView'), 4178 Map = getNative(root, 'Map'), 4179 Promise = getNative(root, 'Promise'), 4180 Set = getNative(root, 'Set'), 4181 WeakMap = getNative(root, 'WeakMap'), 4182 nativeCreate = getNative(Object, 'create'); 4183 4184 /** Used to detect maps, sets, and weakmaps. */ 4185 var dataViewCtorString = toSource(DataView), 4186 mapCtorString = toSource(Map), 4187 promiseCtorString = toSource(Promise), 4188 setCtorString = toSource(Set), 4189 weakMapCtorString = toSource(WeakMap); 4190 4191 /** Used to convert symbols to primitives and strings. */ 4192 var symbolProto = Symbol ? Symbol.prototype : undefined, 4193 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; 4194 4195 /** 4196 * Creates a hash object. 4197 * 4198 * @private 4199 * @constructor 4200 * @param {Array} [entries] The key-value pairs to cache. 4201 */ 4202 function Hash(entries) { 4203 var index = -1, 4204 length = entries ? entries.length : 0; 4205 4206 this.clear(); 4207 while (++index < length) { 4208 var entry = entries[index]; 4209 this.set(entry[0], entry[1]); 4210 } 4211 } 4212 4213 /** 4214 * Removes all key-value entries from the hash. 4215 * 4216 * @private 4217 * @name clear 4218 * @memberOf Hash 4219 */ 4220 function hashClear() { 4221 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 4222 } 4223 4224 /** 4225 * Removes `key` and its value from the hash. 4226 * 4227 * @private 4228 * @name delete 4229 * @memberOf Hash 4230 * @param {Object} hash The hash to modify. 4231 * @param {string} key The key of the value to remove. 4232 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 4233 */ 4234 function hashDelete(key) { 4235 return this.has(key) && delete this.__data__[key]; 4236 } 4237 4238 /** 4239 * Gets the hash value for `key`. 4240 * 4241 * @private 4242 * @name get 4243 * @memberOf Hash 4244 * @param {string} key The key of the value to get. 4245 * @returns {*} Returns the entry value. 4246 */ 4247 function hashGet(key) { 4248 var data = this.__data__; 4249 if (nativeCreate) { 4250 var result = data[key]; 4251 return result === HASH_UNDEFINED ? undefined : result; 4252 } 4253 return hasOwnProperty.call(data, key) ? data[key] : undefined; 4254 } 4255 4256 /** 4257 * Checks if a hash value for `key` exists. 4258 * 4259 * @private 4260 * @name has 4261 * @memberOf Hash 4262 * @param {string} key The key of the entry to check. 4263 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 4264 */ 4265 function hashHas(key) { 4266 var data = this.__data__; 4267 return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); 4268 } 4269 4270 /** 4271 * Sets the hash `key` to `value`. 4272 * 4273 * @private 4274 * @name set 4275 * @memberOf Hash 4276 * @param {string} key The key of the value to set. 4277 * @param {*} value The value to set. 4278 * @returns {Object} Returns the hash instance. 4279 */ 4280 function hashSet(key, value) { 4281 var data = this.__data__; 4282 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; 4283 return this; 4284 } 4285 4286 // Add methods to `Hash`. 4287 Hash.prototype.clear = hashClear; 4288 Hash.prototype['delete'] = hashDelete; 4289 Hash.prototype.get = hashGet; 4290 Hash.prototype.has = hashHas; 4291 Hash.prototype.set = hashSet; 4292 4293 /** 4294 * Creates an list cache object. 4295 * 4296 * @private 4297 * @constructor 4298 * @param {Array} [entries] The key-value pairs to cache. 4299 */ 4300 function ListCache(entries) { 4301 var index = -1, 4302 length = entries ? entries.length : 0; 4303 4304 this.clear(); 4305 while (++index < length) { 4306 var entry = entries[index]; 4307 this.set(entry[0], entry[1]); 4308 } 4309 } 4310 4311 /** 4312 * Removes all key-value entries from the list cache. 4313 * 4314 * @private 4315 * @name clear 4316 * @memberOf ListCache 4317 */ 4318 function listCacheClear() { 4319 this.__data__ = []; 4320 } 4321 4322 /** 4323 * Removes `key` and its value from the list cache. 4324 * 4325 * @private 4326 * @name delete 4327 * @memberOf ListCache 4328 * @param {string} key The key of the value to remove. 4329 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 4330 */ 4331 function listCacheDelete(key) { 4332 var data = this.__data__, 4333 index = assocIndexOf(data, key); 4334 4335 if (index < 0) { 4336 return false; 4337 } 4338 var lastIndex = data.length - 1; 4339 if (index == lastIndex) { 4340 data.pop(); 4341 } else { 4342 splice.call(data, index, 1); 4343 } 4344 return true; 4345 } 4346 4347 /** 4348 * Gets the list cache value for `key`. 4349 * 4350 * @private 4351 * @name get 4352 * @memberOf ListCache 4353 * @param {string} key The key of the value to get. 4354 * @returns {*} Returns the entry value. 4355 */ 4356 function listCacheGet(key) { 4357 var data = this.__data__, 4358 index = assocIndexOf(data, key); 4359 4360 return index < 0 ? undefined : data[index][1]; 4361 } 4362 4363 /** 4364 * Checks if a list cache value for `key` exists. 4365 * 4366 * @private 4367 * @name has 4368 * @memberOf ListCache 4369 * @param {string} key The key of the entry to check. 4370 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 4371 */ 4372 function listCacheHas(key) { 4373 return assocIndexOf(this.__data__, key) > -1; 4374 } 4375 4376 /** 4377 * Sets the list cache `key` to `value`. 4378 * 4379 * @private 4380 * @name set 4381 * @memberOf ListCache 4382 * @param {string} key The key of the value to set. 4383 * @param {*} value The value to set. 4384 * @returns {Object} Returns the list cache instance. 4385 */ 4386 function listCacheSet(key, value) { 4387 var data = this.__data__, 4388 index = assocIndexOf(data, key); 4389 4390 if (index < 0) { 4391 data.push([key, value]); 4392 } else { 4393 data[index][1] = value; 4394 } 4395 return this; 4396 } 4397 4398 // Add methods to `ListCache`. 4399 ListCache.prototype.clear = listCacheClear; 4400 ListCache.prototype['delete'] = listCacheDelete; 4401 ListCache.prototype.get = listCacheGet; 4402 ListCache.prototype.has = listCacheHas; 4403 ListCache.prototype.set = listCacheSet; 4404 4405 /** 4406 * Creates a map cache object to store key-value pairs. 4407 * 4408 * @private 4409 * @constructor 4410 * @param {Array} [entries] The key-value pairs to cache. 4411 */ 4412 function MapCache(entries) { 4413 var index = -1, 4414 length = entries ? entries.length : 0; 4415 4416 this.clear(); 4417 while (++index < length) { 4418 var entry = entries[index]; 4419 this.set(entry[0], entry[1]); 4420 } 4421 } 4422 4423 /** 4424 * Removes all key-value entries from the map. 4425 * 4426 * @private 4427 * @name clear 4428 * @memberOf MapCache 4429 */ 4430 function mapCacheClear() { 4431 this.__data__ = { 4432 'hash': new Hash, 4433 'map': new (Map || ListCache), 4434 'string': new Hash 4435 }; 4436 } 4437 4438 /** 4439 * Removes `key` and its value from the map. 4440 * 4441 * @private 4442 * @name delete 4443 * @memberOf MapCache 4444 * @param {string} key The key of the value to remove. 4445 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 4446 */ 4447 function mapCacheDelete(key) { 4448 return getMapData(this, key)['delete'](key); 4449 } 4450 4451 /** 4452 * Gets the map value for `key`. 4453 * 4454 * @private 4455 * @name get 4456 * @memberOf MapCache 4457 * @param {string} key The key of the value to get. 4458 * @returns {*} Returns the entry value. 4459 */ 4460 function mapCacheGet(key) { 4461 return getMapData(this, key).get(key); 4462 } 4463 4464 /** 4465 * Checks if a map value for `key` exists. 4466 * 4467 * @private 4468 * @name has 4469 * @memberOf MapCache 4470 * @param {string} key The key of the entry to check. 4471 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 4472 */ 4473 function mapCacheHas(key) { 4474 return getMapData(this, key).has(key); 4475 } 4476 4477 /** 4478 * Sets the map `key` to `value`. 4479 * 4480 * @private 4481 * @name set 4482 * @memberOf MapCache 4483 * @param {string} key The key of the value to set. 4484 * @param {*} value The value to set. 4485 * @returns {Object} Returns the map cache instance. 4486 */ 4487 function mapCacheSet(key, value) { 4488 getMapData(this, key).set(key, value); 4489 return this; 4490 } 4491 4492 // Add methods to `MapCache`. 4493 MapCache.prototype.clear = mapCacheClear; 4494 MapCache.prototype['delete'] = mapCacheDelete; 4495 MapCache.prototype.get = mapCacheGet; 4496 MapCache.prototype.has = mapCacheHas; 4497 MapCache.prototype.set = mapCacheSet; 4498 4499 /** 4500 * Creates a stack cache object to store key-value pairs. 4501 * 4502 * @private 4503 * @constructor 4504 * @param {Array} [entries] The key-value pairs to cache. 4505 */ 4506 function Stack(entries) { 4507 this.__data__ = new ListCache(entries); 4508 } 4509 4510 /** 4511 * Removes all key-value entries from the stack. 4512 * 4513 * @private 4514 * @name clear 4515 * @memberOf Stack 4516 */ 4517 function stackClear() { 4518 this.__data__ = new ListCache; 4519 } 4520 4521 /** 4522 * Removes `key` and its value from the stack. 4523 * 4524 * @private 4525 * @name delete 4526 * @memberOf Stack 4527 * @param {string} key The key of the value to remove. 4528 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 4529 */ 4530 function stackDelete(key) { 4531 return this.__data__['delete'](key); 4532 } 4533 4534 /** 4535 * Gets the stack value for `key`. 4536 * 4537 * @private 4538 * @name get 4539 * @memberOf Stack 4540 * @param {string} key The key of the value to get. 4541 * @returns {*} Returns the entry value. 4542 */ 4543 function stackGet(key) { 4544 return this.__data__.get(key); 4545 } 4546 4547 /** 4548 * Checks if a stack value for `key` exists. 4549 * 4550 * @private 4551 * @name has 4552 * @memberOf Stack 4553 * @param {string} key The key of the entry to check. 4554 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 4555 */ 4556 function stackHas(key) { 4557 return this.__data__.has(key); 4558 } 4559 4560 /** 4561 * Sets the stack `key` to `value`. 4562 * 4563 * @private 4564 * @name set 4565 * @memberOf Stack 4566 * @param {string} key The key of the value to set. 4567 * @param {*} value The value to set. 4568 * @returns {Object} Returns the stack cache instance. 4569 */ 4570 function stackSet(key, value) { 4571 var cache = this.__data__; 4572 if (cache instanceof ListCache) { 4573 var pairs = cache.__data__; 4574 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { 4575 pairs.push([key, value]); 4576 return this; 4577 } 4578 cache = this.__data__ = new MapCache(pairs); 4579 } 4580 cache.set(key, value); 4581 return this; 4582 } 4583 4584 // Add methods to `Stack`. 4585 Stack.prototype.clear = stackClear; 4586 Stack.prototype['delete'] = stackDelete; 4587 Stack.prototype.get = stackGet; 4588 Stack.prototype.has = stackHas; 4589 Stack.prototype.set = stackSet; 4590 4591 /** 4592 * Creates an array of the enumerable property names of the array-like `value`. 4593 * 4594 * @private 4595 * @param {*} value The value to query. 4596 * @param {boolean} inherited Specify returning inherited property names. 4597 * @returns {Array} Returns the array of property names. 4598 */ 4599 function arrayLikeKeys(value, inherited) { 4600 // Safari 8.1 makes `arguments.callee` enumerable in strict mode. 4601 // Safari 9 makes `arguments.length` enumerable in strict mode. 4602 var result = (isArray(value) || isArguments(value)) 4603 ? baseTimes(value.length, String) 4604 : []; 4605 4606 var length = result.length, 4607 skipIndexes = !!length; 4608 4609 for (var key in value) { 4610 if ((inherited || hasOwnProperty.call(value, key)) && 4611 !(skipIndexes && (key == 'length' || isIndex(key, length)))) { 4612 result.push(key); 4613 } 4614 } 4615 return result; 4616 } 4617 4618 /** 4619 * Assigns `value` to `key` of `object` if the existing value is not equivalent 4620 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 4621 * for equality comparisons. 4622 * 4623 * @private 4624 * @param {Object} object The object to modify. 4625 * @param {string} key The key of the property to assign. 4626 * @param {*} value The value to assign. 4627 */ 4628 function assignValue(object, key, value) { 4629 var objValue = object[key]; 4630 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || 4631 (value === undefined && !(key in object))) { 4632 object[key] = value; 4633 } 4634 } 4635 4636 /** 4637 * Gets the index at which the `key` is found in `array` of key-value pairs. 4638 * 4639 * @private 4640 * @param {Array} array The array to inspect. 4641 * @param {*} key The key to search for. 4642 * @returns {number} Returns the index of the matched value, else `-1`. 4643 */ 4644 function assocIndexOf(array, key) { 4645 var length = array.length; 4646 while (length--) { 4647 if (eq(array[length][0], key)) { 4648 return length; 4649 } 4650 } 4651 return -1; 4652 } 4653 4654 /** 4655 * The base implementation of `_.assign` without support for multiple sources 4656 * or `customizer` functions. 4657 * 4658 * @private 4659 * @param {Object} object The destination object. 4660 * @param {Object} source The source object. 4661 * @returns {Object} Returns `object`. 4662 */ 4663 function baseAssign(object, source) { 4664 return object && copyObject(source, keys(source), object); 4665 } 4666 4667 /** 4668 * The base implementation of `_.clone` and `_.cloneDeep` which tracks 4669 * traversed objects. 4670 * 4671 * @private 4672 * @param {*} value The value to clone. 4673 * @param {boolean} [isDeep] Specify a deep clone. 4674 * @param {boolean} [isFull] Specify a clone including symbols. 4675 * @param {Function} [customizer] The function to customize cloning. 4676 * @param {string} [key] The key of `value`. 4677 * @param {Object} [object] The parent object of `value`. 4678 * @param {Object} [stack] Tracks traversed objects and their clone counterparts. 4679 * @returns {*} Returns the cloned value. 4680 */ 4681 function baseClone(value, isDeep, isFull, customizer, key, object, stack) { 4682 var result; 4683 if (customizer) { 4684 result = object ? customizer(value, key, object, stack) : customizer(value); 4685 } 4686 if (result !== undefined) { 4687 return result; 4688 } 4689 if (!isObject(value)) { 4690 return value; 4691 } 4692 var isArr = isArray(value); 4693 if (isArr) { 4694 result = initCloneArray(value); 4695 if (!isDeep) { 4696 return copyArray(value, result); 4697 } 4698 } else { 4699 var tag = getTag(value), 4700 isFunc = tag == funcTag || tag == genTag; 4701 4702 if (isBuffer(value)) { 4703 return cloneBuffer(value, isDeep); 4704 } 4705 if (tag == objectTag || tag == argsTag || (isFunc && !object)) { 4706 if (isHostObject(value)) { 4707 return object ? value : {}; 4708 } 4709 result = initCloneObject(isFunc ? {} : value); 4710 if (!isDeep) { 4711 return copySymbols(value, baseAssign(result, value)); 4712 } 4713 } else { 4714 if (!cloneableTags[tag]) { 4715 return object ? value : {}; 4716 } 4717 result = initCloneByTag(value, tag, baseClone, isDeep); 4718 } 4719 } 4720 // Check for circular references and return its corresponding clone. 4721 stack || (stack = new Stack); 4722 var stacked = stack.get(value); 4723 if (stacked) { 4724 return stacked; 4725 } 4726 stack.set(value, result); 4727 4728 if (!isArr) { 4729 var props = isFull ? getAllKeys(value) : keys(value); 4730 } 4731 arrayEach(props || value, function(subValue, key) { 4732 if (props) { 4733 key = subValue; 4734 subValue = value[key]; 4735 } 4736 // Recursively populate clone (susceptible to call stack limits). 4737 assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); 4738 }); 4739 return result; 4740 } 4741 4742 /** 4743 * The base implementation of `_.create` without support for assigning 4744 * properties to the created object. 4745 * 4746 * @private 4747 * @param {Object} prototype The object to inherit from. 4748 * @returns {Object} Returns the new object. 4749 */ 4750 function baseCreate(proto) { 4751 return isObject(proto) ? objectCreate(proto) : {}; 4752 } 4753 4754 /** 4755 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses 4756 * `keysFunc` and `symbolsFunc` to get the enumerable property names and 4757 * symbols of `object`. 4758 * 4759 * @private 4760 * @param {Object} object The object to query. 4761 * @param {Function} keysFunc The function to get the keys of `object`. 4762 * @param {Function} symbolsFunc The function to get the symbols of `object`. 4763 * @returns {Array} Returns the array of property names and symbols. 4764 */ 4765 function baseGetAllKeys(object, keysFunc, symbolsFunc) { 4766 var result = keysFunc(object); 4767 return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); 4768 } 4769 4770 /** 4771 * The base implementation of `getTag`. 4772 * 4773 * @private 4774 * @param {*} value The value to query. 4775 * @returns {string} Returns the `toStringTag`. 4776 */ 4777 function baseGetTag(value) { 4778 return objectToString.call(value); 4779 } 4780 4781 /** 4782 * The base implementation of `_.isNative` without bad shim checks. 4783 * 4784 * @private 4785 * @param {*} value The value to check. 4786 * @returns {boolean} Returns `true` if `value` is a native function, 4787 * else `false`. 4788 */ 4789 function baseIsNative(value) { 4790 if (!isObject(value) || isMasked(value)) { 4791 return false; 4792 } 4793 var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; 4794 return pattern.test(toSource(value)); 4795 } 4796 4797 /** 4798 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. 4799 * 4800 * @private 4801 * @param {Object} object The object to query. 4802 * @returns {Array} Returns the array of property names. 4803 */ 4804 function baseKeys(object) { 4805 if (!isPrototype(object)) { 4806 return nativeKeys(object); 4807 } 4808 var result = []; 4809 for (var key in Object(object)) { 4810 if (hasOwnProperty.call(object, key) && key != 'constructor') { 4811 result.push(key); 4812 } 4813 } 4814 return result; 4815 } 4816 4817 /** 4818 * Creates a clone of `buffer`. 4819 * 4820 * @private 4821 * @param {Buffer} buffer The buffer to clone. 4822 * @param {boolean} [isDeep] Specify a deep clone. 4823 * @returns {Buffer} Returns the cloned buffer. 4824 */ 4825 function cloneBuffer(buffer, isDeep) { 4826 if (isDeep) { 4827 return buffer.slice(); 4828 } 4829 var result = new buffer.constructor(buffer.length); 4830 buffer.copy(result); 4831 return result; 4832 } 4833 4834 /** 4835 * Creates a clone of `arrayBuffer`. 4836 * 4837 * @private 4838 * @param {ArrayBuffer} arrayBuffer The array buffer to clone. 4839 * @returns {ArrayBuffer} Returns the cloned array buffer. 4840 */ 4841 function cloneArrayBuffer(arrayBuffer) { 4842 var result = new arrayBuffer.constructor(arrayBuffer.byteLength); 4843 new Uint8Array(result).set(new Uint8Array(arrayBuffer)); 4844 return result; 4845 } 4846 4847 /** 4848 * Creates a clone of `dataView`. 4849 * 4850 * @private 4851 * @param {Object} dataView The data view to clone. 4852 * @param {boolean} [isDeep] Specify a deep clone. 4853 * @returns {Object} Returns the cloned data view. 4854 */ 4855 function cloneDataView(dataView, isDeep) { 4856 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 4857 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); 4858 } 4859 4860 /** 4861 * Creates a clone of `map`. 4862 * 4863 * @private 4864 * @param {Object} map The map to clone. 4865 * @param {Function} cloneFunc The function to clone values. 4866 * @param {boolean} [isDeep] Specify a deep clone. 4867 * @returns {Object} Returns the cloned map. 4868 */ 4869 function cloneMap(map, isDeep, cloneFunc) { 4870 var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); 4871 return arrayReduce(array, addMapEntry, new map.constructor); 4872 } 4873 4874 /** 4875 * Creates a clone of `regexp`. 4876 * 4877 * @private 4878 * @param {Object} regexp The regexp to clone. 4879 * @returns {Object} Returns the cloned regexp. 4880 */ 4881 function cloneRegExp(regexp) { 4882 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 4883 result.lastIndex = regexp.lastIndex; 4884 return result; 4885 } 4886 4887 /** 4888 * Creates a clone of `set`. 4889 * 4890 * @private 4891 * @param {Object} set The set to clone. 4892 * @param {Function} cloneFunc The function to clone values. 4893 * @param {boolean} [isDeep] Specify a deep clone. 4894 * @returns {Object} Returns the cloned set. 4895 */ 4896 function cloneSet(set, isDeep, cloneFunc) { 4897 var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); 4898 return arrayReduce(array, addSetEntry, new set.constructor); 4899 } 4900 4901 /** 4902 * Creates a clone of the `symbol` object. 4903 * 4904 * @private 4905 * @param {Object} symbol The symbol object to clone. 4906 * @returns {Object} Returns the cloned symbol object. 4907 */ 4908 function cloneSymbol(symbol) { 4909 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; 4910 } 4911 4912 /** 4913 * Creates a clone of `typedArray`. 4914 * 4915 * @private 4916 * @param {Object} typedArray The typed array to clone. 4917 * @param {boolean} [isDeep] Specify a deep clone. 4918 * @returns {Object} Returns the cloned typed array. 4919 */ 4920 function cloneTypedArray(typedArray, isDeep) { 4921 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 4922 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); 4923 } 4924 4925 /** 4926 * Copies the values of `source` to `array`. 4927 * 4928 * @private 4929 * @param {Array} source The array to copy values from. 4930 * @param {Array} [array=[]] The array to copy values to. 4931 * @returns {Array} Returns `array`. 4932 */ 4933 function copyArray(source, array) { 4934 var index = -1, 4935 length = source.length; 4936 4937 array || (array = Array(length)); 4938 while (++index < length) { 4939 array[index] = source[index]; 4940 } 4941 return array; 4942 } 4943 4944 /** 4945 * Copies properties of `source` to `object`. 4946 * 4947 * @private 4948 * @param {Object} source The object to copy properties from. 4949 * @param {Array} props The property identifiers to copy. 4950 * @param {Object} [object={}] The object to copy properties to. 4951 * @param {Function} [customizer] The function to customize copied values. 4952 * @returns {Object} Returns `object`. 4953 */ 4954 function copyObject(source, props, object, customizer) { 4955 object || (object = {}); 4956 4957 var index = -1, 4958 length = props.length; 4959 4960 while (++index < length) { 4961 var key = props[index]; 4962 4963 var newValue = customizer 4964 ? customizer(object[key], source[key], key, object, source) 4965 : undefined; 4966 4967 assignValue(object, key, newValue === undefined ? source[key] : newValue); 4968 } 4969 return object; 4970 } 4971 4972 /** 4973 * Copies own symbol properties of `source` to `object`. 4974 * 4975 * @private 4976 * @param {Object} source The object to copy symbols from. 4977 * @param {Object} [object={}] The object to copy symbols to. 4978 * @returns {Object} Returns `object`. 4979 */ 4980 function copySymbols(source, object) { 4981 return copyObject(source, getSymbols(source), object); 4982 } 4983 4984 /** 4985 * Creates an array of own enumerable property names and symbols of `object`. 4986 * 4987 * @private 4988 * @param {Object} object The object to query. 4989 * @returns {Array} Returns the array of property names and symbols. 4990 */ 4991 function getAllKeys(object) { 4992 return baseGetAllKeys(object, keys, getSymbols); 4993 } 4994 4995 /** 4996 * Gets the data for `map`. 4997 * 4998 * @private 4999 * @param {Object} map The map to query. 5000 * @param {string} key The reference key. 5001 * @returns {*} Returns the map data. 5002 */ 5003 function getMapData(map, key) { 5004 var data = map.__data__; 5005 return isKeyable(key) 5006 ? data[typeof key == 'string' ? 'string' : 'hash'] 5007 : data.map; 5008 } 5009 5010 /** 5011 * Gets the native function at `key` of `object`. 5012 * 5013 * @private 5014 * @param {Object} object The object to query. 5015 * @param {string} key The key of the method to get. 5016 * @returns {*} Returns the function if it's native, else `undefined`. 5017 */ 5018 function getNative(object, key) { 5019 var value = getValue(object, key); 5020 return baseIsNative(value) ? value : undefined; 5021 } 5022 5023 /** 5024 * Creates an array of the own enumerable symbol properties of `object`. 5025 * 5026 * @private 5027 * @param {Object} object The object to query. 5028 * @returns {Array} Returns the array of symbols. 5029 */ 5030 var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; 5031 5032 /** 5033 * Gets the `toStringTag` of `value`. 5034 * 5035 * @private 5036 * @param {*} value The value to query. 5037 * @returns {string} Returns the `toStringTag`. 5038 */ 5039 var getTag = baseGetTag; 5040 5041 // Fallback for data views, maps, sets, and weak maps in IE 11, 5042 // for data views in Edge < 14, and promises in Node.js. 5043 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || 5044 (Map && getTag(new Map) != mapTag) || 5045 (Promise && getTag(Promise.resolve()) != promiseTag) || 5046 (Set && getTag(new Set) != setTag) || 5047 (WeakMap && getTag(new WeakMap) != weakMapTag)) { 5048 getTag = function(value) { 5049 var result = objectToString.call(value), 5050 Ctor = result == objectTag ? value.constructor : undefined, 5051 ctorString = Ctor ? toSource(Ctor) : undefined; 5052 5053 if (ctorString) { 5054 switch (ctorString) { 5055 case dataViewCtorString: return dataViewTag; 5056 case mapCtorString: return mapTag; 5057 case promiseCtorString: return promiseTag; 5058 case setCtorString: return setTag; 5059 case weakMapCtorString: return weakMapTag; 5060 } 5061 } 5062 return result; 5063 }; 5064 } 5065 5066 /** 5067 * Initializes an array clone. 5068 * 5069 * @private 5070 * @param {Array} array The array to clone. 5071 * @returns {Array} Returns the initialized clone. 5072 */ 5073 function initCloneArray(array) { 5074 var length = array.length, 5075 result = array.constructor(length); 5076 5077 // Add properties assigned by `RegExp#exec`. 5078 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { 5079 result.index = array.index; 5080 result.input = array.input; 5081 } 5082 return result; 5083 } 5084 5085 /** 5086 * Initializes an object clone. 5087 * 5088 * @private 5089 * @param {Object} object The object to clone. 5090 * @returns {Object} Returns the initialized clone. 5091 */ 5092 function initCloneObject(object) { 5093 return (typeof object.constructor == 'function' && !isPrototype(object)) 5094 ? baseCreate(getPrototype(object)) 5095 : {}; 5096 } 5097 5098 /** 5099 * Initializes an object clone based on its `toStringTag`. 5100 * 5101 * **Note:** This function only supports cloning values with tags of 5102 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 5103 * 5104 * @private 5105 * @param {Object} object The object to clone. 5106 * @param {string} tag The `toStringTag` of the object to clone. 5107 * @param {Function} cloneFunc The function to clone values. 5108 * @param {boolean} [isDeep] Specify a deep clone. 5109 * @returns {Object} Returns the initialized clone. 5110 */ 5111 function initCloneByTag(object, tag, cloneFunc, isDeep) { 5112 var Ctor = object.constructor; 5113 switch (tag) { 5114 case arrayBufferTag: 5115 return cloneArrayBuffer(object); 5116 5117 case boolTag: 5118 case dateTag: 5119 return new Ctor(+object); 5120 5121 case dataViewTag: 5122 return cloneDataView(object, isDeep); 5123 5124 case float32Tag: case float64Tag: 5125 case int8Tag: case int16Tag: case int32Tag: 5126 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: 5127 return cloneTypedArray(object, isDeep); 5128 5129 case mapTag: 5130 return cloneMap(object, isDeep, cloneFunc); 5131 5132 case numberTag: 5133 case stringTag: 5134 return new Ctor(object); 5135 5136 case regexpTag: 5137 return cloneRegExp(object); 5138 5139 case setTag: 5140 return cloneSet(object, isDeep, cloneFunc); 5141 5142 case symbolTag: 5143 return cloneSymbol(object); 5144 } 5145 } 5146 5147 /** 5148 * Checks if `value` is a valid array-like index. 5149 * 5150 * @private 5151 * @param {*} value The value to check. 5152 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 5153 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 5154 */ 5155 function isIndex(value, length) { 5156 length = length == null ? MAX_SAFE_INTEGER : length; 5157 return !!length && 5158 (typeof value == 'number' || reIsUint.test(value)) && 5159 (value > -1 && value % 1 == 0 && value < length); 5160 } 5161 5162 /** 5163 * Checks if `value` is suitable for use as unique object key. 5164 * 5165 * @private 5166 * @param {*} value The value to check. 5167 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 5168 */ 5169 function isKeyable(value) { 5170 var type = typeof value; 5171 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') 5172 ? (value !== '__proto__') 5173 : (value === null); 5174 } 5175 5176 /** 5177 * Checks if `func` has its source masked. 5178 * 5179 * @private 5180 * @param {Function} func The function to check. 5181 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 5182 */ 5183 function isMasked(func) { 5184 return !!maskSrcKey && (maskSrcKey in func); 5185 } 5186 5187 /** 5188 * Checks if `value` is likely a prototype object. 5189 * 5190 * @private 5191 * @param {*} value The value to check. 5192 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. 5193 */ 5194 function isPrototype(value) { 5195 var Ctor = value && value.constructor, 5196 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; 5197 5198 return value === proto; 5199 } 5200 5201 /** 5202 * Converts `func` to its source code. 5203 * 5204 * @private 5205 * @param {Function} func The function to process. 5206 * @returns {string} Returns the source code. 5207 */ 5208 function toSource(func) { 5209 if (func != null) { 5210 try { 5211 return funcToString.call(func); 5212 } catch (e) {} 5213 try { 5214 return (func + ''); 5215 } catch (e) {} 5216 } 5217 return ''; 5218 } 5219 5220 /** 5221 * This method is like `_.clone` except that it recursively clones `value`. 5222 * 5223 * @static 5224 * @memberOf _ 5225 * @since 1.0.0 5226 * @category Lang 5227 * @param {*}
5227 value The value to recursively clone. 5228 * @returns {*} Returns the deep cloned value. 5229 * @see _.clone 5230 * @example 5231 * 5232 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 5233 * 5234 * var deep = _.cloneDeep(objects); 5235 * console.log(deep[0] === objects[0]); 5236 * // => false 5237 */ 5238 function cloneDeep(value) { 5239 return baseClone(value, true, true); 5240 } 5241 5242 /** 5243 * Performs a 5244 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 5245 * comparison between two values to determine if they are equivalent. 5246 * 5247 * @static 5248 * @memberOf _ 5249 * @since 4.0.0 5250 * @category Lang 5251 * @param {*} value The value to compare. 5252 * @param {*} other The other value to compare. 5253 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 5254 * @example 5255 * 5256 * var object = { 'a': 1 }; 5257 * var other = { 'a': 1 }; 5258 * 5259 * _.eq(object, object); 5260 * // => true 5261 * 5262 * _.eq(object, other); 5263 * // => false 5264 * 5265 * _.eq('a', 'a'); 5266 * // => true 5267 * 5268 * _.eq('a', Object('a')); 5269 * // => false 5270 * 5271 * _.eq(NaN, NaN); 5272 * // => true 5273 */ 5274 function eq(value, other) { 5275 return value === other || (value !== value && other !== other); 5276 } 5277 5278 /** 5279 * Checks if `value` is likely an `arguments` object. 5280 * 5281 * @static 5282 * @memberOf _ 5283 * @since 0.1.0 5284 * @category Lang 5285 * @param {*} value The value to check. 5286 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 5287 * else `false`. 5288 * @example 5289 * 5290 * _.isArguments(function() { return arguments; }()); 5291 * // => true 5292 * 5293 * _.isArguments([1, 2, 3]); 5294 * // => false 5295 */ 5296 function isArguments(value) { 5297 // Safari 8.1 makes `arguments.callee` enumerable in strict mode. 5298 return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && 5299 (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); 5300 } 5301 5302 /** 5303 * Checks if `value` is classified as an `Array` object. 5304 * 5305 * @static 5306 * @memberOf _ 5307 * @since 0.1.0 5308 * @category Lang 5309 * @param {*} value The value to check. 5310 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 5311 * @example 5312 * 5313 * _.isArray([1, 2, 3]); 5314 * // => true 5315 * 5316 * _.isArray(document.body.children); 5317 * // => false 5318 * 5319 * _.isArray('abc'); 5320 * // => false 5321 * 5322 * _.isArray(_.noop); 5323 * // => false 5324 */ 5325 var isArray = Array.isArray; 5326 5327 /** 5328 * Checks if `value` is array-like. A value is considered array-like if it's 5329 * not a function and has a `value.length` that's an integer greater than or 5330 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 5331 * 5332 * @static 5333 * @memberOf _ 5334 * @since 4.0.0 5335 * @category Lang 5336 * @param {*} value The value to check. 5337 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 5338 * @example 5339 * 5340 * _.isArrayLike([1, 2, 3]); 5341 * // => true 5342 * 5343 * _.isArrayLike(document.body.children); 5344 * // => true 5345 * 5346 * _.isArrayLike('abc'); 5347 * // => true 5348 * 5349 * _.isArrayLike(_.noop); 5350 * // => false 5351 */ 5352 function isArrayLike(value) { 5353 return value != null && isLength(value.length) && !isFunction(value); 5354 } 5355 5356 /** 5357 * This method is like `_.isArrayLike` except that it also checks if `value` 5358 * is an object. 5359 * 5360 * @static 5361 * @memberOf _ 5362 * @since 4.0.0 5363 * @category Lang 5364 * @param {*} value The value to check. 5365 * @returns {boolean} Returns `true` if `value` is an array-like object, 5366 * else `false`. 5367 * @example 5368 * 5369 * _.isArrayLikeObject([1, 2, 3]); 5370 * // => true 5371 * 5372 * _.isArrayLikeObject(document.body.children); 5373 * // => true 5374 * 5375 * _.isArrayLikeObject('abc'); 5376 * // => false 5377 * 5378 * _.isArrayLikeObject(_.noop); 5379 * // => false 5380 */ 5381 function isArrayLikeObject(value) { 5382 return isObjectLike(value) && isArrayLike(value); 5383 } 5384 5385 /** 5386 * Checks if `value` is a buffer. 5387 * 5388 * @static 5389 * @memberOf _ 5390 * @since 4.3.0 5391 * @category Lang 5392 * @param {*} value The value to check. 5393 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. 5394 * @example 5395 * 5396 * _.isBuffer(new Buffer(2)); 5397 * // => true 5398 * 5399 * _.isBuffer(new Uint8Array(2)); 5400 * // => false 5401 */ 5402 var isBuffer = nativeIsBuffer || stubFalse; 5403 5404 /** 5405 * Checks if `value` is classified as a `Function` object. 5406 * 5407 * @static 5408 * @memberOf _ 5409 * @since 0.1.0 5410 * @category Lang 5411 * @param {*} value The value to check. 5412 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 5413 * @example 5414 * 5415 * _.isFunction(_); 5416 * // => true 5417 * 5418 * _.isFunction(/abc/); 5419 * // => false 5420 */ 5421 function isFunction(value) {
5422 // The use of `Object#toString` avoids issues with the `typeof` operator 5423 // in Safari 8-9 which returns 'object' for typed array and other constructors. 5424 var tag = isObject(value) ? objectToString.call(value) : ''; 5425 return tag == funcTag || tag == genTag; 5426 } 5427 5428 /** 5429 * Checks if `value` is a valid array-like length. 5430 * 5431 * **Note:** This method is loosely based on 5432 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 5433 * 5434 * @static 5435 * @memberOf _ 5436 * @since 4.0.0 5437 * @category Lang 5438 * @param {*} value The value to check. 5439 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 5440 * @example 5441 * 5442 * _.isLength(3); 5443 * // => true 5444 * 5445 * _.isLength(Number.MIN_VALUE); 5446 * // => false 5447 * 5448 * _.isLength(Infinity); 5449 * // => false 5450 * 5451 * _.isLength('3'); 5452 * // => false 5453 */ 5454 function isLength(value) { 5455 return typeof value == 'number' && 5456 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 5457 } 5458 5459 /** 5460 * Checks if `value` is the 5461 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 5462 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 5463 * 5464 * @static 5465 * @memberOf _ 5466 * @since 0.1.0 5467 * @category Lang 5468 * @param {*} value The value to check. 5469 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 5470 * @example 5471 * 5472 * _.isObject({}); 5473 * // => true 5474 * 5475 * _.isObject([1, 2, 3]); 5476 * // => true 5477 * 5478 * _.isObject(_.noop); 5479 * // => true 5480 * 5481 * _.isObject(null); 5482 * // => false 5483 */ 5484 function isObject(value) { 5485 var type = typeof value; 5486 return !!value && (type == 'object' || type == 'function'); 5487 } 5488 5489 /** 5490 * Checks if `value` is object-like. A value is object-like if it's not `null` 5491 * and has a `typeof` result of "object". 5492 * 5493 * @static 5494 * @memberOf _ 5495 * @since 4.0.0 5496 * @category Lang 5497 * @param {*} value The value to check. 5498 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 5499 * @example 5500 * 5501 * _.isObjectLike({}); 5502 * // => true 5503 * 5504 * _.isObjectLike([1, 2, 3]); 5505 * // => true 5506 * 5507 * _.isObjectLike(_.noop); 5508 * // => false 5509 * 5510 * _.isObjectLike(null); 5511 * // => false 5512 */ 5513 function isObjectLike(value) { 5514 return !!value && typeof value == 'object'; 5515 } 5516 5517 /** 5518 * Creates an array of the own enumerable property names of `object`. 5519 * 5520 * **Note:** Non-object values are coerced to objects. See the 5521 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 5522 * for more details. 5523 * 5524 * @static 5525 * @since 0.1.0 5526 * @memberOf _ 5527 * @category Object 5528 * @param {Object} object The object to query. 5529 * @returns {Array} Returns the array of property names. 5530 * @example 5531 * 5532 * function Foo() { 5533 * this.a = 1; 5534 * this.b = 2; 5535 * } 5536 * 5537 * Foo.prototype.c = 3; 5538 * 5539 * _.keys(new Foo); 5540 * // => ['a', 'b'] (iteration order is not guaranteed) 5541 * 5542 * _.keys('hi'); 5543 * // => ['0', '1'] 5544 */ 5545 function keys(object) { 5546 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); 5547 } 5548 5549 /** 5550 * This method returns a new empty array. 5551 * 5552 * @static 5553 * @memberOf _ 5554 * @since 4.13.0 5555 * @category Util 5556 * @returns {Array} Returns the new empty array. 5557 * @example 5558 * 5559 * var arrays = _.times(2, _.stubArray); 5560 * 5561 * console.log(arrays); 5562 * // => [[], []] 5563 * 5564 * console.log(arrays[0] === arrays[1]); 5565 * // => false 5566 */ 5567 function stubArray() { 5568 return []; 5569 } 5570 5571 /** 5572 * This method returns `false`. 5573 * 5574 * @static 5575 * @memberOf _ 5576 * @since 4.13.0 5577 * @category Util 5578 * @returns {boolean} Returns `false`. 5579 * @example 5580 * 5581 * _.times(2, _.stubFalse); 5582 * // => [false, false] 5583 */ 5584 function stubFalse() { 5585 return false; 5586 } 5587 5588 module.exports = cloneDeep; 5589 5590 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(8)(module))) 5591 5592/***/ }, 5593/* 8 */ 5594/***/ function(module, exports) { 5595 5596 module.exports = function(module) { 5597 if(!module.webpackPolyfill) { 5598 module.deprecate = function() {}; 5599 module.paths = []; 5600 // module.parent = undefined by default 5601 module.children = []; 5602 module.webpackPolyfill = 1; 5603 } 5604 return module; 5605 } 5606 5607 5608/***/ }, 5609/* 9 */ 5610/***/ function(module, exports, __webpack_require__) { 5611 5612 var isBuffer = __webpack_require__(10) 5613 5614 module.exports = flatten 5615 flatten.flatten = flatten 5616 flatten.unflatten = unflatten 5617 5618 function flatten (target, opts) { 5619 opts = opts || {} 5620 5621 var delimiter = opts.delimiter || '.' 5622 var maxDepth = opts.maxDepth 5623 var output = {} 5624 5625 function step (object, prev, currentDepth) { 5626 currentDepth = currentDepth || 1 5627 Object.keys(object).forEach(function (key) { 5628 var value = object[key] 5629 var isarray = opts.safe && Array.isArray(value) 5630 var type = Object.prototype.toString.call(value) 5631 var isbuffer = isBuffer(value) 5632 var isobject = ( 5633 type === '[object Object]' || 5634 type === '[object Array]' 5635 ) 5636 5637 var newKey = prev 5638 ? prev + delimiter + key
5639 : key 5640 5641 if (!isarray && !isbuffer && isobject && Object.keys(value).length && 5642 (!opts.maxDepth || currentDepth < maxDepth)) { 5643 return step(value, newKey, currentDepth + 1) 5644 } 5645 5646 output[newKey] = value 5647 }) 5648 } 5649 5650 step(target) 5651 5652 return output 5653 } 5654 5655 function unflatten (target, opts) { 5656 opts = opts || {} 5657 5658 var delimiter = opts.delimiter || '.' 5659 var overwrite = opts.overwrite || false 5660 var result = {} 5661 5662 var isbuffer = isBuffer(target) 5663 if (isbuffer || Object.prototype.toString.call(target) !== '[object Object]') { 5664 return target 5665 } 5666 5667 // safely ensure that the key is 5668 // an integer. 5669 function getkey (key) { 5670 var parsedKey = Number(key) 5671 5672 return ( 5673 isNaN(parsedKey) || 5674 key.indexOf('.') !== -1 || 5675 opts.object 5676 ) ? key 5677 : parsedKey 5678 } 5679 5680 var sortedKeys = Object.keys(target).sort(function (keyA, keyB) { 5681 return keyA.length - keyB.length 5682 }) 5683 5684 sortedKeys.forEach(function (key) { 5685 var split = key.split(delimiter) 5686 var key1 = getkey(split.shift()) 5687 var key2 = getkey(split[0]) 5688 var recipient = result 5689 5690 while (key2 !== undefined) { 5691 var type = Object.prototype.toString.call(recipient[key1]) 5692 var isobject = ( 5693 type === '[object Object]' || 5694 type === '[object Array]' 5695 ) 5696 5697 // do not write over falsey, non-undefined values if overwrite is false 5698 if (!overwrite && !isobject && typeof recipient[key1] !== 'undefined') { 5699 return 5700 } 5701 5702 if ((overwrite && !isobject) || (!overwrite && recipient[key1] == null)) { 5703 recipient[key1] = ( 5704 typeof key2 === 'number' && 5705 !opts.object ? [] : {} 5706 ) 5707 } 5708 5709 recipient = recipient[key1] 5710 if (split.length > 0) { 5711 key1 = getkey(split.shift()) 5712 key2 = getkey(split[0]) 5713 } 5714 } 5715 5716 // unflatten again for 'messy objects' 5717 recipient[key1] = unflatten(target[key], opts) 5718 }) 5719 5720 return result 5721 } 5722 5723 5724/***/ }, 5725/* 10 */ 5726/***/ function(module, exports) { 5727 5728 /*! 5729 * Determine if an object is a Buffer 5730 * 5731 * @author Feross Aboukhadijeh <[email protected]> <http://feross.org> 5732 * @license MIT 5733 */ 5734 5735 // The _isBuffer check is for Safari 5-7 support, because it's missing 5736 // Object.prototype.constructor. Remove this eventually 5737 module.exports = function (obj) { 5738 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) 5739 } 5740 5741 function isBuffer (obj) { 5742 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) 5743 } 5744 5745 // For Node v0.10 support. Remove this eventually. 5746 function isSlowBuffer (obj) { 5747 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) 5748 } 5749 5750 5751/***/ } 5752/******/ ]) 5753}); 5754;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.