@feathersjs/client 5.0.0-pre.10 → 5.0.0-pre.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/feathers.js CHANGED
@@ -20,9 +20,9 @@ return /******/ (function() { // webpackBootstrap
20
20
  "use strict";
21
21
 
22
22
 
23
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
23
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
24
24
 
25
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
25
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
26
26
 
27
27
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
28
28
 
@@ -38,7 +38,7 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
38
38
 
39
39
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
40
40
 
41
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
41
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
42
42
 
43
43
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
44
44
 
@@ -54,7 +54,7 @@ exports.HOOKS = Symbol('@feathersjs/hooks');
54
54
  * The base hook context.
55
55
  */
56
56
 
57
- var BaseHookContext = function BaseHookContext() {
57
+ var BaseHookContext = /*#__PURE__*/_createClass(function BaseHookContext() {
58
58
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
59
59
 
60
60
  _classCallCheck(this, BaseHookContext);
@@ -66,7 +66,7 @@ var BaseHookContext = function BaseHookContext() {
66
66
  value: void 0
67
67
  });
68
68
  Object.assign(this, data);
69
- };
69
+ });
70
70
 
71
71
  exports.BaseHookContext = BaseHookContext;
72
72
 
@@ -229,7 +229,7 @@ var HookManager = /*#__PURE__*/function () {
229
229
  return _this;
230
230
  }
231
231
 
232
- return ContextClass;
232
+ return _createClass(ContextClass);
233
233
  }(Base);
234
234
 
235
235
  var params = this.getParams();
@@ -771,11 +771,7 @@ exports.copyFnProperties = copyFnProperties;
771
771
  "use strict";
772
772
 
773
773
 
774
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
775
-
776
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
777
-
778
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
774
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
779
775
 
780
776
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
781
777
 
@@ -789,9 +785,13 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
789
785
 
790
786
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
791
787
 
788
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
789
+
790
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
791
+
792
792
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
793
793
 
794
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
794
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
795
795
 
796
796
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
797
797
 
@@ -825,7 +825,7 @@ var OauthError = /*#__PURE__*/function (_errors_1$FeathersErr) {
825
825
  return _super.call(this, message, 'OauthError', 401, 'oauth-error', data);
826
826
  }
827
827
 
828
- return OauthError;
828
+ return _createClass(OauthError);
829
829
  }(errors_1.FeathersError);
830
830
 
831
831
  var getMatch = function getMatch(location, key) {
@@ -1282,7 +1282,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
1282
1282
 
1283
1283
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1284
1284
 
1285
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1285
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1286
1286
 
1287
1287
  Object.defineProperty(exports, "__esModule", ({
1288
1288
  value: true
@@ -1407,7 +1407,7 @@ exports.createDebug = createDebug;
1407
1407
 
1408
1408
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
1409
1409
 
1410
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
1410
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1411
1411
 
1412
1412
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
1413
1413
 
@@ -1588,15 +1588,15 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
1588
1588
 
1589
1589
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
1590
1590
 
1591
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
1591
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
1592
1592
 
1593
1593
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1594
1594
 
1595
1595
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
1596
1596
 
1597
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
1597
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
1598
1598
 
1599
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
1599
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
1600
1600
 
1601
1601
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
1602
1602
 
@@ -1695,7 +1695,7 @@ var BadRequest = /*#__PURE__*/function (_FeathersError) {
1695
1695
  return _super2.call(this, message, 'BadRequest', 400, 'bad-request', data);
1696
1696
  }
1697
1697
 
1698
- return BadRequest;
1698
+ return _createClass(BadRequest);
1699
1699
  }(FeathersError);
1700
1700
 
1701
1701
  exports.BadRequest = BadRequest; // 401 - Not Authenticated
@@ -1711,7 +1711,7 @@ var NotAuthenticated = /*#__PURE__*/function (_FeathersError2) {
1711
1711
  return _super3.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);
1712
1712
  }
1713
1713
 
1714
- return NotAuthenticated;
1714
+ return _createClass(NotAuthenticated);
1715
1715
  }(FeathersError);
1716
1716
 
1717
1717
  exports.NotAuthenticated = NotAuthenticated; // 402 - Payment Error
@@ -1727,7 +1727,7 @@ var PaymentError = /*#__PURE__*/function (_FeathersError3) {
1727
1727
  return _super4.call(this, message, 'PaymentError', 402, 'payment-error', data);
1728
1728
  }
1729
1729
 
1730
- return PaymentError;
1730
+ return _createClass(PaymentError);
1731
1731
  }(FeathersError);
1732
1732
 
1733
1733
  exports.PaymentError = PaymentError; // 403 - Forbidden
@@ -1743,7 +1743,7 @@ var Forbidden = /*#__PURE__*/function (_FeathersError4) {
1743
1743
  return _super5.call(this, message, 'Forbidden', 403, 'forbidden', data);
1744
1744
  }
1745
1745
 
1746
- return Forbidden;
1746
+ return _createClass(Forbidden);
1747
1747
  }(FeathersError);
1748
1748
 
1749
1749
  exports.Forbidden = Forbidden; // 404 - Not Found
@@ -1759,7 +1759,7 @@ var NotFound = /*#__PURE__*/function (_FeathersError5) {
1759
1759
  return _super6.call(this, message, 'NotFound', 404, 'not-found', data);
1760
1760
  }
1761
1761
 
1762
- return NotFound;
1762
+ return _createClass(NotFound);
1763
1763
  }(FeathersError);
1764
1764
 
1765
1765
  exports.NotFound = NotFound; // 405 - Method Not Allowed
@@ -1775,7 +1775,7 @@ var MethodNotAllowed = /*#__PURE__*/function (_FeathersError6) {
1775
1775
  return _super7.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);
1776
1776
  }
1777
1777
 
1778
- return MethodNotAllowed;
1778
+ return _createClass(MethodNotAllowed);
1779
1779
  }(FeathersError);
1780
1780
 
1781
1781
  exports.MethodNotAllowed = MethodNotAllowed; // 406 - Not Acceptable
@@ -1791,7 +1791,7 @@ var NotAcceptable = /*#__PURE__*/function (_FeathersError7) {
1791
1791
  return _super8.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);
1792
1792
  }
1793
1793
 
1794
- return NotAcceptable;
1794
+ return _createClass(NotAcceptable);
1795
1795
  }(FeathersError);
1796
1796
 
1797
1797
  exports.NotAcceptable = NotAcceptable; // 408 - Timeout
@@ -1807,7 +1807,7 @@ var Timeout = /*#__PURE__*/function (_FeathersError8) {
1807
1807
  return _super9.call(this, message, 'Timeout', 408, 'timeout', data);
1808
1808
  }
1809
1809
 
