-
Notifications
You must be signed in to change notification settings - Fork 0
/
trim-right-x.js
1139 lines (968 loc) · 32.6 KB
/
trim-right-x.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*!
{
"author": "Graham Fairweather",
"copywrite": "Copyright (c) 2017",
"date": "2019-08-30T21:36:54.772Z",
"describe": "",
"description": "This method removes whitespace from the end of a string.",
"file": "trim-right-x.js",
"hash": "3d472650f5ba312feb64",
"license": "MIT",
"version": "4.1.2"
}
*/
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if(typeof define === 'function' && define.amd)
define([], factory);
else if(typeof exports === 'object')
exports["trimRightX"] = factory();
else
root["trimRightX"] = factory();
})((function () {
'use strict';
var ObjectCtr = {}.constructor;
var objectPrototype = ObjectCtr.prototype;
var defineProperty = ObjectCtr.defineProperty;
var $globalThis;
var getGlobalFallback = function() {
if (typeof self !== 'undefined') {
return self;
}
if (typeof window !== 'undefined') {
return window;
}
if (typeof global !== 'undefined') {
return global;
}
return void 0;
};
var returnThis = function() {
return this;
};
try {
if (defineProperty) {
defineProperty(objectPrototype, '$$globalThis$$', {
get: returnThis,
configurable: true
});
} else {
objectPrototype.__defineGetter__('$$globalThis$$', returnThis);
}
$globalThis = typeof $$globalThis$$ === 'undefined' ? getGlobalFallback() : $$globalThis$$;
delete objectPrototype.$$globalThis$$;
return $globalThis;
} catch (error) {
return getGlobalFallback();
}
}()), function() {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 5);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var toStr = Object.prototype.toString;
var hasSymbols = __webpack_require__(2)();
if (hasSymbols) {
var symToStr = Symbol.prototype.toString;
var symStringRegex = /^Symbol\(.*\)$/;
var isSymbolObject = function isRealSymbolObject(value) {
if (typeof value.valueOf() !== 'symbol') {
return false;
}
return symStringRegex.test(symToStr.call(value));
};
module.exports = function isSymbol(value) {
if (typeof value === 'symbol') {
return true;
}
if (toStr.call(value) !== '[object Symbol]') {
return false;
}
try {
return isSymbolObject(value);
} catch (e) {
return false;
}
};
} else {
module.exports = function isSymbol(value) {
// this environment does not support Symbols.
return false && false;
};
}
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var strValue = String.prototype.valueOf;
var tryStringObject = function tryStringObject(value) {
try {
strValue.call(value);
return true;
} catch (e) {
return false;
}
};
var toStr = Object.prototype.toString;
var strClass = '[object String]';
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
module.exports = function isString(value) {
if (typeof value === 'string') { return true; }
if (typeof value !== 'object') { return false; }
return hasToStringTag ? tryStringObject(value) : toStr.call(value) === strClass;
};
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function(global) {
var origSymbol = global.Symbol;
var hasSymbolSham = __webpack_require__(4);
module.exports = function hasNativeSymbols() {
if (typeof origSymbol !== 'function') { return false; }
if (typeof Symbol !== 'function') { return false; }
if (typeof origSymbol('foo') !== 'symbol') { return false; }
if (typeof Symbol('bar') !== 'symbol') { return false; }
return hasSymbolSham();
};
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(3)))
/***/ }),
/* 3 */
/***/ (function(module, exports) {
var g;
// This works in non-strict mode
g = (function() {
return this;
})();
try {
// This works if eval is allowed (see CSP)
g = g || new Function("return this")();
} catch (e) {
// This works if the window reference is available
if (typeof window === "object") g = window;
}
// g can still be undefined, but nothing to do about it...
// We return undefined, instead of nothing here, so it's
// easier to handle this case. if(!global) { ...}
module.exports = g;
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* eslint complexity: [2, 17], max-statements: [2, 33] */
module.exports = function hasSymbols() {
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
if (typeof Symbol.iterator === 'symbol') { return true; }
var obj = {};
var sym = Symbol('test');
var symObj = Object(sym);
if (typeof sym === 'string') { return false; }
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
// temp disabled per https://github.com/ljharb/object.assign/issues/17
// if (sym instanceof Symbol) { return false; }
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
// if (!(symObj instanceof Symbol)) { return false; }
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
var symVal = 42;
obj[sym] = symVal;
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
var syms = Object.getOwnPropertySymbols(obj);
if (syms.length !== 1 || syms[0] !== sym) { return false; }
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
if (typeof Object.getOwnPropertyDescriptor === 'function') {
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
}
return true;
};
/***/ }),
/* 5 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/is-nil-x/dist/is-nil-x.esm.js
/**
* Checks if `value` is `null` or `undefined`.
*
* @param {*} [value] - The value to check.
* @returns {boolean} Returns `true` if `value` is nullish, else `false`.
*/
var isNil = function isNil(value) {
/* eslint-disable-next-line lodash/prefer-is-nil */
return value === null || typeof value === 'undefined';
};
/* harmony default export */ var is_nil_x_esm = (isNil);
// CONCATENATED MODULE: ./node_modules/require-object-coercible-x/dist/require-object-coercible-x.esm.js
/**
* The abstract operation RequireObjectCoercible throws an error if argument
* is a value that cannot be converted to an Object using ToObject.
*
* @param {*} [value] - The `value` to check.
* @throws {TypeError} If `value` is a `null` or `undefined`.
* @returns {string} The `value`.
*/
var require_object_coercible_x_esm_requireObjectCoercible = function requireObjectCoercible(value) {
if (is_nil_x_esm(value)) {
throw new TypeError("Cannot call method on ".concat(value));
}
return value;
};
/* harmony default export */ var require_object_coercible_x_esm = (require_object_coercible_x_esm_requireObjectCoercible);
// EXTERNAL MODULE: ./node_modules/is-symbol/index.js
var is_symbol = __webpack_require__(0);
var is_symbol_default = /*#__PURE__*/__webpack_require__.n(is_symbol);
// CONCATENATED MODULE: ./node_modules/to-string-x/dist/to-string-x.esm.js
var ERROR_MESSAGE = 'Cannot convert a Symbol value to a string';
var castString = ERROR_MESSAGE.constructor;
/**
* The abstract operation ToString converts argument to a value of type String.
*
* @param {*} [value] - The value to convert to a string.
* @throws {TypeError} If `value` is a Symbol.
* @returns {string} The converted value.
*/
var to_string_x_esm_ToString = function ToString(value) {
if (is_symbol_default()(value)) {
throw new TypeError(ERROR_MESSAGE);
}
return castString(value);
};
/* harmony default export */ var to_string_x_esm = (to_string_x_esm_ToString);
// CONCATENATED MODULE: ./node_modules/require-coercible-to-string-x/dist/require-coercible-to-string-x.esm.js
/**
* This method requires an argument is corecible then converts using ToString.
*
* @param {*} [value] - The value to converted to a string.
* @throws {TypeError} If value is null or undefined.
* @returns {string} The value as a string.
*/
var require_coercible_to_string_x_esm_requireCoercibleToString = function requireCoercibleToString(value) {
return to_string_x_esm(require_object_coercible_x_esm(value));
};
/* harmony default export */ var require_coercible_to_string_x_esm = (require_coercible_to_string_x_esm_requireCoercibleToString);
// CONCATENATED MODULE: ./node_modules/white-space-x/dist/white-space-x.esm.js
/**
* A record of a white space character.
*
* @typedef {object} CharRecord
* @property {number} code - The character code.
* @property {string} description - A description of the character.
* @property {boolean} es5 - Whether the spec lists this as a white space.
* @property {boolean} es2015 - Whether the spec lists this as a white space.
* @property {boolean} es2016 - Whether the spec lists this as a white space.
* @property {boolean} es2017 - Whether the spec lists this as a white space.
* @property {boolean} es2018 - Whether the spec lists this as a white space.
* @property {string} string - The character string.
*/
/**
* An array of the whitespace char codes, string, descriptions and language
* presence in the specifications.
*
* @type Array.<CharRecord>
*/
var list = [{
code: 0x0009,
description: 'Tab',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\t"
}, {
code: 0x000a,
description: 'Line Feed',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\n"
}, {
code: 0x000b,
description: 'Vertical Tab',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\x0B"
}, {
code: 0x000c,
description: 'Form Feed',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\f"
}, {
code: 0x000d,
description: 'Carriage Return',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\r"
}, {
code: 0x0020,
description: 'Space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: " "
},
/*
{
code: 0x0085,
description: 'Next line',
es5: false,
es2015: false,
es2016: false,
es2017: false,
es2018: false,
string: '\u0085'
}
*/
{
code: 0x00a0,
description: 'No-break space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\xA0"
}, {
code: 0x1680,
description: 'Ogham space mark',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u1680"
}, {
code: 0x180e,
description: 'Mongolian vowel separator',
es5: true,
es2015: true,
es2016: true,
es2017: false,
es2018: false,
string: "\u180E"
}, {
code: 0x2000,
description: 'En quad',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2000"
}, {
code: 0x2001,
description: 'Em quad',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2001"
}, {
code: 0x2002,
description: 'En space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2002"
}, {
code: 0x2003,
description: 'Em space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2003"
}, {
code: 0x2004,
description: 'Three-per-em space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2004"
}, {
code: 0x2005,
description: 'Four-per-em space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2005"
}, {
code: 0x2006,
description: 'Six-per-em space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2006"
}, {
code: 0x2007,
description: 'Figure space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2007"
}, {
code: 0x2008,
description: 'Punctuation space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2008"
}, {
code: 0x2009,
description: 'Thin space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2009"
}, {
code: 0x200a,
description: 'Hair space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u200A"
},
/*
{
code: 0x200b,
description: 'Zero width space',
es5: false,
es2015: false,
es2016: false,
es2017: false,
es2018: false,
string: '\u200b'
},
*/
{
code: 0x2028,
description: 'Line separator',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2028"
}, {
code: 0x2029,
description: 'Paragraph separator',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u2029"
}, {
code: 0x202f,
description: 'Narrow no-break space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u202F"
}, {
code: 0x205f,
description: 'Medium mathematical space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u205F"
}, {
code: 0x3000,
description: 'Ideographic space',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\u3000"
}, {
code: 0xfeff,
description: 'Byte Order Mark',
es5: true,
es2015: true,
es2016: true,
es2017: true,
es2018: true,
string: "\uFEFF"
}];
/**
* A string of the ES5 to ES2016 whitespace characters.
*
* @type string
*/
var stringES2016 = '';
/**
* A string of the ES2017 to ES2018 whitespace characters.
*
* @type string
*/
var stringES2018 = '';
var white_space_x_esm_length = list.length;
for (var white_space_x_esm_i = 0; white_space_x_esm_i < white_space_x_esm_length; white_space_x_esm_i += 1) {
if (list[white_space_x_esm_i].es2016) {
stringES2016 += list[white_space_x_esm_i].string;
}
if (list[white_space_x_esm_i].es2018) {
stringES2018 += list[white_space_x_esm_i].string;
}
}
var string2018 = stringES2018;
/* harmony default export */ var white_space_x_esm = (string2018);
var string2016 = stringES2016;
// CONCATENATED MODULE: ./node_modules/is-primitive-x/dist/is-primitive-x.esm.js
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
/**
* Returns true if the value is a primitive.
*
* @param {*} [val] - The value to test.
* @returns {boolean} True if a primitive, otherwise false..
*/
var isPrimitive = function isPrimitive(val) {
return _typeof(val) === 'object' ? val === null : typeof val !== 'function';
};
/* harmony default export */ var is_primitive_x_esm = (isPrimitive);
// EXTERNAL MODULE: ./node_modules/is-string/index.js
var is_string = __webpack_require__(1);
var is_string_default = /*#__PURE__*/__webpack_require__.n(is_string);
// CONCATENATED MODULE: ./node_modules/has-boxed-string-x/dist/has-boxed-string-x.esm.js
var has_boxed_string_x_esm_string = 'a';
var boxedString = {}.constructor(has_boxed_string_x_esm_string);
/**
* Check failure of by-index access of string characters (IE < 9)
* and failure of `0 in boxedString` (Rhino).
*
* `true` if no failure; otherwise `false`.
*
* @type boolean
*/
var hasBoxed = boxedString[0] === has_boxed_string_x_esm_string && 0 in boxedString;
/* harmony default export */ var has_boxed_string_x_esm = (hasBoxed);
// CONCATENATED MODULE: ./node_modules/noop-x/dist/noop-x.esm.js
/**
* This method returns undefined.
*
* @returns {undefined} Always undefined.
*/
var noop = function noop() {};
/* eslint-disable-line lodash/prefer-noop */
/* harmony default export */ var noop_x_esm = (noop);
// CONCATENATED MODULE: ./node_modules/has-working-bind-x/dist/has-working-bind-x.esm.js
var has_working_bind_x_esm_bind = noop_x_esm.bind;
var test1 = function test1() {
var a1 = null;
var a2 = null;
var context = null;
var testThis = [];
var test1Fn = function test1Fn(arg1, arg2) {
/* eslint-disable-next-line babel/no-invalid-this */
context = this;
a1 = arg1;
a2 = arg2;
/* eslint-disable-next-line prefer-rest-params */
return arguments;
};
try {
var boundFn = has_working_bind_x_esm_bind.apply(test1Fn, [testThis, 1]);
var args = boundFn(2);
return boundFn.length === 1 && args.length === 2 && a1 === 1 && a2 === 2 && context === testThis;
} catch (e) {
return false;
}
};
var test2 = function test2() {
var a1 = null;
var a2 = null;
var context = null;
var oracle = [1, 2, 3];
var Ctr = function Ctr(arg1, arg2) {
a1 = arg1;
a2 = arg2;
context = this;
return oracle;
};
try {
var BoundFn = has_working_bind_x_esm_bind.apply(Ctr, [null]);
var returned = new BoundFn(1, 2);
return BoundFn.length === Ctr.length && returned === oracle && a1 === 1 && a2 === 2 && context !== oracle;
} catch (e) {
return false;
}
};
/**
* Indicates if the engine has a working bind function.
*
* @type {boolean}
*/
var isWorking = typeof has_working_bind_x_esm_bind === 'function' && test1() && test2();
/* harmony default export */ var has_working_bind_x_esm = (isWorking);
// CONCATENATED MODULE: ./node_modules/util-pusher-x/dist/util-pusher-x.esm.js
var EMPTY_STRING = '';
var split = EMPTY_STRING.split;
var max = Math.max;
var util_pusher_x_esm_bind = is_primitive_x_esm.bind,
util_pusher_x_esm_call = is_primitive_x_esm.call;
var stringSplit = function stringSplit(string, pattern) {
// noinspection JSUnresolvedFunction
return split.call(string, pattern);
};
var $split = has_working_bind_x_esm ? util_pusher_x_esm_bind.call(util_pusher_x_esm_call, split) : stringSplit;
var util_pusher_x_esm_getIterable = function getIterable(arrayLike) {
// noinspection JSUnresolvedFunction
return is_string_default()(arrayLike) ? $split(arrayLike, EMPTY_STRING) : arrayLike;
}; // eslint-disable jsdoc/no-undefined-types
// noinspection JSCommentMatchesSignature
/**
* This pushes or concatenates into a new or existing array.
*
* @param {Array} arrayLike - The source.
* @param {number} [from=0] - The from source index.
* @param {Array} [target=[]] - The target array.
* @returns {*} The target array.
*/
// eslint-enable jsdoc/no-undefined-types
var util_pusher_x_esm_pusher = function pusher(arrayLike, from) {
/* eslint-disable-next-line prefer-rest-params */
var target = arguments.length > 2 ? arguments[2] : [];
if (typeof arrayLike !== 'string' && is_primitive_x_esm(arrayLike)) {
return target;
}
var iterable = has_boxed_string_x_esm ? arrayLike : util_pusher_x_esm_getIterable(arrayLike);
var length = iterable.length;
for (var i = max(0, from) || 0; i < length; i += 1) {
target[target.length] = arrayLike[i];
}
return target;
};
/* harmony default export */ var util_pusher_x_esm = (util_pusher_x_esm_pusher);
// CONCATENATED MODULE: ./node_modules/simple-bind-x/dist/simple-bind-x.esm.js
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
var nativeBind = util_pusher_x_esm.bind,
simple_bind_x_esm_call = util_pusher_x_esm.call;
var simple_bind_x_esm_ERROR_MESSAGE = 'bind called on incompatible ';
var object = {};
var ObjectCtr = object.constructor;
var toStringTag = object.toString;
var funcType = '[object Function]';
var ZERO = 0;
var argsOffset = 2;
var getMax = function getMax(a, b) {
return a >= b ? a : b;
};
var simple_bind_x_esm_assertIsFunction = function assertIsFunction(value) {
if (typeof value !== 'function' && toStringTag.apply(value) !== funcType) {
throw new TypeError(simple_bind_x_esm_ERROR_MESSAGE + value);
}
};
var boundFns = [function zero(binder) {
return function boundFn() {
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */
return binder.apply(this, util_pusher_x_esm(arguments));
};
}, function one(binder, boundLength) {
return function boundFn(a) {
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a]));
};
}, function two(binder, boundLength) {
return function boundFn(a, b) {
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b]));
};
}, function three(binder, boundLength) {
/* eslint-disable-next-line max-params */
return function boundFn(a, b, c) {
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c]));
};
}, function four(binder, boundLength) {
/* eslint-disable-next-line max-params */
return function boundFn(a, b, c, d) {
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c, d]));
};
}, function five(binder, boundLength) {
/* eslint-disable-next-line max-params */
return function boundFn(a, b, c, d, e) {
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c, d, e]));
};
}, function six(binder, boundLength) {
/* eslint-disable-next-line max-params */
return function boundFn(a, b, c, d, e, f) {
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c, d, e, f]));
};
}, function seven(binder, boundLength) {
/* eslint-disable-next-line max-params */
return function boundFn(a, b, c, d, e, f, g) {
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c, d, e, f, g]));
};
}, function eight(binder, boundLength) {
/* eslint-disable-next-line max-params */
return function boundFn(a, b, c, d, e, f, g, h) {
/* eslint-disable-next-line babel/no-invalid-this,prefer-rest-params */
return binder.apply(this, util_pusher_x_esm(arguments, boundLength, [a, b, c, d, e, f, g, h]));
};
}];
var getBoundFn = function getBoundFn(args) {
var _args = _slicedToArray(args, 3),
binder = _args[0],
target = _args[1],
bindArgs = _args[2];
var boundLength = getMax(ZERO, target.length - getMax(ZERO, bindArgs.length - argsOffset));
var fn = boundFns[boundLength];
var boundFn = fn ? fn(binder, boundLength) : boundFns[ZERO](binder);
if (target.prototype) {
/* eslint-disable-next-line lodash/prefer-noop */
var Empty = function Empty() {};
Empty.prototype = target.prototype;
boundFn.prototype = new Empty();
Empty.prototype = null;
}
return boundFn;
};
var getResult = function getResult(target, boundArgs) {
/* eslint-disable-next-line babel/no-invalid-this */
var result = target.apply(this, boundArgs);
/* eslint-disable-next-line babel/no-invalid-this,babel/new-cap */
return ObjectCtr(result) === result ? result : this;
};
var implementation = function bind(target, thisArg) {
simple_bind_x_esm_assertIsFunction(target);
/* eslint-disable-next-line prefer-rest-params */