@ethlete/core 0.2.0-next.18 → 0.2.0-next.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -568,57 +568,57 @@ const set = (obj, key, val) => {
568
568
  else
569
569
  obj[key] = val.value;
570
570
  };
571
- const clone = (y) => {
572
- if (typeof x !== 'object')
573
- return x;
574
- var x = y;
575
- var i = 0, k, list, tmp, str = Object.prototype.toString.call(x);
571
+ const clone = (original) => {
572
+ if (typeof original !== 'object')
573
+ return original;
574
+ var _og = original;
575
+ var i = 0, k, list, tmp, str = Object.prototype.toString.call(_og);
576
576
  if (str === '[object Object]') {
577
- tmp = Object.create(x.__proto__ || null);
577
+ tmp = Object.create(_og.__proto__ || null);
578
578
  }
579
579
  else if (str === '[object Array]') {
580
- tmp = Array(x.length);
580
+ tmp = Array(_og.length);
581
581
  }
582
582
  else if (str === '[object Set]') {
583
583
  tmp = new Set();
584
- x.forEach(function (val) {
584
+ _og.forEach(function (val) {
585
585
  tmp.add(clone(val));
586
586
  });
587
587
  }
588
588
  else if (str === '[object Map]') {
589
589
  tmp = new Map();
590
- x.forEach(function (val, key) {
590
+ _og.forEach(function (val, key) {
591
591
  tmp.set(clone(key), clone(val));
592
592
  });
593
593
  }
594
594
  else if (str === '[object Date]') {
595
- tmp = new Date(+x);
595
+ tmp = new Date(+_og);
596
596
  }
597
597
  else if (str === '[object RegExp]') {
598
- tmp = new RegExp(x.source, x.flags);
598
+ tmp = new RegExp(_og.source, _og.flags);
599
599
  }
600
600
  else if (str === '[object DataView]') {
601
- tmp = new x.constructor(clone(x.buffer));
601
+ tmp = new _og.constructor(clone(_og.buffer));
602
602
  }
603
603
  else if (str === '[object ArrayBuffer]') {
604
- tmp = x.slice(0);
604
+ tmp = _og.slice(0);
605
605
  }
606
606
  else if (str.slice(-6) === 'Array]') {
607
607
  // ArrayBuffer.isView(x)
608
608
  // ~> `new` bcuz `Buffer.slice` => ref
609
- tmp = new x.constructor(x);
609
+ tmp = new _og.constructor(_og);
610
610
  }
611
611
  if (tmp) {
612
- for (list = Object.getOwnPropertySymbols(x); i < list.length; i++) {
613
- set(tmp, list[i], Object.getOwnPropertyDescriptor(x, list[i]));
612
+ for (list = Object.getOwnPropertySymbols(_og); i < list.length; i++) {
613
+ set(tmp, list[i], Object.getOwnPropertyDescriptor(_og, list[i]));
614
614
  }
615
- for (i = 0, list = Object.getOwnPropertyNames(x); i < list.length; i++) {
616
- if (Object.hasOwnProperty.call(tmp, (k = list[i])) && tmp[k] === x[k])
615
+ for (i = 0, list = Object.getOwnPropertyNames(_og); i < list.length; i++) {
616
+ if (Object.hasOwnProperty.call(tmp, (k = list[i])) && tmp[k] === _og[k])
617
617
  continue;
618
- set(tmp, k, Object.getOwnPropertyDescriptor(x, k));
618
+ set(tmp, k, Object.getOwnPropertyDescriptor(_og, k));
619
619
  }
620
620
  }
621
- return tmp || x;
621
+ return tmp || _og;
622
622
  };
623
623
 
624
624
  const hasCookie = (name) => {