1810
- return Timeout;
1810
+ return _createClass(Timeout);
1811
1811
  }(FeathersError);
1812
1812
 
1813
1813
  exports.Timeout = Timeout; // 409 - Conflict
@@ -1823,7 +1823,7 @@ var Conflict = /*#__PURE__*/function (_FeathersError9) {
1823
1823
  return _super10.call(this, message, 'Conflict', 409, 'conflict', data);
1824
1824
  }
1825
1825
 
1826
- return Conflict;
1826
+ return _createClass(Conflict);
1827
1827
  }(FeathersError);
1828
1828
 
1829
1829
  exports.Conflict = Conflict; // 410 - Gone
@@ -1839,7 +1839,7 @@ var Gone = /*#__PURE__*/function (_FeathersError10) {
1839
1839
  return _super11.call(this, message, 'Gone', 410, 'gone', data);
1840
1840
  }
1841
1841
 
1842
- return Gone;
1842
+ return _createClass(Gone);
1843
1843
  }(FeathersError);
1844
1844
 
1845
1845
  exports.Gone = Gone; // 411 - Length Required
@@ -1855,7 +1855,7 @@ var LengthRequired = /*#__PURE__*/function (_FeathersError11) {
1855
1855
  return _super12.call(this, message, 'LengthRequired', 411, 'length-required', data);
1856
1856
  }
1857
1857
 
1858
- return LengthRequired;
1858
+ return _createClass(LengthRequired);
1859
1859
  }(FeathersError);
1860
1860
 
1861
1861
  exports.LengthRequired = LengthRequired; // 422 Unprocessable
@@ -1871,7 +1871,7 @@ var Unprocessable = /*#__PURE__*/function (_FeathersError12) {
1871
1871
  return _super13.call(this, message, 'Unprocessable', 422, 'unprocessable', data);
1872
1872
  }
1873
1873
 
1874
- return Unprocessable;
1874
+ return _createClass(Unprocessable);
1875
1875
  }(FeathersError);
1876
1876
 
1877
1877
  exports.Unprocessable = Unprocessable; // 429 Too Many Requests
@@ -1887,7 +1887,7 @@ var TooManyRequests = /*#__PURE__*/function (_FeathersError13) {
1887
1887
  return _super14.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);
1888
1888
  }
1889
1889
 
1890
- return TooManyRequests;
1890
+ return _createClass(TooManyRequests);
1891
1891
  }(FeathersError);
1892
1892
 
1893
1893
  exports.TooManyRequests = TooManyRequests; // 500 - General Error
@@ -1903,7 +1903,7 @@ var GeneralError = /*#__PURE__*/function (_FeathersError14) {
1903
1903
  return _super15.call(this, message, 'GeneralError', 500, 'general-error', data);
1904
1904
  }
1905
1905
 
1906
- return GeneralError;
1906
+ return _createClass(GeneralError);
1907
1907
  }(FeathersError);
1908
1908
 
1909
1909
  exports.GeneralError = GeneralError; // 501 - Not Implemented
@@ -1919,7 +1919,7 @@ var NotImplemented = /*#__PURE__*/function (_FeathersError15) {
1919
1919
  return _super16.call(this, message, 'NotImplemented', 501, 'not-implemented', data);
1920
1920
  }
1921
1921
 
1922
- return NotImplemented;
1922
+ return _createClass(NotImplemented);
1923
1923
  }(FeathersError);
1924
1924
 
1925
1925
  exports.NotImplemented = NotImplemented; // 502 - Bad Gateway
@@ -1935,7 +1935,7 @@ var BadGateway = /*#__PURE__*/function (_FeathersError16) {
1935
1935
  return _super17.call(this, message, 'BadGateway', 502, 'bad-gateway', data);
1936
1936
  }
1937
1937
 
1938
- return BadGateway;
1938
+ return _createClass(BadGateway);
1939
1939
  }(FeathersError);
1940
1940
 
1941
1941
  exports.BadGateway = BadGateway; // 503 - Unavailable
@@ -1951,7 +1951,7 @@ var Unavailable = /*#__PURE__*/function (_FeathersError17) {
1951
1951
  return _super18.call(this, message, 'Unavailable', 503, 'unavailable', data);
1952
1952
  }
1953
1953
 
1954
- return Unavailable;
1954
+ return _createClass(Unavailable);
1955
1955
  }(FeathersError);
1956
1956
 
1957
1957
  exports.Unavailable = Unavailable;
@@ -2020,7 +2020,7 @@ exports.convert = convert;
2020
2020
  "use strict";
2021
2021
 
2022
2022
 
2023
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
2023
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2024
2024
 
2025
2025
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2026
2026
 
@@ -2042,9 +2042,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
2042
2042
 
2043
2043
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2044
2044
 
2045
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
2045
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2046
2046
 
2047
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
2047
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
2048
2048
 
2049
2049
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2050
2050
 
@@ -2079,7 +2079,7 @@ var index_1 = __webpack_require__(/*! ./hooks/index */ "../feathers/lib/hooks/in
2079
2079
 
2080
2080
  var service_1 = __webpack_require__(/*! ./service */ "../feathers/lib/service.js");
2081
2081
 
2082
- var legacy_1 = __webpack_require__(/*! ./hooks/legacy */ "../feathers/lib/hooks/legacy.js");
2082
+ var regular_1 = __webpack_require__(/*! ./hooks/regular */ "../feathers/lib/hooks/regular.js");
2083
2083
 
2084
2084
  var debug = (0, dependencies_1.createDebug)('@feathersjs/feathers');
2085
2085
 
@@ -2100,7 +2100,7 @@ var Feathers = /*#__PURE__*/function (_dependencies_1$Event) {
2100
2100
  _this.version = version_1.default;
2101
2101
  _this._isSetup = false;
2102
2102
  _this.appHooks = _defineProperty({}, dependencies_1.HOOKS, [events_1.eventHook]);
2103
- _this.legacyHooks = (0, legacy_1.enableLegacyHooks)(_assertThisInitialized(_this));
2103
+ _this.regularHooks = (0, regular_1.enableRegularHooks)(_assertThisInitialized(_this));
2104
2104
  return _this;
2105
2105
  }
2106
2106
 
@@ -2160,7 +2160,7 @@ var Feathers = /*#__PURE__*/function (_dependencies_1$Event) {
2160
2160
  }
2161
2161
 
2162
2162
  var protoService = (0, service_1.wrapService)(location, service, options);
2163
- var serviceOptions = (0, service_1.getServiceOptions)(service, options);
2163
+ var serviceOptions = (0, service_1.getServiceOptions)(protoService);
2164
2164
 
2165
2165
  var _iterator = _createForOfIteratorHelper(service_1.protectedMethods),
2166
2166
  _step;
@@ -2198,10 +2198,10 @@ var Feathers = /*#__PURE__*/function (_dependencies_1$Event) {
2198
2198
  value: function hooks(hookMap) {
2199
2199
  var _this3 = this;
2200
2200
 
2201
- var legacyMap = hookMap;
2201
+ var regularMap = hookMap;
2202
2202
 
2203
- if (legacyMap.before || legacyMap.after || legacyMap.error) {
2204
- return this.legacyHooks(legacyMap);
2203
+ if (regularMap.before || regularMap.after || regularMap.error) {
2204
+ return this.regularHooks(regularMap);
2205
2205
  }
2206
2206
 
2207
2207
  if (Array.isArray(hookMap)) {
@@ -2379,7 +2379,7 @@ exports.eventMixin = eventMixin;
2379
2379
  "use strict";
2380
2380
 
2381
2381
 
2382
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
2382
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2383
2383
 
2384
2384
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2385
2385
 
@@ -2397,13 +2397,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
2397
2397
 
2398
2398
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2399
2399
 
2400
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
2400
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2401
2401
 
2402
- function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }
2402
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
2403
2403
 
2404
2404
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
2405
2405
 
2406
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
2406
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
2407
2407
 
2408
2408
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2409
2409
 
@@ -2420,30 +2420,50 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
2420
2420
  Object.defineProperty(exports, "__esModule", ({
2421
2421
  value: true
2422
2422
  }));
2423
- exports.hookMixin = exports.FeathersHookManager = exports.createContext = exports.fromErrorHooks = exports.fromBeforeHook = exports.fromAfterHook = void 0;
2423
+ exports.hookMixin = exports.FeathersHookManager = exports.createContext = exports.fromErrorHooks = exports.fromErrorHook = exports.fromAfterHooks = exports.fromAfterHook = exports.fromBeforeHooks = exports.fromBeforeHook = void 0;
2424
2424
 
2425
2425
  var dependencies_1 = __webpack_require__(/*! ../dependencies */ "../feathers/lib/dependencies.js");
2426
2426
 
2427
2427
  var service_1 = __webpack_require__(/*! ../service */ "../feathers/lib/service.js");
2428
2428
 
2429
- var legacy_1 = __webpack_require__(/*! ./legacy */ "../feathers/lib/hooks/legacy.js");
2429
+ var regular_1 = __webpack_require__(/*! ./regular */ "../feathers/lib/hooks/regular.js");
2430
+
2431
+ var regular_2 = __webpack_require__(/*! ./regular */ "../feathers/lib/hooks/regular.js");
2430
2432
 
2433
+ Object.defineProperty(exports, "fromBeforeHook", ({
2434
+ enumerable: true,
2435
+ get: function get() {
2436
+ return regular_2.fromBeforeHook;
2437
+ }
2438
+ }));
2439
+ Object.defineProperty(exports, "fromBeforeHooks", ({
2440
+ enumerable: true,
2441
+ get: function get() {
2442
+ return regular_2.fromBeforeHooks;
2443
+ }
2444
+ }));
2431
2445
  Object.defineProperty(exports, "fromAfterHook", ({
2432
2446
  enumerable: true,
2433
2447
  get: function get() {
2434
- return legacy_1.fromAfterHook;
2448
+ return regular_2.fromAfterHook;
2435
2449
  }
2436
2450
  }));
2437
- Object.defineProperty(exports, "fromBeforeHook", ({
2451
+ Object.defineProperty(exports, "fromAfterHooks", ({
2452
+ enumerable: true,
2453
+ get: function get() {
2454
+ return regular_2.fromAfterHooks;
2455
+ }
2456
+ }));
2457
+ Object.defineProperty(exports, "fromErrorHook", ({
2438
2458
  enumerable: true,
2439
2459
  get: function get() {
2440
- return legacy_1.fromBeforeHook;
2460
+ return regular_2.fromErrorHook;
2441
2461
  }
2442
2462
  }));
2443
2463
  Object.defineProperty(exports, "fromErrorHooks", ({
2444
2464
  enumerable: true,
2445
2465
  get: function get() {
2446
- return legacy_1.fromErrorHooks;
2466
+ return regular_2.fromErrorHooks;
2447
2467
  }
2448
2468
  }));
2449
2469
 
@@ -2482,12 +2502,12 @@ var FeathersHookManager = /*#__PURE__*/function (_dependencies_1$HookM) {
2482
2502
  value: function collectMiddleware(self, args) {
2483
2503
  var app = this.app;
2484
2504
  var appHooks = app.appHooks[dependencies_1.HOOKS].concat(app.appHooks[this.method] || []);
2485
- var legacyAppHooks = (0, legacy_1.collectLegacyHooks)(this.app, this.method);
2505
+ var regularAppHooks = (0, regular_1.collectRegularHooks)(this.app, this.method);
2486
2506
 
2487
2507
  var middleware = _get(_getPrototypeOf(FeathersHookManager.prototype), "collectMiddleware", this).call(this, self, args);
2488
2508
 
2489
- var legacyHooks = (0, legacy_1.collectLegacyHooks)(self, this.method);
2490
- return [].concat(_toConsumableArray(appHooks), _toConsumableArray(legacyAppHooks), _toConsumableArray(middleware), _toConsumableArray(legacyHooks));
2509
+ var regularHooks = (0, regular_1.collectRegularHooks)(self, this.method);
2510
+ return [].concat(_toConsumableArray(appHooks), _toConsumableArray(regularAppHooks), _toConsumableArray(middleware), _toConsumableArray(regularHooks));
2491
2511
  }
2492
2512
  }, {
2493
2513
  key: "initializeContext",
@@ -2519,7 +2539,8 @@ function hookMixin(service, path, options) {
2519
2539
  }
2520
2540
 
2521
2541
  var app = this;
2522
- var serviceMethodHooks = (0, service_1.getHookMethods)(service, options).reduce(function (res, method) {
2542
+ var hookMethods = (0, service_1.getHookMethods)(service, options);
2543
+ var serviceMethodHooks = hookMethods.reduce(function (res, method) {
2523
2544
  var _FeathersHookManager;
2524
2545
 
2525
2546
  var params = service_1.defaultServiceArguments[method] || ['data', 'params'];
@@ -2529,18 +2550,29 @@ function hookMixin(service, path, options) {
2529
2550
  method: method,
2530
2551
  service: service,
2531
2552
  event: null,
2532
- type: null
2553
+ type: null,
2554
+
2555
+ get statusCode() {
2556
+ var _a;
2557
+
2558
+ return (_a = this.http) === null || _a === void 0 ? void 0 : _a.statusCode;
2559
+ },
2560
+
2561
+ set statusCode(value) {
2562
+ (this.http || (this.http = {})).statusCode = value;
2563
+ }
2564
+
2533
2565
  });
2534
2566
  return res;
2535
2567
  }, {});
2536
- var handleLegacyHooks = (0, legacy_1.enableLegacyHooks)(service);
2568
+ var handleRegularHooks = (0, regular_1.enableRegularHooks)(service, hookMethods);
2537
2569
  (0, dependencies_1.hooks)(service, serviceMethodHooks);
2538
2570
 
2539
2571
  service.hooks = function (hookOptions) {
2540
2572
  var _this2 = this;
2541
2573
 
2542
2574
  if (hookOptions.before || hookOptions.after || hookOptions.error) {
2543
- return handleLegacyHooks.call(this, hookOptions);
2575
+ return handleRegularHooks.call(this, hookOptions);
2544
2576
  }
2545
2577
 
2546
2578
  if (Array.isArray(hookOptions)) {
@@ -2566,17 +2598,15 @@ exports.hookMixin = hookMixin;
2566
2598
 
2567
2599
  /***/ }),
2568
2600
 
2569
- /***/ "../feathers/lib/hooks/legacy.js":
2570
- /*!***************************************!*\
2571
- !*** ../feathers/lib/hooks/legacy.js ***!
2572
- \***************************************/
2601
+ /***/ "../feathers/lib/hooks/regular.js":
2602
+ /*!****************************************!*\
2603
+ !*** ../feathers/lib/hooks/regular.js ***!
2604
+ \****************************************/
2573
2605
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2574
2606
 
2575
2607
  "use strict";
2576
2608
 
2577
2609
 
2578
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
2579
-
2580
2610
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2581
2611
 
2582
2612
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -2591,28 +2621,35 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
2591
2621
 
2592
2622
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2593
2623
 
2594
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
2624
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2625
+
2626
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2595
2627
 
2596
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2628
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2597
2629
 
2598
2630
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2599
2631
 
2600
2632
  Object.defineProperty(exports, "__esModule", ({
2601
2633
  value: true
2602
2634
  }));
2603
- exports.enableLegacyHooks = exports.convertHookData = exports.collectLegacyHooks = exports.fromErrorHooks = exports.fromAfterHook = exports.fromBeforeHook = void 0;
2635
+ exports.enableRegularHooks = exports.convertHookData = exports.collectRegularHooks = exports.fromErrorHooks = exports.fromAfterHooks = exports.fromBeforeHooks = exports.fromErrorHook = exports.fromAfterHook = exports.fromBeforeHook = void 0;
2604
2636
 
2605
- var dependencies_1 = __webpack_require__(/*! ../dependencies */ "../feathers/lib/dependencies.js");
2637
+ var service_1 = __webpack_require__(/*! ../service */ "../feathers/lib/service.js");
2606
2638
 
2607
- var each = dependencies_1._.each;
2639
+ var runHook = function runHook(hook, context, type) {
2640
+ if (type) context.type = type;
2641
+ return Promise.resolve(hook.call(context.self, context)).then(function (res) {
2642
+ if (type) context.type = null;
2643
+
2644
+ if (res && res !== context) {
2645
+ Object.assign(context, res);
2646
+ }
2647
+ });
2648
+ };
2608
2649
 
2609
2650
  function fromBeforeHook(hook) {
2610
2651
  return function (context, next) {
2611
- context.type = 'before';
2612
- return Promise.resolve(hook.call(context.self, context)).then(function () {
2613
- context.type = null;
2614
- return next();
2615
- });
2652
+ return runHook(hook, context, 'before').then(next);
2616
2653
  };
2617
2654
  }
2618
2655
 
@@ -2621,49 +2658,24 @@ exports.fromBeforeHook = fromBeforeHook;
2621
2658
  function fromAfterHook(hook) {
2622
2659
  return function (context, next) {
2623
2660
  return next().then(function () {
2624
- context.type = 'after';
2625
- return hook.call(context.self, context);
2626
- }).then(function () {
2627
- context.type = null;
2661
+ return runHook(hook, context, 'after');
2628
2662
  });
2629
2663
  };
2630
2664
  }
2631
2665
 
2632
2666
  exports.fromAfterHook = fromAfterHook;
2633
2667
 
2634
- function fromErrorHooks(hooks) {
2668
+ function fromErrorHook(hook) {
2635
2669
  return function (context, next) {
2636
2670
  return next().catch(function (error) {
2637
- var promise = Promise.resolve();
2638
- context.original = _objectSpread({}, context);
2639
- context.error = error;
2640
- context.type = 'error';
2641
- delete context.result;
2642
-
2643
- var _iterator = _createForOfIteratorHelper(hooks),
2644
- _step;
2645
-
2646
- try {
2647
- var _loop = function _loop() {
2648
- var hook = _step.value;
2649
- promise = promise.then(function () {
2650
- return hook.call(context.self, context);
2651
- });
2652
- };
2653
-
2654
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
2655
- _loop();
2656
- }
2657
- } catch (err) {
2658
- _iterator.e(err);
2659
- } finally {
2660
- _iterator.f();
2671
+ if (context.error !== error || context.result !== undefined) {
2672
+ context.original = _objectSpread({}, context);
2673
+ context.error = error;
2674
+ delete context.result;
2661
2675
  }
2662
2676
 
2663
- return promise.then(function () {
2664
- context.type = null;
2665
-
2666
- if (context.result === undefined) {
2677
+ return runHook(hook, context, 'error').then(function () {
2678
+ if (context.result === undefined && context.error !== undefined) {
2667
2679
  throw context.error;
2668
2680
  }
2669
2681
  });
@@ -2671,99 +2683,179 @@ function fromErrorHooks(hooks) {
2671
2683
  };
2672
2684
  }
2673
2685
 
2674
- exports.fromErrorHooks = fromErrorHooks;
2686
+ exports.fromErrorHook = fromErrorHook;
2675
2687
 
2676
- function collectLegacyHooks(target, method) {
2677
- var _target$__hooks = target.__hooks,
2678
- _target$__hooks$befor = _target$__hooks.before[method],
2679
- before = _target$__hooks$befor === void 0 ? [] : _target$__hooks$befor,
2680
- _target$__hooks$after = _target$__hooks.after[method],
2681
- after = _target$__hooks$after === void 0 ? [] : _target$__hooks$after,
2682
- _target$__hooks$error = _target$__hooks.error[method],
2683
- error = _target$__hooks$error === void 0 ? [] : _target$__hooks$error;
2684
- var beforeHooks = before;
2688
+ var RunHooks = function RunHooks(hooks) {
2689
+ return function (context) {
2690
+ return hooks.reduce(function (promise, hook) {
2691
+ return promise.then(function () {
2692
+ return runHook(hook, context);
2693
+ });
2694
+ }, Promise.resolve(undefined));
2695
+ };
2696
+ };
2697
+
2698
+ function fromBeforeHooks(hooks) {
2699
+ return fromBeforeHook(RunHooks(hooks));
2700
+ }
2701
+
2702
+ exports.fromBeforeHooks = fromBeforeHooks;
2703
+
2704
+ function fromAfterHooks(hooks) {
2705
+ return fromAfterHook(RunHooks(hooks));
2706
+ }
2707
+
2708
+ exports.fromAfterHooks = fromAfterHooks;
2709
+
2710
+ function fromErrorHooks(hooks) {
2711
+ return fromErrorHook(RunHooks(hooks));
2712
+ }
2685
2713
 
2686
- var afterHooks = _toConsumableArray(after).reverse();
2714
+ exports.fromErrorHooks = fromErrorHooks;
2687
2715
 
2688
- var errorHook = fromErrorHooks(error);
2689
- return [errorHook].concat(_toConsumableArray(beforeHooks), _toConsumableArray(afterHooks));
2716
+ function collectRegularHooks(target, method) {
2717
+ return target.__hooks.hooks[method] || [];
2690
2718
  }
2691
2719
 
2692
- exports.collectLegacyHooks = collectLegacyHooks; // Converts different hook registration formats into the
2720
+ exports.collectRegularHooks = collectRegularHooks; // Converts different hook registration formats into the
2693
2721
  // same internal format
2694
2722
 
2695
- function convertHookData(obj) {
2696
- var hook = {};
2723
+ function convertHookData(input) {
2724
+ var result = {};
2697
2725
 
2698
- if (Array.isArray(obj)) {
2699
- hook = {
2700
- all: obj
2701
- };
2702
- } else if (_typeof(obj) !== 'object') {
2703
- hook = {
2704
- all: [obj]
2705
- };
2726
+ if (Array.isArray(input)) {
2727
+ result.all = input;
2728
+ } else if (_typeof(input) !== 'object') {
2729
+ result.all = [input];
2706
2730
  } else {
2707
- each(obj, function (value, key) {
2708
- hook[key] = !Array.isArray(value) ? [value] : value;
2709
- });
2731
+ for (var _i = 0, _Object$keys = Object.keys(input); _i < _Object$keys.length; _i++) {
2732
+ var key = _Object$keys[_i];
2733
+ var value = input[key];
2734
+ result[key] = Array.isArray(value) ? value : [value];
2735
+ }
2710
2736
  }
2711
2737
 
2712
- return hook;
2738
+ return result;
2713
2739
  }
2714
2740
 
2715
- exports.convertHookData = convertHookData; // Add `.hooks` functionality to an object
2741
+ exports.convertHookData = convertHookData;
2742
+ var types = ['before', 'after', 'error'];
2743
+
2744
+ var isType = function isType(value) {
2745
+ return types.includes(value);
2746
+ };
2747
+
2748
+ var wrappers = {
2749
+ before: fromBeforeHooks,
2750
+ after: fromAfterHooks,
2751
+ error: fromErrorHooks
2752
+ };
2753
+
2754
+ var createStore = function createStore(methods) {
2755
+ var store = {
2756
+ before: {},
2757
+ after: {},
2758
+ error: {},
2759
+ hooks: {}
2760
+ };
2761
+
2762
+ var _iterator = _createForOfIteratorHelper(methods),
2763
+ _step;
2764
+
2765
+ try {
2766
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
2767
+ var method = _step.value;
2768
+ store.hooks[method] = [];
2769
+ }
2770
+ } catch (err) {
2771
+ _iterator.e(err);
2772
+ } finally {
2773
+ _iterator.f();
2774
+ }
2716
2775
 
2717
- function enableLegacyHooks(obj) {
2718
- var methods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['find', 'get', 'create', 'update', 'patch', 'remove'];
2719
- var types = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ['before', 'after', 'error'];
2720
- var hookData = {};
2721
- types.forEach(function (type) {
2722
- // Initialize properties where hook functions are stored
2723
- hookData[type] = {};
2724
- }); // Add non-enumerable `__hooks` property to the object
2776
+ return store;
2777
+ };
2725
2778
 
2726
- Object.defineProperty(obj, '__hooks', {
2779
+ var setStore = function setStore(object, store) {
2780
+ Object.defineProperty(object, '__hooks', {
2727
2781
  configurable: true,
2728
- value: hookData,
2782
+ value: store,
2729
2783
  writable: true
2730
2784
  });
2731
- return function legacyHooks(allHooks) {
2732
- var _this = this;
2785
+ };
2786
+
2787
+ var getStore = function getStore(object) {
2788
+ return object.__hooks;
2789
+ };
2790
+
2791
+ var createMap = function createMap(input, methods) {
2792
+ var map = {};
2793
+ Object.keys(input).forEach(function (type) {
2794
+ if (!isType(type)) {
2795
+ throw new Error("'".concat(type, "' is not a valid hook type"));
2796
+ }
2733
2797
 
2734
- each(allHooks, function (current, type) {
2735
- if (!_this.__hooks[type]) {
2736
- throw new Error("'".concat(type, "' is not a valid hook type"));
2798
+ var data = convertHookData(input[type]);
2799
+ Object.keys(data).forEach(function (method) {
2800
+ if (method !== 'all' && !methods.includes(method)) {
2801
+ throw new Error("'".concat(method, "' is not a valid hook method"));
2737
2802
  }
2803
+ });
2804
+ map[type] = data;
2805
+ });
2806
+ return map;
2807
+ };
2738
2808
 
2739
- var hooks = convertHookData(current);
2740
- each(hooks, function (_value, method) {
2741
- if (method !== 'all' && methods.indexOf(method) === -1) {
2742
- throw new Error("'".concat(method, "' is not a valid hook method"));
2743
- }
2744
- });
2745
- methods.forEach(function (method) {
2746
- var _this$__hooks$type$me;
2809
+ var createAdapter = function createAdapter(type) {
2810
+ var hooks = [];
2811
+ var hook = wrappers[type](hooks);
2812
+ var adapter = Object.assign(hook, {
2813
+ hooks: hooks
2814
+ });
2815
+ return adapter;
2816
+ };
2747
2817
 
2748
- var currentHooks = [].concat(_toConsumableArray(hooks.all || []), _toConsumableArray(hooks[method] || []));
2749
- _this.__hooks[type][method] = _this.__hooks[type][method] || [];
2818
+ var updateStore = function updateStore(store, map) {
2819
+ Object.keys(store.hooks).forEach(function (method) {
2820
+ var adapted = false;
2821
+ Object.keys(map).forEach(function (key) {
2822
+ var _a;
2750
2823
 
2751
- if (type === 'before') {
2752
- currentHooks = currentHooks.map(fromBeforeHook);
2753
- }
2824
+ var type = key;
2825
+ var allHooks = map[type].all || [];
2826
+ var methodHooks = map[type][method] || [];
2754
2827
 
2755
- if (type === 'after') {
2756
- currentHooks = currentHooks.map(fromAfterHook);
2757
- }
2828
+ if (allHooks.length || methodHooks.length) {
2829
+ var _adapter$hooks;
2758
2830
 
2759
- (_this$__hooks$type$me = _this.__hooks[type][method]).push.apply(_this$__hooks$type$me, _toConsumableArray(currentHooks));
2760
- });
2831
+ var adapter = (_a = store[type])[method] || (_a[method] = (adapted = true, createAdapter(type)));
2832
+
2833
+ (_adapter$hooks = adapter.hooks).push.apply(_adapter$hooks, _toConsumableArray(allHooks).concat(_toConsumableArray(methodHooks)));
2834
+ }
2761
2835
  });
2836
+
2837
+ if (adapted) {
2838
+ store.hooks[method] = [store.error[method], store.before[method], store.after[method]].filter(function (hook) {
2839
+ return hook;
2840
+ });
2841
+ }
2842
+ });
2843
+ }; // Add `.hooks` functionality to an object
2844
+
2845
+
2846
+ function enableRegularHooks(object) {
2847
+ var methods = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : service_1.defaultServiceMethods;
2848
+ var store = createStore(methods);
2849
+ setStore(object, store);
2850
+ return function regularHooks(input) {
2851
+ var store = getStore(this);
2852
+ var map = createMap(input, methods);
2853
+ updateStore(store, map);
2762
2854
  return this;
2763
2855
  };
2764
2856
  }
2765
2857
 
2766
- exports.enableLegacyHooks = enableLegacyHooks;
2858
+ exports.enableRegularHooks = enableRegularHooks;
2767
2859
 
2768
2860
  /***/ }),
2769
2861
 
@@ -2849,9 +2941,9 @@ if (true) {
2849
2941
  "use strict";
2850
2942
 
2851
2943
 
2852
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
2944
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
2853
2945
 
2854
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
2946
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
2855
2947
 
2856
2948
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2857
2949
 
@@ -2878,7 +2970,7 @@ exports.defaultEventMap = {
2878
2970
  patch: 'patched',
2879
2971
  remove: 'removed'
2880
2972
  };
2881
- exports.protectedMethods = Object.keys(Object.prototype).concat(Object.keys(dependencies_1.EventEmitter.prototype)).concat(['before', 'after', 'error', 'hooks', 'setup', 'publish']);
2973
+ exports.protectedMethods = Object.keys(Object.prototype).concat(Object.keys(dependencies_1.EventEmitter.prototype)).concat(['all', 'before', 'after', 'error', 'hooks', 'setup', 'publish']);
2882
2974
 
2883
2975
  function getHookMethods(service, options) {
2884
2976
  var methods = options.methods;
@@ -2962,15 +3054,15 @@ exports["default"] = 'development';
2962
3054
  "use strict";
2963
3055
 
2964
3056
 
2965
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
3057
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2966
3058
 
2967
3059
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2968
3060
 
2969
3061
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2970
3062
 
2971
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3063
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2972
3064
 
2973
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
3065
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
2974
3066
 
2975
3067
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2976
3068
 
@@ -3042,7 +3134,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
3042
3134
 
3043
3135
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3044
3136
 
3045
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3137
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3046
3138
 
3047
3139
  var __importDefault = this && this.__importDefault || function (mod) {
3048
3140
  return mod && mod.__esModule ? mod : {
@@ -3233,15 +3325,15 @@ exports.Base = Base;
3233
3325
  "use strict";
3234
3326
 
3235
3327
 
3236
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
3328
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3237
3329
 
3238
3330
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3239
3331
 
3240
3332
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3241
3333
 
3242
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3334
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3243
3335
 
3244
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
3336
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
3245
3337
 
3246
3338
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3247
3339
 
@@ -3429,15 +3521,15 @@ if (true) {
3429
3521
  "use strict";
3430
3522
 
3431
3523
 
3432
- function _typeof(obj) { "@babel/helpers - typeof"; 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); }
3524
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3433
3525
 
3434
3526
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3435
3527
 
3436
3528
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3437
3529
 
3438
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3530
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3439
3531
 
3440
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
3532
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
3441
3533
 
3442
3534
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3443
3535
 
@@ -3582,7 +3674,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
3582
3674
 
3583
3675
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3584
3676
 
3585
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
3677
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3586
3678
 
3587
3679
  Object.defineProperty(exports, "__esModule", ({
3588
3680
  value: true
@@ -4878,11 +4970,24 @@ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
4878
4970
  var booleanValueOf = Boolean.prototype.valueOf;
4879
4971
  var objectToString = Object.prototype.toString;
4880
4972
  var functionToString = Function.prototype.toString;
4881
- var match = String.prototype.match;
4973
+ var $match = String.prototype.match;
4974
+ var $slice = String.prototype.slice;
4975
+ var $replace = String.prototype.replace;
4976
+ var $toUpperCase = String.prototype.toUpperCase;
4977
+ var $toLowerCase = String.prototype.toLowerCase;
4978
+ var $test = RegExp.prototype.test;
4979
+ var $concat = Array.prototype.concat;
4980
+ var $join = Array.prototype.join;
4981
+ var $arrSlice = Array.prototype.slice;
4982
+ var $floor = Math.floor;
4882
4983
  var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
4883
4984
  var gOPS = Object.getOwnPropertySymbols;
4884
4985
  var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
4885
4986
  var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
4987
+ // ie, `has-tostringtag/shams
4988
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
4989
+ ? Symbol.toStringTag
4990
+ : null;
4886
4991
  var isEnumerable = Object.prototype.propertyIsEnumerable;
4887
4992
 
4888
4993
  var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
@@ -4893,9 +4998,30 @@ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPr
4893
4998
  : null
4894
4999
  );
4895
5000
 
4896
- var inspectCustom = __webpack_require__(/*! ./util.inspect */ "?c95a").custom;
5001
+ function addNumericSeparator(num, str) {
5002
+ if (
5003
+ num === Infinity
5004
+ || num === -Infinity
5005
+ || num !== num
5006
+ || (num && num > -1000 && num < 1000)
5007
+ || $test.call(/e/, str)
5008
+ ) {
5009
+ return str;
5010
+ }
5011
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
5012
+ if (typeof num === 'number') {
5013
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
5014
+ if (int !== num) {
5015
+ var intStr = String(int);
5016
+ var dec = $slice.call(str, intStr.length + 1);
5017
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
5018
+ }
5019
+ }
5020
+ return $replace.call(str, sepRegex, '$&_');
5021
+ }
5022
+
5023
+ var inspectCustom = (__webpack_require__(/*! ./util.inspect */ "?c95a").custom);
4897
5024
  var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
4898
- var toStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag !== 'undefined' ? Symbol.toStringTag : null;
4899
5025
 
4900
5026
  module.exports = function inspect_(obj, options, depth, seen) {
4901
5027
  var opts = options || {};
@@ -4922,8 +5048,12 @@ module.exports = function inspect_(obj, options, depth, seen) {
4922
5048
  && opts.indent !== '\t'
4923
5049
  && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
4924
5050
  ) {
4925
- throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');
5051
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
4926
5052
  }
5053
+ if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
5054
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
5055
+ }
5056
+ var numericSeparator = opts.numericSeparator;
4927
5057
 
4928
5058
  if (typeof obj === 'undefined') {
4929
5059
  return 'undefined';
@@ -4942,10 +5072,12 @@ module.exports = function inspect_(obj, options, depth, seen) {
4942
5072
  if (obj === 0) {
4943
5073
  return Infinity / obj > 0 ? '0' : '-0';
4944
5074
  }
4945
- return String(obj);
5075
+ var str = String(obj);
5076
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
4946
5077
  }
4947
5078
  if (typeof obj === 'bigint') {
4948
- return String(obj) + 'n';
5079
+ var bigIntStr = String(obj) + 'n';
5080
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
4949
5081
  }
4950
5082
 
4951
5083
  var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
@@ -4964,7 +5096,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
4964
5096
 
4965
5097
  function inspect(value, from, noIndent) {
4966
5098
  if (from) {
4967
- seen = seen.slice();
5099
+ seen = $arrSlice.call(seen);
4968
5100
  seen.push(from);
4969
5101
  }
4970
5102
  if (noIndent) {
@@ -4982,21 +5114,21 @@ module.exports = function inspect_(obj, options, depth, seen) {
4982
5114
  if (typeof obj === 'function') {
4983
5115
  var name = nameOf(obj);
4984
5116
  var keys = arrObjKeys(obj, inspect);
4985
- return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + keys.join(', ') + ' }' : '');
5117
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
4986
5118
  }
4987
5119
  if (isSymbol(obj)) {
4988
- var symString = hasShammedSymbols ? String(obj).replace(/^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
5120
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
4989
5121
  return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
4990
5122
  }
4991
5123
  if (isElement(obj)) {
4992
- var s = '<' + String(obj.nodeName).toLowerCase();
5124
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
4993
5125
  var attrs = obj.attributes || [];
4994
5126
  for (var i = 0; i < attrs.length; i++) {
4995
5127
  s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
4996
5128
  }
4997
5129
  s += '>';
4998
5130
  if (obj.childNodes && obj.childNodes.length) { s += '...'; }
4999
- s += '</' + String(obj.nodeName).toLowerCase() + '>';
5131
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
5000
5132
  return s;
5001
5133
  }
5002
5134
  if (isArray(obj)) {
@@ -5005,12 +5137,15 @@ module.exports = function inspect_(obj, options, depth, seen) {
5005
5137
  if (indent && !singleLineValues(xs)) {
5006
5138
  return '[' + indentedJoin(xs, indent) + ']';
5007
5139
  }
5008
- return '[ ' + xs.join(', ') + ' ]';
5140
+ return '[ ' + $join.call(xs, ', ') + ' ]';
5009
5141
  }
5010
5142
  if (isError(obj)) {
5011
5143
  var parts = arrObjKeys(obj, inspect);
5144
+ if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
5145
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
5146
+ }
5012
5147
  if (parts.length === 0) { return '[' + String(obj) + ']'; }
5013
- return '{ [' + String(obj) + '] ' + parts.join(', ') + ' }';
5148
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
5014
5149
  }
5015
5150
  if (typeof obj === 'object' && customInspect) {
5016
5151
  if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
@@ -5058,14 +5193,14 @@ module.exports = function inspect_(obj, options, depth, seen) {
5058
5193
  var ys = arrObjKeys(obj, inspect);
5059
5194
  var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
5060
5195
  var protoTag = obj instanceof Object ? '' : 'null prototype';
5061
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? toStr(obj).slice(8, -1) : protoTag ? 'Object' : '';
5196
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
5062
5197
  var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
5063
- var tag = constructorTag + (stringTag || protoTag ? '[' + [].concat(stringTag || [], protoTag || []).join(': ') + '] ' : '');
5198
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
5064
5199
  if (ys.length === 0) { return tag + '{}'; }
5065
5200
  if (indent) {
5066
5201
  return tag + '{' + indentedJoin(ys, indent) + '}';
5067
5202
  }
5068
- return tag + '{ ' + ys.join(', ') + ' }';
5203
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
5069
5204
  }
5070
5205
  return String(obj);
5071
5206
  };
@@ -5076,7 +5211,7 @@ function wrapQuotes(s, defaultStyle, opts) {
5076
5211
  }
5077
5212
 
5078
5213
  function quote(s) {
5079
- return String(s).replace(/"/g, '&quot;');
5214
+ return $replace.call(String(s), /"/g, '&quot;');
5080
5215
  }
5081
5216
 
5082
5217
  function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
@@ -5127,7 +5262,7 @@ function toStr(obj) {
5127
5262
 
5128
5263
  function nameOf(f) {
5129
5264
  if (f.name) { return f.name; }
5130
- var m = match.call(functionToString.call(f), /^function\s*([\w$]+)/);
5265
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
5131
5266
  if (m) { return m[1]; }
5132
5267
  return null;
5133
5268
  }
@@ -5227,10 +5362,10 @@ function inspectString(str, opts) {
5227
5362
  if (str.length > opts.maxStringLength) {
5228
5363
  var remaining = str.length - opts.maxStringLength;
5229
5364
  var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
5230
- return inspectString(str.slice(0, opts.maxStringLength), opts) + trailer;
5365
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
5231
5366
  }
5232
5367
  // eslint-disable-next-line no-control-regex
5233
- var s = str.replace(/(['\\])/g, '\\$1').replace(/[\x00-\x1f]/g, lowbyte);
5368
+ var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
5234
5369
  return wrapQuotes(s, 'single', opts);
5235
5370
  }
5236
5371
 
@@ -5244,7 +5379,7 @@ function lowbyte(c) {
5244
5379
  13: 'r'
5245
5380
  }[n];
5246
5381
  if (x) { return '\\' + x; }
5247
- return '\\x' + (n < 0x10 ? '0' : '') + n.toString(16).toUpperCase();
5382
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
5248
5383
  }
5249
5384
 
5250
5385
  function markBoxed(str) {
@@ -5256,7 +5391,7 @@ function weakCollectionOf(type) {
5256
5391
  }
5257
5392
 
5258
5393
  function collectionOf(type, size, entries, indent) {
5259
- var joinedEntries = indent ? indentedJoin(entries, indent) : entries.join(', ');
5394
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
5260
5395
  return type + ' (' + size + ') {' + joinedEntries + '}';
5261
5396
  }
5262
5397
 
@@ -5274,20 +5409,20 @@ function getIndent(opts, depth) {
5274
5409
  if (opts.indent === '\t') {
5275
5410
  baseIndent = '\t';
5276
5411
  } else if (typeof opts.indent === 'number' && opts.indent > 0) {
5277
- baseIndent = Array(opts.indent + 1).join(' ');
5412
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
5278
5413
  } else {
5279
5414
  return null;
5280
5415
  }
5281
5416
  return {
5282
5417
  base: baseIndent,
5283
- prev: Array(depth + 1).join(baseIndent)
5418
+ prev: $join.call(Array(depth + 1), baseIndent)
5284
5419
  };
5285
5420
  }
5286
5421
 
5287
5422
  function indentedJoin(xs, indent) {
5288
5423
  if (xs.length === 0) { return ''; }
5289
5424
  var lineJoiner = '\n' + indent.prev + indent.base;
5290
- return lineJoiner + xs.join(',' + lineJoiner) + '\n' + indent.prev;
5425
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
5291
5426
  }
5292
5427
 
5293
5428
  function arrObjKeys(obj, inspect) {
@@ -5314,7 +5449,7 @@ function arrObjKeys(obj, inspect) {
5314
5449
  if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
5315
5450
  // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
5316
5451
  continue; // eslint-disable-line no-restricted-syntax, no-continue
5317
- } else if ((/[^\w$]/).test(key)) {
5452
+ } else if ($test.call(/[^\w$]/, key)) {
5318
5453
  xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
5319
5454
  } else {
5320
5455
  xs.push(key + ': ' + inspect(obj[key], obj));
@@ -5534,7 +5669,7 @@ var parseObject = function (chain, val, options, valuesParsed) {
5534
5669
  ) {
5535
5670
  obj = [];
5536
5671
  obj[index] = leaf;
5537
- } else {
5672
+ } else if (cleanRoot !== '__proto__') {
5538
5673
  obj[cleanRoot] = leaf;
5539
5674
  }
5540
5675
  }
@@ -5691,6 +5826,7 @@ var arrayPrefixGenerators = {
5691
5826
  };
5692
5827
 
5693
5828
  var isArray = Array.isArray;
5829
+ var split = String.prototype.split;
5694
5830
  var push = Array.prototype.push;
5695
5831
  var pushToArray = function (arr, valueOrArray) {
5696
5832
  push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
@@ -5727,6 +5863,8 @@ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
5727
5863
  || typeof v === 'bigint';
5728
5864
  };
5729
5865
 
5866
+ var sentinel = {};
5867
+
5730
5868
  var stringify = function stringify(
5731
5869
  object,
5732
5870
  prefix,
@@ -5746,8 +5884,23 @@ var stringify = function stringify(
5746
5884
  ) {
5747
5885
  var obj = object;
5748
5886
 
5749
- if (sideChannel.has(object)) {
5750
- throw new RangeError('Cyclic object value');
5887
+ var tmpSc = sideChannel;
5888
+ var step = 0;
5889
+ var findFlag = false;
5890
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
5891
+ // Where object last appeared in the ref tree
5892
+ var pos = tmpSc.get(object);
5893
+ step += 1;
5894
+ if (typeof pos !== 'undefined') {
5895
+ if (pos === step) {
5896
+ throw new RangeError('Cyclic object value');
5897
+ } else {
5898
+ findFlag = true; // Break while
5899
+ }
5900
+ }
5901
+ if (typeof tmpSc.get(sentinel) === 'undefined') {
5902
+ step = 0;
5903
+ }
5751
5904
  }
5752
5905
 
5753
5906
  if (typeof filter === 'function') {
@@ -5774,6 +5927,14 @@ var stringify = function stringify(
5774
5927
  if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
5775
5928
  if (encoder) {
5776
5929
  var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
5930
+ if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
5931
+ var valuesArray = split.call(String(obj), ',');
5932
+ var valuesJoined = '';
5933
+ for (var i = 0; i < valuesArray.length; ++i) {
5934
+ valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
5935
+ }
5936
+ return [formatter(keyValue) + '=' + valuesJoined];
5937
+ }
5777
5938
  return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
5778
5939
  }
5779
5940
  return [formatter(prefix) + '=' + formatter(String(obj))];
@@ -5788,7 +5949,7 @@ var stringify = function stringify(
5788
5949
  var objKeys;
5789
5950
  if (generateArrayPrefix === 'comma' && isArray(obj)) {
5790
5951
  // we need to join elements in
5791
- objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : undefined }];
5952
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
5792
5953
  } else if (isArray(filter)) {
5793
5954
  objKeys = filter;
5794
5955
  } else {
@@ -5796,9 +5957,9 @@ var stringify = function stringify(
5796
5957
  objKeys = sort ? keys.sort(sort) : keys;
5797
5958
  }
5798
5959
 
5799
- for (var i = 0; i < objKeys.length; ++i) {
5800
- var key = objKeys[i];
5801
- var value = typeof key === 'object' && key.value !== undefined ? key.value : obj[key];
5960
+ for (var j = 0; j < objKeys.length; ++j) {
5961
+ var key = objKeys[j];
5962
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
5802
5963
 
5803
5964
  if (skipNulls && value === null) {
5804
5965
  continue;
@@ -5808,8 +5969,9 @@ var stringify = function stringify(
5808
5969
  ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
5809
5970
  : prefix + (allowDots ? '.' + key : '[' + key + ']');
5810
5971
 
5811
- sideChannel.set(object, true);
5972
+ sideChannel.set(object, step);
5812
5973
  var valueSideChannel = getSideChannel();
5974
+ valueSideChannel.set(sentinel, sideChannel);
5813
5975
  pushToArray(values, stringify(
5814
5976
  value,
5815
5977
  keyPrefix,
@@ -5837,7 +5999,7 @@ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
5837
5999
  return defaults;
5838
6000
  }
5839
6001
 
5840
- if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') {
6002
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
5841
6003
  throw new TypeError('Encoder has to be a function.');
5842
6004
  }
5843
6005
 
@@ -6150,6 +6312,7 @@ var encode = function encode(str, defaultEncoder, charset, kind, format) {
6150
6312
 
6151
6313
  i += 1;
6152
6314
  c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
6315
+ /* eslint operator-linebreak: [2, "before"] */
6153
6316
  out += hexTable[0xF0 | (c >> 18)]
6154
6317
  + hexTable[0x80 | ((c >> 12) & 0x3F)]
6155
6318
  + hexTable[0x80 | ((c >> 6) & 0x3F)]