diff --git a/dist/feathers-localstorage.js b/dist/feathers-localstorage.js index 29936e0..9705c12 100644 --- a/dist/feathers-localstorage.js +++ b/dist/feathers-localstorage.js @@ -103,7 +103,7 @@ return /******/ (function(modules) { // webpackBootstrap /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -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); } +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); } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -111,30 +111,34 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } -function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } - -function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } - 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); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - 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); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +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); }; } + +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } + +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } + +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } + +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } + var _require = __webpack_require__(/*! feathers-memory */ "./node_modules/feathers-memory/lib/index.js"), Service = _require.Service; var usedKeys = []; -var LocalStorage = -/*#__PURE__*/ -function (_Service) { +var LocalStorage = /*#__PURE__*/function (_Service) { _inherits(LocalStorage, _Service); + var _super = _createSuper(LocalStorage); + function LocalStorage() { var _this; @@ -142,7 +146,7 @@ function (_Service) { _classCallCheck(this, LocalStorage); - _this = _possibleConstructorReturn(this, _getPrototypeOf(LocalStorage).call(this, options)); + _this = _super.call(this, options); _this._storageKey = options.name || 'feathers'; _this._storage = options.storage || typeof window !== 'undefined' && window.localStorage; _this._throttle = options.throttle || 200; @@ -157,6 +161,7 @@ function (_Service) { usedKeys.push(_this._storageKey); } else { if (!_this._reuseKeys) { + // Allow reuse if options.reuseKeys set to true throw new Error("The storage name '".concat(_this._storageKey, "' is already in use by another instance.")); } } @@ -308,11 +313,12 @@ module.exports.Service = Service; "use strict"; -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); } +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); } Object.defineProperty(exports, "__esModule", { value: true }); +exports.OPERATORS = exports.FILTERS = void 0; var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "./node_modules/@feathersjs/commons/lib/index.js"); @@ -451,37 +457,81 @@ if (true) { "use strict"; -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +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."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } +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; } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } +var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function get() { + return m[k]; + } + }); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); -function __export(m) { +var __exportStar = this && this.__exportStar || function (m, exports) { for (var p in m) { - if (!exports.hasOwnProperty(p)) exports[p] = m[p]; + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); } -} +}; + +var __importDefault = this && this.__importDefault || function (mod) { + return mod && mod.__esModule ? mod : { + "default": mod + }; +}; Object.defineProperty(exports, "__esModule", { value: true }); +exports.select = exports.OPERATORS = exports.FILTERS = exports.filterQuery = exports.AdapterService = void 0; var commons_1 = __webpack_require__(/*! @feathersjs/commons */ "./node_modules/@feathersjs/commons/lib/index.js"); var service_1 = __webpack_require__(/*! ./service */ "./node_modules/@feathersjs/adapter-commons/lib/service.js"); -exports.AdapterService = service_1.AdapterService; +Object.defineProperty(exports, "AdapterService", { + enumerable: true, + get: function get() { + return service_1.AdapterService; + } +}); var filter_query_1 = __webpack_require__(/*! ./filter-query */ "./node_modules/@feathersjs/adapter-commons/lib/filter-query.js"); -exports.filterQuery = filter_query_1.default; -exports.FILTERS = filter_query_1.FILTERS; -exports.OPERATORS = filter_query_1.OPERATORS; +Object.defineProperty(exports, "filterQuery", { + enumerable: true, + get: function get() { + return __importDefault(filter_query_1).default; + } +}); +Object.defineProperty(exports, "FILTERS", { + enumerable: true, + get: function get() { + return filter_query_1.FILTERS; + } +}); +Object.defineProperty(exports, "OPERATORS", { + enumerable: true, + get: function get() { + return filter_query_1.OPERATORS; + } +}); -__export(__webpack_require__(/*! ./sort */ "./node_modules/@feathersjs/adapter-commons/lib/sort.js")); // Return a function that filters a result object or array +__exportStar(__webpack_require__(/*! ./sort */ "./node_modules/@feathersjs/adapter-commons/lib/sort.js"), exports); // Return a function that filters a result object or array // and picks only the fields passed as `params.query.$select` // and additional `otherFields` @@ -545,6 +595,7 @@ var __importDefault = this && this.__importDefault || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); +exports.AdapterService = void 0; var errors_1 = __webpack_require__(/*! @feathersjs/errors */ "./node_modules/@feathersjs/errors/lib/index.js"); @@ -568,9 +619,7 @@ var alwaysMulti = { update: false }; -var AdapterService = -/*#__PURE__*/ -function () { +var AdapterService = /*#__PURE__*/function () { function AdapterService(options) { _classCallCheck(this, AdapterService); @@ -695,9 +744,16 @@ exports.AdapterService = AdapterService; // Sorting algorithm taken from NeDB (https://github.com/louischatriot/nedb) // See https://github.com/louischatriot/nedb/blob/e3f0078499aa1005a59d0c2372e425ab789145c1/lib/model.js#L189 +function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +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; } + Object.defineProperty(exports, "__esModule", { value: true }); +exports.sorter = exports.compare = exports.compareArrays = exports.compareNSB = void 0; function compareNSB(a, b) { if (a < b) { @@ -829,12 +885,12 @@ function sorter($sort) { }); return function (a, b) { var compare; - var _iteratorNormalCompletion = true; - var _didIteratorError = false; - var _iteratorError = undefined; + + var _iterator = _createForOfIteratorHelper(criteria), + _step; try { - for (var _iterator = criteria[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + for (_iterator.s(); !(_step = _iterator.n()).done;) { var criterion = _step.value; compare = criterion.direction * exports.compare(a[criterion.key], b[criterion.key]); @@ -843,18 +899,9 @@ function sorter($sort) { } } } catch (err) { - _didIteratorError = true; - _iteratorError = err; + _iterator.e(err); } finally { - try { - if (!_iteratorNormalCompletion && _iterator.return != null) { - _iterator.return(); - } - } finally { - if (_didIteratorError) { - throw _iteratorError; - } - } + _iterator.f(); } return 0; @@ -875,11 +922,12 @@ exports.sorter = sorter; "use strict"; -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); } +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); } Object.defineProperty(exports, "__esModule", { value: true }); +exports.enableHooks = exports.processHooks = exports.getHooks = exports.isHookObject = exports.convertHookData = exports.makeArguments = exports.defaultMakeArguments = exports.createHookObject = exports.ACTIVATE_HOOKS = void 0; var utils_1 = __webpack_require__(/*! ./utils */ "./node_modules/@feathersjs/commons/lib/utils.js"); @@ -1108,29 +1156,54 @@ exports.enableHooks = enableHooks; "use strict"; -function __export(m) { - for (var p in m) { - if (!exports.hasOwnProperty(p)) exports[p] = m[p]; - } -} +var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { + enumerable: true, + get: function get() { + return m[k]; + } + }); +} : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) { + Object.defineProperty(o, "default", { + enumerable: true, + value: v + }); +} : function (o, v) { + o["default"] = v; +}); var __importStar = this && this.__importStar || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) { - if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); } - result["default"] = mod; + + __setModuleDefault(result, mod); + return result; }; +var __exportStar = this && this.__exportStar || function (m, exports) { + for (var p in m) { + if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); + } +}; + Object.defineProperty(exports, "__esModule", { value: true }); +exports.hooks = void 0; var hookUtils = __importStar(__webpack_require__(/*! ./hooks */ "./node_modules/@feathersjs/commons/lib/hooks.js")); -__export(__webpack_require__(/*! ./utils */ "./node_modules/@feathersjs/commons/lib/utils.js")); +__exportStar(__webpack_require__(/*! ./utils */ "./node_modules/@feathersjs/commons/lib/utils.js"), exports); exports.hooks = hookUtils; @@ -1148,19 +1221,24 @@ exports.hooks = hookUtils; 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; } -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); } +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); } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } +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; } -function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } 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 _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 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; } Object.defineProperty(exports, "__esModule", { value: true -}); // Removes all leading and trailing slashes from a path +}); +exports.createSymbol = exports.makeUrl = exports.isPromise = exports._ = exports.stripSlashes = void 0; // Removes all leading and trailing slashes from a path function stripSlashes(name) { return name.replace(/^(\/+)|(\/+)$/g, ''); @@ -1310,7 +1388,7 @@ exports.createSymbol = createSymbol; /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -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); } +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); } var debug = __webpack_require__(/*! debug */ "./node_modules/debug/src/browser.js")('@feathersjs/errors'); @@ -1445,7 +1523,13 @@ function Conflict(message, data) { FeathersError.call(this, message, 'Conflict', 409, 'conflict', data); } -inheritsFrom(Conflict, FeathersError); // 411 - Length Required +inheritsFrom(Conflict, FeathersError); // 410 - Gone + +function Gone(message, data) { + FeathersError(this, message, 'Gone', 410, 'gone', data); +} + +inheritsFrom(Gone, FeathersError); // 411 - Length Required function LengthRequired(message, data) { FeathersError.call(this, message, 'LengthRequired', 411, 'length-required', data); @@ -1499,6 +1583,7 @@ var errors = { NotAcceptable: NotAcceptable, Timeout: Timeout, Conflict: Conflict, + Gone: Gone, LengthRequired: LengthRequired, Unprocessable: Unprocessable, TooManyRequests: TooManyRequests, @@ -1515,6 +1600,7 @@ var errors = { 406: NotAcceptable, 408: Timeout, 409: Conflict, + 410: Gone, 411: LengthRequired, 422: Unprocessable, 429: TooManyRequests, @@ -1552,23 +1638,31 @@ module.exports = Object.assign({ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -/* WEBPACK VAR INJECTION */(function(process) {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); } - -/* eslint-env browser */ +/* WEBPACK VAR INJECTION */(function(process) {/* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ -exports.log = log; exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); + +exports.destroy = function () { + var warned = false; + return function () { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +}(); /** * Colors. */ + exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, @@ -1637,20 +1731,16 @@ function formatArgs(args) { args.splice(lastC, 0, c); } /** - * Invokes `console.log()` when available. - * No-op when `console.log` is not a "function". + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. * * @api public */ -function log() { - var _console; - - // This hackery is required for IE8/9, where - // the `console.log` function doesn't have 'apply' - return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments); -} +exports.log = console.debug || console.log || function () {}; /** * Save `namespaces`. * @@ -1683,9 +1773,9 @@ function load() { try { r = exports.storage.getItem('debug'); - } catch (error) {} // Swallow - // XXX (@Qix-) should we be logging these? - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + } catch (error) {// Swallow + // XXX (@Qix-) should we be logging these? + } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { @@ -1740,13 +1830,17 @@ formatters.j = function (v) { /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } +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."); } -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +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; } /** * This is the common logic for both the Node.js and web browser @@ -1760,15 +1854,11 @@ function setup(env) { createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js"); + createDebug.destroy = destroy; Object.keys(env).forEach(function (key) { createDebug[key] = env[key]; }); /** - * Active `debug` instances. - */ - - createDebug.instances = []; - /** * The currently active debug mode names, and names to skip. */ @@ -1810,6 +1900,7 @@ function setup(env) { function createDebug(namespace) { var prevTime; + var enableOverride = null; function debug() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { @@ -1841,7 +1932,7 @@ function setup(env) { args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) { // If we encounter an escaped % then don't increase the array index if (match === '%%') { - return match; + return '%'; } index++; @@ -1864,33 +1955,29 @@ function setup(env) { } debug.namespace = namespace; - debug.enabled = createDebug.enabled(namespace); debug.useColors = createDebug.useColors(); - debug.color = selectColor(namespace); - debug.destroy = destroy; - debug.extend = extend; // Debug.formatArgs = formatArgs; - // debug.rawLog = rawLog; - // env-specific initialization logic for debug instances + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: function get() { + return enableOverride === null ? createDebug.enabled(namespace) : enableOverride; + }, + set: function set(v) { + enableOverride = v; + } + }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } - createDebug.instances.push(debug); return debug; } - function destroy() { - var index = createDebug.instances.indexOf(this); - - if (index !== -1) { - createDebug.instances.splice(index, 1); - return true; - } - - return false; - } - function extend(namespace, delimiter) { var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; @@ -1927,11 +2014,6 @@ function setup(env) { createDebug.names.push(new RegExp('^' + namespaces + '$')); } } - - for (i = 0; i < createDebug.instances.length; i++) { - var instance = createDebug.instances[i]; - instance.enabled = createDebug.enabled(instance.namespace); - } } /** * Disable debug output. @@ -2007,6 +2089,15 @@ function setup(env) { return val; } + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + + + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } createDebug.enable(createDebug.load()); return createDebug; @@ -2023,7 +2114,7 @@ module.exports = setup; /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -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); } +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); } 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; } @@ -2037,15 +2128,19 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } +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); } + +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } + +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); }; } + function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } - -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); } +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var errors = __webpack_require__(/*! @feathersjs/errors */ "./node_modules/@feathersjs/errors/lib/index.js"); @@ -2068,11 +2163,11 @@ var _select = function _select(data) { return base(JSON.parse(JSON.stringify(data))); }; -var Service = -/*#__PURE__*/ -function (_AdapterService) { +var Service = /*#__PURE__*/function (_AdapterService) { _inherits(Service, _AdapterService); + var _super = _createSuper(Service); + function Service() { var _this; @@ -2080,11 +2175,11 @@ function (_AdapterService) { _classCallCheck(this, Service); - _this = _possibleConstructorReturn(this, _getPrototypeOf(Service).call(this, _.extend({ + _this = _super.call(this, _.extend({ id: 'id', matcher: sift, sorter: sorter - }, options))); + }, options)); _this._uId = options.startId || 0; _this.store = options.store || {}; return _this; @@ -2093,9 +2188,7 @@ function (_AdapterService) { _createClass(Service, [{ key: "getEntries", value: function () { - var _getEntries = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee() { + var _getEntries = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() { var params, _this$filterQuery, query, @@ -2129,9 +2222,7 @@ function (_AdapterService) { }, { key: "_find", value: function () { - var _find2 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee2() { + var _find2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() { var params, _this$filterQuery2, query, @@ -2199,9 +2290,7 @@ function (_AdapterService) { }, { key: "_get", value: function () { - var _get2 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee3(id) { + var _get2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(id) { var params, _this$filterQuery3, query, @@ -2250,9 +2339,7 @@ function (_AdapterService) { }, { key: "_create", value: function () { - var _create2 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee4(data) { + var _create2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(data) { var _this2 = this; var params, @@ -2298,9 +2385,7 @@ function (_AdapterService) { }, { key: "_update", value: function () { - var _update2 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee5(id, data) { + var _update2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(id, data) { var params, oldEntry, oldId, @@ -2339,9 +2424,7 @@ function (_AdapterService) { }, { key: "_patch", value: function () { - var _patch2 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee6(id, data) { + var _patch2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(id, data) { var _this3 = this; var params, @@ -2399,9 +2482,7 @@ function (_AdapterService) { }, { key: "_remove", value: function () { - var _remove2 = _asyncToGenerator( - /*#__PURE__*/ - regeneratorRuntime.mark(function _callee7(id) { + var _remove2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(id) { var _this4 = this; var params, @@ -2844,13 +2925,17 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return sift; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compare", function() { return compare; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "comparable", function() { return comparable; }); -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); } +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); } + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } +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; } -function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } 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 _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 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; } diff --git a/dist/feathers-localstorage.js.map b/dist/feathers-localstorage.js.map index 2a1e143..9c5f1d1 100644 --- a/dist/feathers-localstorage.js.map +++ b/dist/feathers-localstorage.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://feathers.localstorage/webpack/universalModuleDefinition","webpack://feathers.localstorage/webpack/bootstrap","webpack://feathers.localstorage/./lib/index.js","webpack://feathers.localstorage/../src/filter-query.ts","webpack://feathers.localstorage/../src/index.ts","webpack://feathers.localstorage/../src/service.ts","webpack://feathers.localstorage/../src/sort.ts","webpack://feathers.localstorage/../src/hooks.ts","webpack://feathers.localstorage/../src/utils.ts","webpack://feathers.localstorage/./node_modules/@feathersjs/errors/lib/index.js","webpack://feathers.localstorage/./node_modules/debug/src/browser.js","webpack://feathers.localstorage/./node_modules/debug/src/common.js","webpack://feathers.localstorage/./node_modules/feathers-memory/lib/index.js","webpack://feathers.localstorage/./node_modules/ms/index.js","webpack://feathers.localstorage/./node_modules/process/browser.js","webpack://feathers.localstorage/./node_modules/sift/src/index.js"],"names":["require","Service","usedKeys","LocalStorage","options","_storageKey","name","_storage","storage","window","localStorage","_throttle","throttle","_reuseKeys","reuseKeys","store","Error","indexOf","push","ready","Promise","resolve","getItem","then","str","JSON","parse","keys","Object","last","length","_uId","id","data","_timeout","setTimeout","setItem","stringify","method","args","execute","flush","module","exports","init","debug","FeathersError","msg","code","className","errors","message","newData","type","captureStackTrace","stack","inheritsFrom","Child","Parent","prototype","create","constructor","defineProperty","value","BadRequest","call","NotAuthenticated","PaymentError","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","Timeout","Conflict","LengthRequired","Unprocessable","TooManyRequests","GeneralError","NotImplemented","BadGateway","Unavailable","convert","error","result","assign","log","formatArgs","save","load","useColors","localstorage","colors","process","__nwjs","navigator","userAgent","toLowerCase","match","document","documentElement","style","WebkitAppearance","console","firebug","exception","table","parseInt","RegExp","$1","namespace","humanize","diff","c","color","splice","index","lastC","replace","namespaces","removeItem","r","env","DEBUG","formatters","j","v","setup","createDebug","default","coerce","disable","enable","enabled","forEach","key","instances","names","skips","selectColor","hash","i","charCodeAt","Math","abs","prevTime","self","curr","Number","Date","ms","prev","unshift","format","formatter","val","logFn","apply","destroy","extend","delimiter","newDebug","split","len","substr","instance","map","toNamespace","join","test","regexp","toString","substring","_","sorter","select","AdapterService","sift","_select","base","matcher","startId","params","filterQuery","query","_find","paginate","filters","values","filter","total","$sort","undefined","sort","$skip","slice","$limit","limit","skip","Array","isArray","all","current","_create","_get","oldEntry","oldId","patchEntry","entry","currentId","omit","getEntries","entries","_remove","typeChecker","typeString","isObject","isFunction","get","obj","nestable","validator","validateOptions","valueOwner","nestedResults","Boolean","find","or","n","and","validate","defaultExpressions","$eq","$ne","$gt","$gte","$lt","$lte","$mod","$in","$nin","$not","$type","testType","$all","allOptions","$and","$size","sizeMatch","$or","orOptions","$nor","$regex","$where","$elemMatch","search","$exists","hasOwnProperty","prepare","queryOwner","comparable","compare","Function","comparableValue","String","createRootValidator","eq","$options","array","createValidator","validatedNested","keyPath","child","results","findValues","inclusive","allValid","allValues","keypath","object","k","isNaN","createNestedValidator","isVanillaObject","expressions","wrapQuery","parseQuery","validators","queryValue","expression","keyParts","parseNested","isExactObject","isEqual","parseRoot","a","b","getAllKeys","allKeysHash","getTime","toJSON"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eClFoBA,mBAAO,CAAC,oEAAD,C;IAAnBC,O,YAAAA,O;;AAER,IAAMC,QAAQ,GAAG,EAAjB;;IAEMC,Y;;;;;AACJ,0BAA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AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACjKA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAA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zB,WAAOA,KAAK,CAACsG,GAAN,CAAU8F,UAAV,CAAP;AACD,GAFM,MAEA,IAAIpM,KAAK,IAAI,OAAOA,KAAK,CAAC4O,MAAb,KAAwB,UAArC,EAAiD;AACtD,WAAO5O,KAAK,CAAC4O,MAAN,EAAP;AACD,GAFM,MAEA;AACL,WAAO5O,KAAP;AACD;AACF,C","file":"feathers-localstorage.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"localstorage\"] = factory();\n\telse\n\t\troot[\"feathers\"] = root[\"feathers\"] || {}, root[\"feathers\"][\"localstorage\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./lib/index.js\");\n","const { Service } = require('feathers-memory');\n\nconst usedKeys = [];\n\nclass LocalStorage extends Service {\n constructor (options = {}) {\n super(options);\n this._storageKey = options.name || 'feathers';\n this._storage = options.storage || (typeof window !== 'undefined' && window.localStorage);\n this._throttle = options.throttle || 200;\n this._reuseKeys = options.reuseKeys || false;\n this.store = null;\n\n if (!this._storage) {\n throw new Error('The `storage` option needs to be provided');\n }\n\n if (usedKeys.indexOf(this._storageKey) === -1) {\n usedKeys.push(this._storageKey);\n } else {\n if (!this._reuseKeys) {\n throw new Error(`The storage name '${this._storageKey}' is already in use by another instance.`);\n }\n }\n\n this.ready();\n }\n\n ready () {\n if (!this.store) {\n return Promise.resolve(this._storage.getItem(this._storageKey))\n .then(str => JSON.parse(str || '{}'))\n .then(store => {\n const keys = Object.keys(store);\n const last = store[keys[keys.length - 1]];\n\n // Current id is the id of the last item\n this._uId = (keys.length && typeof last[this.id] !== 'undefined') ? last[this.id] + 1 : this._uId;\n\n return (this.store = store);\n });\n }\n\n return Promise.resolve(this.store);\n }\n\n flush (data) {\n if (!this._timeout) {\n this._timeout = setTimeout(() => {\n this._storage.setItem(this._storageKey, JSON.stringify(this.store));\n delete this._timeout;\n }, this._throttle);\n }\n\n return data;\n }\n\n execute (method, ...args) {\n return this.ready()\n .then(() => super[method](...args));\n }\n\n find (...args) {\n return this.execute('find', ...args);\n }\n\n get (...args) {\n return this.execute('get', ...args);\n }\n\n create (...args) {\n return this.execute('create', ...args)\n .then(data => this.flush(data));\n }\n\n patch (...args) {\n return this.execute('patch', ...args)\n .then(data => this.flush(data));\n }\n\n update (...args) {\n return this.execute('update', ...args)\n .then(data => this.flush(data));\n }\n\n remove (...args) {\n return this.execute('remove', ...args)\n .then(data => this.flush(data));\n }\n}\n\nmodule.exports = function init (options) {\n return new LocalStorage(options);\n};\n\nmodule.exports.Service = Service;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst commons_1 = require(\"@feathersjs/commons\");\nconst errors_1 = require(\"@feathersjs/errors\");\nfunction parse(number) {\n if (typeof number !== 'undefined') {\n return Math.abs(parseInt(number, 10));\n }\n return undefined;\n}\n// Returns the pagination limit and will take into account the\n// default and max pagination settings\nfunction getLimit(limit, paginate) {\n if (paginate && paginate.default) {\n const lower = typeof limit === 'number' && !isNaN(limit) ? limit : paginate.default;\n const upper = typeof paginate.max === 'number' ? paginate.max : Number.MAX_VALUE;\n return Math.min(lower, upper);\n }\n return limit;\n}\n// Makes sure that $sort order is always converted to an actual number\nfunction convertSort(sort) {\n if (typeof sort !== 'object' || Array.isArray(sort)) {\n return sort;\n }\n return Object.keys(sort).reduce((result, key) => {\n result[key] = typeof sort[key] === 'object'\n ? sort[key] : parseInt(sort[key], 10);\n return result;\n }, {});\n}\nfunction cleanQuery(query, operators, filters) {\n if (Array.isArray(query)) {\n return query.map(value => cleanQuery(value, operators, filters));\n }\n else if (commons_1._.isObject(query) && query.constructor === {}.constructor) {\n const result = {};\n commons_1._.each(query, (value, key) => {\n if (key[0] === '$') {\n if (filters[key] !== undefined) {\n return;\n }\n if (!operators.includes(key)) {\n throw new errors_1.BadRequest(`Invalid query parameter ${key}`, query);\n }\n }\n result[key] = cleanQuery(value, operators, filters);\n });\n Object.getOwnPropertySymbols(query).forEach(symbol => {\n // @ts-ignore\n result[symbol] = query[symbol];\n });\n return result;\n }\n return query;\n}\nfunction assignFilters(object, query, filters, options) {\n if (Array.isArray(filters)) {\n commons_1._.each(filters, (key) => {\n if (query[key] !== undefined) {\n object[key] = query[key];\n }\n });\n }\n else {\n commons_1._.each(filters, (converter, key) => {\n const converted = converter(query[key], options);\n if (converted !== undefined) {\n object[key] = converted;\n }\n });\n }\n return object;\n}\nexports.FILTERS = {\n $sort: (value) => convertSort(value),\n $limit: (value, options) => getLimit(parse(value), options.paginate),\n $skip: (value) => parse(value),\n $select: (value) => value\n};\nexports.OPERATORS = ['$in', '$nin', '$lt', '$lte', '$gt', '$gte', '$ne', '$or'];\n// Converts Feathers special query parameters and pagination settings\n// and returns them separately a `filters` and the rest of the query\n// as `query`\nfunction filterQuery(query, options = {}) {\n const { filters: additionalFilters = {}, operators: additionalOperators = [] } = options;\n const result = {};\n result.filters = assignFilters({}, query, exports.FILTERS, options);\n result.filters = assignFilters(result.filters, query, additionalFilters, options);\n result.query = cleanQuery(query, exports.OPERATORS.concat(additionalOperators), result.filters);\n return result;\n}\nexports.default = filterQuery;\nif (typeof module !== 'undefined') {\n module.exports = Object.assign(filterQuery, module.exports);\n}\n//# sourceMappingURL=filter-query.js.map","\"use strict\";\nfunction __export(m) {\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\n}\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst hookUtils = __importStar(require(\"./hooks\"));\n__export(require(\"./utils\"));\nexports.hooks = hookUtils;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst errors_1 = require(\"@feathersjs/errors\");\nconst filter_query_1 = __importDefault(require(\"./filter-query\"));\nconst callMethod = (self, name, ...args) => {\n if (typeof self[name] !== 'function') {\n return Promise.reject(new errors_1.NotImplemented(`Method ${name} not available`));\n }\n return self[name](...args);\n};\nconst alwaysMulti = {\n find: true,\n get: false,\n update: false\n};\nclass AdapterService {\n constructor(options) {\n this.options = Object.assign({\n id: 'id',\n events: [],\n paginate: {},\n multi: false,\n filters: [],\n whitelist: []\n }, options);\n }\n get id() {\n return this.options.id;\n }\n get events() {\n return this.options.events;\n }\n filterQuery(params = {}, opts = {}) {\n const paginate = typeof params.paginate !== 'undefined'\n ? params.paginate : this.options.paginate;\n const { query = {} } = params;\n const options = Object.assign({\n operators: this.options.whitelist || [],\n filters: this.options.filters,\n paginate\n }, opts);\n const result = filter_query_1.default(query, options);\n return Object.assign(result, { paginate });\n }\n allowsMulti(method) {\n const always = alwaysMulti[method];\n if (typeof always !== 'undefined') {\n return always;\n }\n const option = this.options.multi;\n if (option === true || option === false) {\n return option;\n }\n else {\n return option.includes(method);\n }\n }\n find(params) {\n return callMethod(this, '_find', params);\n }\n get(id, params) {\n return callMethod(this, '_get', id, params);\n }\n create(data, params) {\n if (Array.isArray(data) && !this.allowsMulti('create')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not create multiple entries`));\n }\n return callMethod(this, '_create', data, params);\n }\n update(id, data, params) {\n if (id === null || Array.isArray(data)) {\n return Promise.reject(new errors_1.BadRequest(`You can not replace multiple instances. Did you mean 'patch'?`));\n }\n return callMethod(this, '_update', id, data, params);\n }\n patch(id, data, params) {\n if (id === null && !this.allowsMulti('patch')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not patch multiple entries`));\n }\n return callMethod(this, '_patch', id, data, params);\n }\n remove(id, params) {\n if (id === null && !this.allowsMulti('remove')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not remove multiple entries`));\n }\n return callMethod(this, '_remove', id, params);\n }\n}\nexports.AdapterService = AdapterService;\n//# sourceMappingURL=service.js.map","\"use strict\";\n// Sorting algorithm taken from NeDB (https://github.com/louischatriot/nedb)\n// See https://github.com/louischatriot/nedb/blob/e3f0078499aa1005a59d0c2372e425ab789145c1/lib/model.js#L189\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction compareNSB(a, b) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n}\nexports.compareNSB = compareNSB;\nfunction compareArrays(a, b) {\n let i;\n let comp;\n for (i = 0; i < Math.min(a.length, b.length); i += 1) {\n comp = exports.compare(a[i], b[i]);\n if (comp !== 0) {\n return comp;\n }\n }\n // Common section was identical, longest one wins\n return exports.compareNSB(a.length, b.length);\n}\nexports.compareArrays = compareArrays;\nfunction compare(a, b, compareStrings = exports.compareNSB) {\n const { compareNSB, compare, compareArrays } = exports;\n // undefined\n if (a === undefined) {\n return b === undefined ? 0 : -1;\n }\n if (b === undefined) {\n return a === undefined ? 0 : 1;\n }\n // null\n if (a === null) {\n return b === null ? 0 : -1;\n }\n if (b === null) {\n return a === null ? 0 : 1;\n }\n // Numbers\n if (typeof a === 'number') {\n return typeof b === 'number' ? compareNSB(a, b) : -1;\n }\n if (typeof b === 'number') {\n return typeof a === 'number' ? compareNSB(a, b) : 1;\n }\n // Strings\n if (typeof a === 'string') {\n return typeof b === 'string' ? compareStrings(a, b) : -1;\n }\n if (typeof b === 'string') {\n return typeof a === 'string' ? compareStrings(a, b) : 1;\n }\n // Booleans\n if (typeof a === 'boolean') {\n return typeof b === 'boolean' ? compareNSB(a, b) : -1;\n }\n if (typeof b === 'boolean') {\n return typeof a === 'boolean' ? compareNSB(a, b) : 1;\n }\n // Dates\n if (a instanceof Date) {\n return b instanceof Date ? compareNSB(a.getTime(), b.getTime()) : -1;\n }\n if (b instanceof Date) {\n return a instanceof Date ? compareNSB(a.getTime(), b.getTime()) : 1;\n }\n // Arrays (first element is most significant and so on)\n if (Array.isArray(a)) {\n return Array.isArray(b) ? compareArrays(a, b) : -1;\n }\n if (Array.isArray(b)) {\n return Array.isArray(a) ? compareArrays(a, b) : 1;\n }\n // Objects\n const aKeys = Object.keys(a).sort();\n const bKeys = Object.keys(b).sort();\n let comp = 0;\n for (let i = 0; i < Math.min(aKeys.length, bKeys.length); i += 1) {\n comp = compare(a[aKeys[i]], b[bKeys[i]]);\n if (comp !== 0) {\n return comp;\n }\n }\n return compareNSB(aKeys.length, bKeys.length);\n}\nexports.compare = compare;\n// An in-memory sorting function according to the\n// $sort special query parameter\nfunction sorter($sort) {\n const criteria = Object.keys($sort).map(key => {\n const direction = $sort[key];\n return { key, direction };\n });\n return function (a, b) {\n let compare;\n for (const criterion of criteria) {\n compare = criterion.direction * exports.compare(a[criterion.key], b[criterion.key]);\n if (compare !== 0) {\n return compare;\n }\n }\n return 0;\n };\n}\nexports.sorter = sorter;\n//# sourceMappingURL=sort.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"./utils\");\nconst { each, pick } = utils_1._;\nexports.ACTIVATE_HOOKS = utils_1.createSymbol('__feathersActivateHooks');\nfunction createHookObject(method, data = {}) {\n const hook = {};\n Object.defineProperty(hook, 'toJSON', {\n value() {\n return pick(this, 'type', 'method', 'path', 'params', 'id', 'data', 'result', 'error');\n }\n });\n return Object.assign(hook, data, {\n method,\n // A dynamic getter that returns the path of the service\n get path() {\n const { app, service } = data;\n if (!service || !app || !app.services) {\n return null;\n }\n return Object.keys(app.services)\n .find(path => app.services[path] === service);\n }\n });\n}\nexports.createHookObject = createHookObject;\n// Fallback used by `makeArguments` which usually won't be used\nfunction defaultMakeArguments(hook) {\n const result = [];\n if (typeof hook.id !== 'undefined') {\n result.push(hook.id);\n }\n if (hook.data) {\n result.push(hook.data);\n }\n result.push(hook.params || {});\n return result;\n}\nexports.defaultMakeArguments = defaultMakeArguments;\n// Turns a hook object back into a list of arguments\n// to call a service method with\nfunction makeArguments(hook) {\n switch (hook.method) {\n case 'find':\n return [hook.params];\n case 'get':\n case 'remove':\n return [hook.id, hook.params];\n case 'update':\n case 'patch':\n return [hook.id, hook.data, hook.params];\n case 'create':\n return [hook.data, hook.params];\n }\n return defaultMakeArguments(hook);\n}\nexports.makeArguments = makeArguments;\n// Converts different hook registration formats into the\n// same internal format\nfunction convertHookData(obj) {\n let hook = {};\n if (Array.isArray(obj)) {\n hook = { all: obj };\n }\n else if (typeof obj !== 'object') {\n hook = { all: [obj] };\n }\n else {\n each(obj, function (value, key) {\n hook[key] = !Array.isArray(value) ? [value] : value;\n });\n }\n return hook;\n}\nexports.convertHookData = convertHookData;\n// Duck-checks a given object to be a hook object\n// A valid hook object has `type` and `method`\nfunction isHookObject(hookObject) {\n return typeof hookObject === 'object' &&\n typeof hookObject.method === 'string' &&\n typeof hookObject.type === 'string';\n}\nexports.isHookObject = isHookObject;\n// Returns all service and application hooks combined\n// for a given method and type `appLast` sets if the hooks\n// from `app` should be added last (or first by default)\nfunction getHooks(app, service, type, method, appLast = false) {\n const appHooks = app.__hooks[type][method] || [];\n const serviceHooks = service.__hooks[type][method] || [];\n if (appLast) {\n // Run hooks in the order of service -> app -> finally\n return serviceHooks.concat(appHooks);\n }\n return appHooks.concat(serviceHooks);\n}\nexports.getHooks = getHooks;\nfunction processHooks(hooks, initialHookObject) {\n let hookObject = initialHookObject;\n const updateCurrentHook = (current) => {\n // Either use the returned hook object or the current\n // hook object from the chain if the hook returned undefined\n if (current) {\n if (!isHookObject(current)) {\n throw new Error(`${hookObject.type} hook for '${hookObject.method}' method returned invalid hook object`);\n }\n hookObject = current;\n }\n return hookObject;\n };\n // Go through all hooks and chain them into our promise\n const promise = hooks.reduce((current, fn) => {\n // @ts-ignore\n const hook = fn.bind(this);\n // Use the returned hook object or the old one\n return current.then((currentHook) => hook(currentHook)).then(updateCurrentHook);\n }, Promise.resolve(hookObject));\n return promise.then(() => hookObject).catch(error => {\n // Add the hook information to any errors\n error.hook = hookObject;\n throw error;\n });\n}\nexports.processHooks = processHooks;\n// Add `.hooks` functionality to an object\nfunction enableHooks(obj, methods, types) {\n if (typeof obj.hooks === 'function') {\n return obj;\n }\n const hookData = {};\n types.forEach(type => {\n // Initialize properties where hook functions are stored\n hookData[type] = {};\n });\n // Add non-enumerable `__hooks` property to the object\n Object.defineProperty(obj, '__hooks', {\n configurable: true,\n value: hookData,\n writable: true\n });\n return Object.assign(obj, {\n hooks(allHooks) {\n each(allHooks, (current, type) => {\n // @ts-ignore\n if (!this.__hooks[type]) {\n throw new Error(`'${type}' is not a valid hook type`);\n }\n const hooks = convertHookData(current);\n each(hooks, (_value, method) => {\n if (method !== 'all' && methods.indexOf(method) === -1) {\n throw new Error(`'${method}' is not a valid hook method`);\n }\n });\n methods.forEach(method => {\n // @ts-ignore\n const myHooks = this.__hooks[type][method] || (this.__hooks[type][method] = []);\n if (hooks.all) {\n myHooks.push.apply(myHooks, hooks.all);\n }\n if (hooks[method]) {\n myHooks.push.apply(myHooks, hooks[method]);\n }\n });\n });\n return this;\n }\n });\n}\nexports.enableHooks = enableHooks;\n//# sourceMappingURL=hooks.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// Removes all leading and trailing slashes from a path\nfunction stripSlashes(name) {\n return name.replace(/^(\\/+)|(\\/+)$/g, '');\n}\nexports.stripSlashes = stripSlashes;\n// A set of lodash-y utility functions that use ES6\nexports._ = {\n each(obj, callback) {\n if (obj && typeof obj.forEach === 'function') {\n obj.forEach(callback);\n }\n else if (exports._.isObject(obj)) {\n Object.keys(obj).forEach(key => callback(obj[key], key));\n }\n },\n some(value, callback) {\n return Object.keys(value)\n .map(key => [value[key], key])\n .some(([val, key]) => callback(val, key));\n },\n every(value, callback) {\n return Object.keys(value)\n .map(key => [value[key], key])\n .every(([val, key]) => callback(val, key));\n },\n keys(obj) {\n return Object.keys(obj);\n },\n values(obj) {\n return exports._.keys(obj).map(key => obj[key]);\n },\n isMatch(obj, item) {\n return exports._.keys(item).every(key => obj[key] === item[key]);\n },\n isEmpty(obj) {\n return exports._.keys(obj).length === 0;\n },\n isObject(item) {\n return (typeof item === 'object' && !Array.isArray(item) && item !== null);\n },\n isObjectOrArray(value) {\n return typeof value === 'object' && value !== null;\n },\n extend(first, ...rest) {\n return Object.assign(first, ...rest);\n },\n omit(obj, ...keys) {\n const result = exports._.extend({}, obj);\n keys.forEach(key => delete result[key]);\n return result;\n },\n pick(source, ...keys) {\n return keys.reduce((result, key) => {\n if (source[key] !== undefined) {\n result[key] = source[key];\n }\n return result;\n }, {});\n },\n // Recursively merge the source object into the target object\n merge(target, source) {\n if (exports._.isObject(target) && exports._.isObject(source)) {\n Object.keys(source).forEach(key => {\n if (exports._.isObject(source[key])) {\n if (!target[key]) {\n Object.assign(target, { [key]: {} });\n }\n exports._.merge(target[key], source[key]);\n }\n else {\n Object.assign(target, { [key]: source[key] });\n }\n });\n }\n return target;\n }\n};\n// Duck-checks if an object looks like a promise\nfunction isPromise(result) {\n return exports._.isObject(result) &&\n typeof result.then === 'function';\n}\nexports.isPromise = isPromise;\nfunction makeUrl(path, app = {}) {\n const get = typeof app.get === 'function' ? app.get.bind(app) : () => { };\n const env = get('env') || process.env.NODE_ENV;\n const host = get('host') || process.env.HOST_NAME || 'localhost';\n const protocol = (env === 'development' || env === 'test' || (env === undefined)) ? 'http' : 'https';\n const PORT = get('port') || process.env.PORT || 3030;\n const port = (env === 'development' || env === 'test' || (env === undefined)) ? `:${PORT}` : '';\n path = path || '';\n return `${protocol}://${host}${port}/${exports.stripSlashes(path)}`;\n}\nexports.makeUrl = makeUrl;\nfunction createSymbol(name) {\n return typeof Symbol !== 'undefined' ? Symbol(name) : name;\n}\nexports.createSymbol = createSymbol;\n//# sourceMappingURL=utils.js.map","const debug = require('debug')('@feathersjs/errors');\n\nfunction FeathersError (msg, name, code, className, data) {\n msg = msg || 'Error';\n\n let errors;\n let message;\n let newData;\n\n if (msg instanceof Error) {\n message = msg.message || 'Error';\n\n // NOTE (EK): This is typically to handle validation errors\n if (msg.errors) {\n errors = msg.errors;\n }\n } else if (typeof msg === 'object') { // Support plain old objects\n message = msg.message || 'Error';\n data = msg;\n } else { // message is just a string\n message = msg;\n }\n\n if (data) {\n // NOTE(EK): To make sure that we are not messing\n // with immutable data, just make a copy.\n // https://github.com/feathersjs/errors/issues/19\n newData = JSON.parse(JSON.stringify(data));\n\n if (newData.errors) {\n errors = newData.errors;\n delete newData.errors;\n } else if (data.errors) {\n // The errors property from data could be\n // stripped away while cloning resulting newData not to have it\n // For example: when cloning arrays this property\n errors = JSON.parse(JSON.stringify(data.errors));\n }\n }\n\n // NOTE (EK): Babel doesn't support this so\n // we have to pass in the class name manually.\n // this.name = this.constructor.name;\n this.type = 'FeathersError';\n this.name = name;\n this.message = message;\n this.code = code;\n this.className = className;\n this.data = newData;\n this.errors = errors || {};\n\n debug(`${this.name}(${this.code}): ${this.message}`);\n debug(this.errors);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, FeathersError);\n } else {\n this.stack = (new Error()).stack;\n }\n}\n\nfunction inheritsFrom (Child, Parent) {\n Child.prototype = Object.create(Parent.prototype);\n Child.prototype.constructor = Child;\n}\n\ninheritsFrom(FeathersError, Error);\n\n// NOTE (EK): A little hack to get around `message` not\n// being included in the default toJSON call.\nObject.defineProperty(FeathersError.prototype, 'toJSON', {\n value: function () {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n className: this.className,\n data: this.data,\n errors: this.errors\n };\n }\n});\n\n// 400 - Bad Request\nfunction BadRequest (message, data) {\n FeathersError.call(this, message, 'BadRequest', 400, 'bad-request', data);\n}\n\ninheritsFrom(BadRequest, FeathersError);\n\n// 401 - Not Authenticated\nfunction NotAuthenticated (message, data) {\n FeathersError.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);\n}\n\ninheritsFrom(NotAuthenticated, FeathersError);\n\n// 402 - Payment Error\nfunction PaymentError (message, data) {\n FeathersError.call(this, message, 'PaymentError', 402, 'payment-error', data);\n}\n\ninheritsFrom(PaymentError, FeathersError);\n\n// 403 - Forbidden\nfunction Forbidden (message, data) {\n FeathersError.call(this, message, 'Forbidden', 403, 'forbidden', data);\n}\n\ninheritsFrom(Forbidden, FeathersError);\n\n// 404 - Not Found\nfunction NotFound (message, data) {\n FeathersError.call(this, message, 'NotFound', 404, 'not-found', data);\n}\n\ninheritsFrom(NotFound, FeathersError);\n\n// 405 - Method Not Allowed\nfunction MethodNotAllowed (message, data) {\n FeathersError.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);\n}\n\ninheritsFrom(MethodNotAllowed, FeathersError);\n\n// 406 - Not Acceptable\nfunction NotAcceptable (message, data) {\n FeathersError.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);\n}\n\ninheritsFrom(NotAcceptable, FeathersError);\n\n// 408 - Timeout\nfunction Timeout (message, data) {\n FeathersError.call(this, message, 'Timeout', 408, 'timeout', data);\n}\n\ninheritsFrom(Timeout, FeathersError);\n\n// 409 - Conflict\nfunction Conflict (message, data) {\n FeathersError.call(this, message, 'Conflict', 409, 'conflict', data);\n}\n\ninheritsFrom(Conflict, FeathersError);\n\n// 411 - Length Required\nfunction LengthRequired (message, data) {\n FeathersError.call(this, message, 'LengthRequired', 411, 'length-required', data);\n}\n\ninheritsFrom(LengthRequired, FeathersError);\n\n// 422 Unprocessable\nfunction Unprocessable (message, data) {\n FeathersError.call(this, message, 'Unprocessable', 422, 'unprocessable', data);\n}\n\ninheritsFrom(Unprocessable, FeathersError);\n\n// 429 Too Many Requests\nfunction TooManyRequests (message, data) {\n FeathersError.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);\n}\n\ninheritsFrom(TooManyRequests, FeathersError);\n\n// 500 - General Error\nfunction GeneralError (message, data) {\n FeathersError.call(this, message, 'GeneralError', 500, 'general-error', data);\n}\n\ninheritsFrom(GeneralError, FeathersError);\n\n// 501 - Not Implemented\nfunction NotImplemented (message, data) {\n FeathersError.call(this, message, 'NotImplemented', 501, 'not-implemented', data);\n}\n\ninheritsFrom(NotImplemented, FeathersError);\n\n// 502 - Bad Gateway\nfunction BadGateway (message, data) {\n FeathersError.call(this, message, 'BadGateway', 502, 'bad-gateway', data);\n}\n\ninheritsFrom(BadGateway, FeathersError);\n\n// 503 - Unavailable\nfunction Unavailable (message, data) {\n FeathersError.call(this, message, 'Unavailable', 503, 'unavailable', data);\n}\n\ninheritsFrom(Unavailable, FeathersError);\n\nconst errors = {\n FeathersError,\n BadRequest,\n NotAuthenticated,\n PaymentError,\n Forbidden,\n NotFound,\n MethodNotAllowed,\n NotAcceptable,\n Timeout,\n Conflict,\n LengthRequired,\n Unprocessable,\n TooManyRequests,\n GeneralError,\n NotImplemented,\n BadGateway,\n Unavailable,\n 400: BadRequest,\n 401: NotAuthenticated,\n 402: PaymentError,\n 403: Forbidden,\n 404: NotFound,\n 405: MethodNotAllowed,\n 406: NotAcceptable,\n 408: Timeout,\n 409: Conflict,\n 411: LengthRequired,\n 422: Unprocessable,\n 429: TooManyRequests,\n 500: GeneralError,\n 501: NotImplemented,\n 502: BadGateway,\n 503: Unavailable\n};\n\nfunction convert (error) {\n if (!error) {\n return error;\n }\n\n const FeathersError = errors[error.name];\n const result = FeathersError\n ? new FeathersError(error.message, error.data)\n : new Error(error.message || error);\n\n if (typeof error === 'object') {\n Object.assign(result, error);\n }\n\n return result;\n}\n\nmodule.exports = Object.assign({ convert }, errors);\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\nfunction log(...args) {\n\t// This hackery is required for IE8/9, where\n\t// the `console.log` function doesn't have 'apply'\n\treturn typeof console === 'object' &&\n\t\tconsole.log &&\n\t\tconsole.log(...args);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* Active `debug` instances.\n\t*/\n\tcreateDebug.instances = [];\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn match;\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.enabled = createDebug.enabled(namespace);\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = selectColor(namespace);\n\t\tdebug.destroy = destroy;\n\t\tdebug.extend = extend;\n\t\t// Debug.formatArgs = formatArgs;\n\t\t// debug.rawLog = rawLog;\n\n\t\t// env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\tcreateDebug.instances.push(debug);\n\n\t\treturn debug;\n\t}\n\n\tfunction destroy() {\n\t\tconst index = createDebug.instances.indexOf(this);\n\t\tif (index !== -1) {\n\t\t\tcreateDebug.instances.splice(index, 1);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < createDebug.instances.length; i++) {\n\t\t\tconst instance = createDebug.instances[i];\n\t\t\tinstance.enabled = createDebug.enabled(instance.namespace);\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","const errors = require('@feathersjs/errors');\nconst { _ } = require('@feathersjs/commons');\nconst { sorter, select, AdapterService } = require('@feathersjs/adapter-commons');\nconst sift = require('sift').default;\n\nconst _select = (data, ...args) => {\n const base = select(...args);\n\n return base(JSON.parse(JSON.stringify(data)));\n};\n\nclass Service extends AdapterService {\n constructor (options = {}) {\n super(_.extend({\n id: 'id',\n matcher: sift,\n sorter\n }, options));\n this._uId = options.startId || 0;\n this.store = options.store || {};\n }\n\n async getEntries (params = {}) {\n const { query } = this.filterQuery(params);\n\n return this._find(Object.assign({}, params, {\n paginate: false,\n query\n }));\n }\n\n async _find (params = {}) {\n const { query, filters, paginate } = this.filterQuery(params);\n let values = _.values(this.store).filter(this.options.matcher(query));\n const total = values.length;\n\n if (filters.$sort !== undefined) {\n values.sort(this.options.sorter(filters.$sort));\n }\n\n if (filters.$skip !== undefined) {\n values = values.slice(filters.$skip);\n }\n\n if (filters.$limit !== undefined) {\n values = values.slice(0, filters.$limit);\n }\n\n const result = {\n total,\n limit: filters.$limit,\n skip: filters.$skip || 0,\n data: values.map(value => _select(value, params))\n };\n\n if (!(paginate && paginate.default)) {\n return result.data;\n }\n\n return result;\n }\n\n async _get (id, params = {}) {\n if (id in this.store) {\n const { query } = this.filterQuery(params);\n const value = this.store[id];\n\n if (this.options.matcher(query)(value)) {\n return _select(value, params, this.id);\n }\n }\n\n throw new errors.NotFound(`No record found for id '${id}'`);\n }\n\n // Create without hooks and mixins that can be used internally\n async _create (data, params = {}) {\n if (Array.isArray(data)) {\n return Promise.all(data.map(current => this._create(current, params)));\n }\n\n const id = data[this.id] || this._uId++;\n const current = _.extend({}, data, { [this.id]: id });\n const result = (this.store[id] = current);\n\n return _select(result, params, this.id);\n }\n\n async _update (id, data, params = {}) {\n const oldEntry = await this._get(id);\n // We don't want our id to change type if it can be coerced\n const oldId = oldEntry[this.id];\n\n id = oldId == id ? oldId : id; // eslint-disable-line\n\n this.store[id] = _.extend({}, data, { [this.id]: id });\n\n return this._get(id, params);\n }\n\n async _patch (id, data, params = {}) {\n const patchEntry = entry => {\n const currentId = entry[this.id];\n\n this.store[currentId] = _.extend(this.store[currentId], _.omit(data, this.id));\n\n return _select(this.store[currentId], params, this.id);\n };\n\n if (id === null) {\n const entries = await this.getEntries(params);\n\n return entries.map(patchEntry);\n }\n\n return patchEntry(await this._get(id, params)); // Will throw an error if not found\n }\n\n // Remove without hooks and mixins that can be used internally\n async _remove (id, params = {}) {\n if (id === null) {\n const entries = await this.getEntries(params);\n\n return Promise.all(entries.map(\n current => this._remove(current[this.id], params))\n );\n }\n\n const entry = await this._get(id, params);\n\n delete this.store[id];\n\n return entry;\n }\n}\n\nmodule.exports = options => {\n return new Service(options);\n};\n\nmodule.exports.Service = Service;\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/*\n *\n * Copryright 2018, Craig Condon\n * Licensed under MIT\n *\n * Filter JavaScript objects with mongodb queries\n */\n\nfunction typeChecker(type) {\n var typeString = \"[object \" + type + \"]\";\n return function(value) {\n return Object.prototype.toString.call(value) === typeString;\n };\n}\n\n/**\n */\n\nvar isArray = typeChecker(\"Array\");\nvar isObject = typeChecker(\"Object\");\nvar isFunction = typeChecker(\"Function\");\n\nfunction get(obj, key) {\n return isFunction(obj.get) ? obj.get(key) : obj[key];\n}\n\n\nconst nestable = (validator) => (validateOptions, value, key, valueOwner, nestedResults) => {\n if (nestedResults) {\n return Boolean(nestedResults.find(([value, key, valueOwner]) => validator(validateOptions, key, valueOwner)));\n }\n\n return validator(validateOptions, value, key, valueOwner);\n};\n\n/**\n */\n\nconst or = nestable((validator) => {\n return function(validateOptions, value, key, valueOwner, nestedResults) {\n if (!isArray(value) || !value.length) {\n return validator(validateOptions, value);\n }\n for (var i = 0, n = value.length; i < n; i++) {\n if (validator(validateOptions, get(value, i))) return true;\n }\n return false;\n };\n});\n\n/**\n */\n\nfunction and(validator) {\n return function(validateOptions, value, key, valueOwner) {\n if (!isArray(value) || !value.length) {\n return validator(validateOptions, value, key, valueOwner);\n }\n for (var i = 0, n = value.length; i < n; i++) {\n if (!validator(validateOptions, get(value, i), value, valueOwner)) return false;\n }\n return true;\n };\n}\n\nfunction validate(validator, value, key, valueOwner, nestedResults) {\n return validator.validate(validator.options, value, key, valueOwner, nestedResults);\n}\n\nvar defaultExpressions = {\n /**\n */\n\n $eq: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $ne: and(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $gt: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $gte: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $lt: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $lte: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $mod: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $in(test, value) {\n return test(value);\n },\n\n /**\n */\n\n $nin: function(test, value) {\n return test(value);\n },\n\n /**\n */\n\n $not: function(test, value, key, valueOwner) {\n return test(value, key, valueOwner);\n },\n\n /**\n */\n\n $type: function(testType, value) {\n return testType(value);\n },\n\n /**\n */\n\n $all: function(allOptions, value, key, valueOwner, nestedResults) {\n return defaultExpressions.$and(allOptions, value, key, valueOwner, nestedResults);\n },\n\n /**\n */\n\n $size: function(sizeMatch, value) {\n return value ? sizeMatch === value.length : false;\n },\n\n /**\n */\n\n $or: function(orOptions, value, key, valueOwner) {\n for (var i = 0, n = orOptions.length; i < n; i++) {\n if (validate(get(orOptions, i), value, key, valueOwner)) {\n return true;\n }\n }\n return false;\n },\n\n /**\n */\n\n $nor: function(validateOptions, value, key, valueOwner) {\n return !defaultExpressions.$or(validateOptions, value, key, valueOwner);\n },\n\n /**\n */\n\n $and: function(validateOptions, value, key, valueOwner, nestedResults) {\n\n if (nestedResults) {\n for (var i = 0, n = validateOptions.length; i < n; i++) {\n if (!validate(get(validateOptions, i), value, key, valueOwner, nestedResults)) {\n return false;\n }\n }\n } else {\n for (var i = 0, n = validateOptions.length; i < n; i++) {\n if (!validate(get(validateOptions, i), value, key, valueOwner, nestedResults)) {\n return false;\n }\n }\n }\n return true;\n },\n\n /**\n */\n\n $regex: or(function(validateOptions, value) {\n return typeof value === \"string\" && validateOptions.test(value);\n }),\n\n /**\n */\n\n $where: function(validateOptions, value, key, valueOwner) {\n return validateOptions.call(value, value, key, valueOwner);\n },\n\n /**\n */\n\n $elemMatch: function(validateOptions, value, key, valueOwner) {\n if (isArray(value)) {\n return !!~search(value, validateOptions);\n }\n return validate(validateOptions, value, key, valueOwner);\n },\n\n /**\n */\n\n $exists: function(validateOptions, value, key, valueOwner) {\n return valueOwner.hasOwnProperty(key) === validateOptions;\n }\n};\n\n/**\n */\n\nvar prepare = {\n /**\n */\n\n $eq: function(query, queryOwner, { comparable, compare }) {\n if (query instanceof RegExp) {\n return or(function(value) {\n return typeof value === \"string\" && query.test(value);\n });\n } else if (query instanceof Function) {\n return or(query);\n } else if (isArray(query) && !query.length) {\n // Special case of a == []\n return or(function(value) {\n return isArray(value) && !value.length;\n });\n } else if (query === null) {\n return or(function(value) {\n //will match both null and undefined\n return value == null;\n });\n }\n return or(function(value) {\n return compare(comparable(value), comparable(query)) === 0;\n });\n },\n\n $gt: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) > 0;\n };\n },\n\n $gte: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) >= 0;\n };\n },\n\n $lt: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) < 0;\n };\n },\n $lte: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) <= 0;\n };\n },\n\n $in: function(query, queryOwner, options) {\n const { comparable } = options;\n return function(value) {\n if (value instanceof Array) {\n for (var i = value.length; i--; ) {\n if (~query.indexOf(comparable(get(value, i)))) {\n return true;\n }\n }\n } else {\n var comparableValue = comparable(value);\n if (comparableValue === value && typeof value === \"object\") {\n for (var i = query.length; i--; ) {\n if (\n String(query[i]) === String(value) &&\n String(value) !== \"[object Object]\"\n ) {\n return true;\n }\n }\n }\n\n /*\n Handles documents that are undefined, whilst also\n having a 'null' element in the parameters to $in.\n */\n if (typeof comparableValue == \"undefined\") {\n for (var i = query.length; i--; ) {\n if (query[i] == null) {\n return true;\n }\n }\n }\n\n /*\n Handles the case of {'field': {$in: [/regexp1/, /regexp2/, ...]}}\n */\n for (var i = query.length; i--; ) {\n var validator = createRootValidator(get(query, i), options);\n var result = validate(validator, comparableValue, i, query);\n if (\n result &&\n String(result) !== \"[object Object]\" &&\n String(comparableValue) !== \"[object Object]\"\n ) {\n return true;\n }\n }\n\n return !!~query.indexOf(comparableValue);\n }\n\n return false;\n };\n },\n\n $nin: function(query, queryOwner, options) {\n const eq = prepare.$in(query, queryOwner, options);\n return function(validateOptions, value, key, valueOwner) {\n return !eq(validateOptions, value, key, valueOwner);\n };\n },\n\n $mod: function(query) {\n return function(value) {\n return value % query[0] == query[1];\n };\n },\n\n /**\n */\n\n $ne: function(query, queryOwner, options) {\n const eq = prepare.$eq(query, queryOwner, options);\n return and(function(validateOptions, value, key, valueOwner) {\n return !eq(validateOptions, value, key, valueOwner);\n });\n },\n\n /**\n */\n\n $and: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $all: function(query, queryOwner, options) {\n return prepare.$and(query, queryOwner, options);\n },\n\n /**\n */\n\n $or: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $nor: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $not: function(query, queryOwner, options) {\n const validateOptions = parse(options)(query);\n return function(value, key, valueOwner) {\n return !validate(validateOptions, value, key, valueOwner);\n };\n },\n\n $type: function(query) {\n return function(value, key, valueOwner) {\n return value != void 0\n ? value instanceof query || value.constructor == query\n : false;\n };\n },\n\n /**\n */\n\n $regex: function(query, queryOwner) {\n return new RegExp(query, queryOwner.$options);\n },\n\n /**\n */\n\n $where: function(query) {\n return typeof query === \"string\"\n ? new Function(\"obj\", \"return \" + query)\n : query;\n },\n\n /**\n */\n\n $elemMatch: function(query, queryOwner, options) {\n return parse(options)(query);\n },\n\n /**\n */\n\n $exists: function(query) {\n return !!query;\n }\n};\n\n/**\n */\n\nfunction search(array, validator) {\n for (var i = 0; i < array.length; i++) {\n var result = get(array, i);\n if (validate(validator, get(array, i))) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n */\n\nfunction createValidator(options, validate) {\n return { options, validate };\n}\n\n/**\n */\n\nfunction validatedNested({ keyPath, child, query }, value) {\n const results = [];\n findValues(value, keyPath, 0, value, results);\n \n if (results.length === 1) {\n const [value, key, valueOwner] = results[0];\n return validate(child, value, key, valueOwner);\n }\n\n // If the query contains $ne, need to test all elements ANDed together\n var inclusive = query && typeof query.$ne !== \"undefined\";\n var allValid = inclusive;\n const allValues = results.map(([value]) => value);\n\n return validate(child, undefined, undefined, undefined, results);\n // for (var i = 0; i < results.length; i++) {\n // const [value, key, valueOwner] = results[i];\n // var isValid = validate(child, value, key, valueOwner);\n // console.log(isValid, value);\n // if (inclusive) {\n // allValid &= isValid;\n // } else {\n // allValid |= isValid;\n // }\n // }\n // return allValid;\n}\n\n/**\n */\n\nfunction findValues(current, keypath, index, object, values) {\n if (index === keypath.length || current == void 0) {\n values.push([current, keypath[index - 1], object]);\n return;\n }\n\n var k = get(keypath, index);\n\n // ensure that if current is an array, that the current key\n // is NOT an array index. This sort of thing needs to work:\n // sift({'foo.0':42}, [{foo: [42]}]);\n if (isArray(current) && isNaN(Number(k))) {\n for (var i = 0, n = current.length; i < n; i++) {\n findValues(get(current, i), keypath, index, current, values);\n }\n } else {\n findValues(get(current, k), keypath, index + 1, current, values);\n }\n}\n\n/**\n */\n\nfunction createNestedValidator(keyPath, child, query) {\n return createValidator({ keyPath, child, query }, validatedNested);\n}\n\n/**\n * flatten the query\n */\n\nfunction isVanillaObject(value) {\n return (\n value &&\n (value.constructor === Object ||\n value.constructor === Array ||\n value.constructor.toString() === \"function Object() { [native code] }\" ||\n value.constructor.toString() === \"function Array() { [native code] }\")\n );\n}\n\nfunction parse(options) {\n const { comparable, expressions } = options;\n var wrapQuery = function(query) {\n if (!query || !isVanillaObject(query)) {\n query = { $eq: query };\n }\n return query;\n };\n\n var parseQuery = function(query) {\n query = comparable(query);\n\n var validators = [];\n\n for (var key in query) {\n var queryValue = query[key];\n\n if (key === \"$options\") {\n continue;\n }\n\n var expression =\n defaultExpressions[key] || (options && expressions && expressions[key]);\n\n if (expression) {\n if (prepare[key]) {\n queryValue = prepare[key](queryValue, query, options);\n }\n validators.push(createValidator(comparable(queryValue), expression));\n } else {\n if (key.charCodeAt(0) === 36) {\n throw new Error(\"Unknown operation \" + key);\n }\n\n var keyParts = key.split(\".\");\n\n validators.push(\n createNestedValidator(keyParts, parseNested(queryValue), queryValue)\n );\n }\n }\n\n return validators.length === 1\n ? validators[0]\n : createValidator(validators, defaultExpressions.$and);\n };\n\n var parseNested = function(query) {\n query = wrapQuery(query);\n if (isExactObject(query)) {\n return createValidator(query, isEqual);\n }\n return parseQuery(query);\n };\n\n var parseRoot = function(query) {\n return parseQuery(wrapQuery(query));\n };\n\n return parseRoot;\n}\n\nfunction isEqual(a, b) {\n if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) {\n return false;\n }\n\n if (isObject(a)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n for (var key in a) {\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n } else if (isArray(a)) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0, n = a.length; i < n; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n } else {\n return a === b;\n }\n}\n\nfunction getAllKeys(value, keys) {\n if (!isObject(value)) {\n return keys;\n }\n for (var key in value) {\n keys.push(key);\n getAllKeys(value[key], keys);\n }\n return keys;\n}\n\nfunction isExactObject(value) {\n const allKeysHash = getAllKeys(value, []).join(\",\");\n return allKeysHash.search(/[$.]/) === -1;\n}\n\n/**\n */\n\nfunction createRootValidator(query, options) {\n var validator = parse(options)(query);\n if (options && options.select) {\n validator = {\n options: validator,\n validate: function(validateOptions, value, key, valueOwner) {\n return validate(\n validateOptions,\n value && options.select(value),\n key,\n valueOwner\n );\n }\n };\n }\n return validator;\n}\n\n/**\n */\n\nexport default function sift(query, options) {\n options = Object.assign({ compare, comparable }, options);\n var validator = createRootValidator(query, options);\n return function(value, key, valueOwner) {\n return validate(validator, value, key, valueOwner);\n };\n}\n\n/**\n */\n\nexport function compare(a, b) {\n if (isEqual(a, b)) return 0;\n if (typeof a === typeof b) {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n }\n}\n\n/**\n */\n\nexport function comparable(value) {\n if (value instanceof Date) {\n return value.getTime();\n } else if (isArray(value)) {\n return value.map(comparable);\n } else if (value && typeof value.toJSON === \"function\") {\n return value.toJSON();\n } else {\n return value;\n }\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://feathers.localstorage/webpack/universalModuleDefinition","webpack://feathers.localstorage/webpack/bootstrap","webpack://feathers.localstorage/./lib/index.js","webpack://feathers.localstorage/../src/filter-query.ts","webpack://feathers.localstorage/../src/index.ts","webpack://feathers.localstorage/../src/service.ts","webpack://feathers.localstorage/../src/sort.ts","webpack://feathers.localstorage/../src/hooks.ts","webpack://feathers.localstorage/../src/utils.ts","webpack://feathers.localstorage/./node_modules/@feathersjs/errors/lib/index.js","webpack://feathers.localstorage/./node_modules/debug/src/browser.js","webpack://feathers.localstorage/./node_modules/debug/src/common.js","webpack://feathers.localstorage/./node_modules/feathers-memory/lib/index.js","webpack://feathers.localstorage/./node_modules/ms/index.js","webpack://feathers.localstorage/./node_modules/process/browser.js","webpack://feathers.localstorage/./node_modules/sift/src/index.js"],"names":["require","Service","usedKeys","LocalStorage","options","_storageKey","name","_storage","storage","window","localStorage","_throttle","throttle","_reuseKeys","reuseKeys","store","Error","indexOf","push","ready","Promise","resolve","getItem","then","str","JSON","parse","keys","Object","last","length","_uId","id","data","_timeout","setTimeout","setItem","stringify","method","args","execute","flush","module","exports","init","debug","FeathersError","msg","code","className","errors","message","newData","type","captureStackTrace","stack","inheritsFrom","Child","Parent","prototype","create","constructor","defineProperty","value","BadRequest","call","NotAuthenticated","PaymentError","Forbidden","NotFound","MethodNotAllowed","NotAcceptable","Timeout","Conflict","Gone","LengthRequired","Unprocessable","TooManyRequests","GeneralError","NotImplemented","BadGateway","Unavailable","convert","error","result","assign","formatArgs","save","load","useColors","localstorage","destroy","warned","console","warn","colors","process","__nwjs","navigator","userAgent","toLowerCase","match","document","documentElement","style","WebkitAppearance","firebug","exception","table","parseInt","RegExp","$1","namespace","humanize","diff","c","color","splice","index","lastC","replace","log","namespaces","removeItem","r","env","DEBUG","formatters","j","v","setup","createDebug","default","coerce","disable","enable","enabled","forEach","key","names","skips","selectColor","hash","i","charCodeAt","Math","abs","prevTime","enableOverride","self","curr","Number","Date","ms","prev","unshift","format","formatter","val","logFn","apply","extend","enumerable","configurable","get","set","delimiter","newDebug","split","len","substr","map","toNamespace","join","test","regexp","toString","substring","_","sorter","select","AdapterService","sift","_select","base","matcher","startId","params","filterQuery","query","_find","paginate","filters","values","filter","total","$sort","undefined","sort","$skip","slice","$limit","limit","skip","Array","isArray","all","current","_create","_get","oldEntry","oldId","patchEntry","entry","currentId","omit","getEntries","entries","_remove","typeChecker","typeString","isObject","isFunction","obj","nestable","validator","validateOptions","valueOwner","nestedResults","Boolean","find","or","n","and","validate","defaultExpressions","$eq","$ne","$gt","$gte","$lt","$lte","$mod","$in","$nin","$not","$type","testType","$all","allOptions","$and","$size","sizeMatch","$or","orOptions","$nor","$regex","$where","$elemMatch","search","$exists","hasOwnProperty","prepare","queryOwner","comparable","compare","Function","comparableValue","String","createRootValidator","eq","$options","array","createValidator","validatedNested","keyPath","child","results","findValues","inclusive","allValid","allValues","keypath","object","k","isNaN","createNestedValidator","isVanillaObject","expressions","wrapQuery","parseQuery","validators","queryValue","expression","keyParts","parseNested","isExactObject","isEqual","parseRoot","a","b","getAllKeys","allKeysHash","getTime","toJSON"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AO,KAAKtM,KAAL,CAAWiB,EAAX,CAAP;kDAEOqL,K;;;;;;;;;;;;;;;;;;;EAzHWhC,c;;AA6HtB3I,MAAM,CAACC,OAAP,GAAiB,UAAAvC,OAAO,EAAI;AAC1B,SAAO,IAAIH,OAAJ,CAAYG,OAAZ,CAAP;AACD,CAFD;;AAIAsC,MAAM,CAACC,OAAP,CAAe1C,OAAf,GAAyBA,OAAzB,C;;;;;;;;;;;AC5IA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,cAAc;AACzB,WAAW,OAAO;AAClB,YAAY,MAAM;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;ACjKA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;;;AAIA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uBAAuB,sBAAsB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;;AAErC;AACA;AACA;;AAEA,2BAA2B;AAC3B;AACA;AACA;AACA,4BAA4B,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACvLtC;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,SAAS0N,WAAT,CAAqBtK,IAArB,EAA2B;AACzB,MAAIuK,UAAU,GAAG,aAAavK,IAAb,GAAoB,GAArC;AACA,SAAO,UAASU,KAAT,EAAgB;AACrB,WAAOnC,MAAM,CAAC+B,SAAP,CAAiBqH,QAAjB,CAA0B/G,IAA1B,CAA+BF,KAA/B,MAA0C6J,UAAjD;AACD,GAFD;AAGD;AAED;AACA;;;AAEA,IAAIf,O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AACD;AACF,C","file":"feathers-localstorage.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"localstorage\"] = factory();\n\telse\n\t\troot[\"feathers\"] = root[\"feathers\"] || {}, root[\"feathers\"][\"localstorage\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./lib/index.js\");\n","const { Service } = require('feathers-memory');\n\nconst usedKeys = [];\n\nclass LocalStorage extends Service {\n constructor (options = {}) {\n super(options);\n this._storageKey = options.name || 'feathers';\n this._storage = options.storage || (typeof window !== 'undefined' && window.localStorage);\n this._throttle = options.throttle || 200;\n this._reuseKeys = options.reuseKeys || false;\n this.store = null;\n\n if (!this._storage) {\n throw new Error('The `storage` option needs to be provided');\n }\n\n if (usedKeys.indexOf(this._storageKey) === -1) {\n usedKeys.push(this._storageKey);\n } else {\n if (!this._reuseKeys) { // Allow reuse if options.reuseKeys set to true\n throw new Error(`The storage name '${this._storageKey}' is already in use by another instance.`);\n }\n }\n\n this.ready();\n }\n\n ready () {\n if (!this.store) {\n return Promise.resolve(this._storage.getItem(this._storageKey))\n .then(str => JSON.parse(str || '{}'))\n .then(store => {\n const keys = Object.keys(store);\n const last = store[keys[keys.length - 1]];\n\n // Current id is the id of the last item\n this._uId = (keys.length && typeof last[this.id] !== 'undefined') ? last[this.id] + 1 : this._uId;\n\n return (this.store = store);\n });\n }\n\n return Promise.resolve(this.store);\n }\n\n flush (data) {\n if (!this._timeout) {\n this._timeout = setTimeout(() => {\n this._storage.setItem(this._storageKey, JSON.stringify(this.store));\n delete this._timeout;\n }, this._throttle);\n }\n\n return data;\n }\n\n execute (method, ...args) {\n return this.ready()\n .then(() => super[method](...args));\n }\n\n find (...args) {\n return this.execute('find', ...args);\n }\n\n get (...args) {\n return this.execute('get', ...args);\n }\n\n create (...args) {\n return this.execute('create', ...args)\n .then(data => this.flush(data));\n }\n\n patch (...args) {\n return this.execute('patch', ...args)\n .then(data => this.flush(data));\n }\n\n update (...args) {\n return this.execute('update', ...args)\n .then(data => this.flush(data));\n }\n\n remove (...args) {\n return this.execute('remove', ...args)\n .then(data => this.flush(data));\n }\n}\n\nmodule.exports = function init (options) {\n return new LocalStorage(options);\n};\n\nmodule.exports.Service = Service;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OPERATORS = exports.FILTERS = void 0;\nconst commons_1 = require(\"@feathersjs/commons\");\nconst errors_1 = require(\"@feathersjs/errors\");\nfunction parse(number) {\n if (typeof number !== 'undefined') {\n return Math.abs(parseInt(number, 10));\n }\n return undefined;\n}\n// Returns the pagination limit and will take into account the\n// default and max pagination settings\nfunction getLimit(limit, paginate) {\n if (paginate && paginate.default) {\n const lower = typeof limit === 'number' && !isNaN(limit) ? limit : paginate.default;\n const upper = typeof paginate.max === 'number' ? paginate.max : Number.MAX_VALUE;\n return Math.min(lower, upper);\n }\n return limit;\n}\n// Makes sure that $sort order is always converted to an actual number\nfunction convertSort(sort) {\n if (typeof sort !== 'object' || Array.isArray(sort)) {\n return sort;\n }\n return Object.keys(sort).reduce((result, key) => {\n result[key] = typeof sort[key] === 'object'\n ? sort[key] : parseInt(sort[key], 10);\n return result;\n }, {});\n}\nfunction cleanQuery(query, operators, filters) {\n if (Array.isArray(query)) {\n return query.map(value => cleanQuery(value, operators, filters));\n }\n else if (commons_1._.isObject(query) && query.constructor === {}.constructor) {\n const result = {};\n commons_1._.each(query, (value, key) => {\n if (key[0] === '$') {\n if (filters[key] !== undefined) {\n return;\n }\n if (!operators.includes(key)) {\n throw new errors_1.BadRequest(`Invalid query parameter ${key}`, query);\n }\n }\n result[key] = cleanQuery(value, operators, filters);\n });\n Object.getOwnPropertySymbols(query).forEach(symbol => {\n // @ts-ignore\n result[symbol] = query[symbol];\n });\n return result;\n }\n return query;\n}\nfunction assignFilters(object, query, filters, options) {\n if (Array.isArray(filters)) {\n commons_1._.each(filters, (key) => {\n if (query[key] !== undefined) {\n object[key] = query[key];\n }\n });\n }\n else {\n commons_1._.each(filters, (converter, key) => {\n const converted = converter(query[key], options);\n if (converted !== undefined) {\n object[key] = converted;\n }\n });\n }\n return object;\n}\nexports.FILTERS = {\n $sort: (value) => convertSort(value),\n $limit: (value, options) => getLimit(parse(value), options.paginate),\n $skip: (value) => parse(value),\n $select: (value) => value\n};\nexports.OPERATORS = ['$in', '$nin', '$lt', '$lte', '$gt', '$gte', '$ne', '$or'];\n// Converts Feathers special query parameters and pagination settings\n// and returns them separately a `filters` and the rest of the query\n// as `query`\nfunction filterQuery(query, options = {}) {\n const { filters: additionalFilters = {}, operators: additionalOperators = [] } = options;\n const result = {};\n result.filters = assignFilters({}, query, exports.FILTERS, options);\n result.filters = assignFilters(result.filters, query, additionalFilters, options);\n result.query = cleanQuery(query, exports.OPERATORS.concat(additionalOperators), result.filters);\n return result;\n}\nexports.default = filterQuery;\nif (typeof module !== 'undefined') {\n module.exports = Object.assign(filterQuery, module.exports);\n}\n//# sourceMappingURL=filter-query.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hooks = void 0;\nconst hookUtils = __importStar(require(\"./hooks\"));\n__exportStar(require(\"./utils\"), exports);\nexports.hooks = hookUtils;\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AdapterService = void 0;\nconst errors_1 = require(\"@feathersjs/errors\");\nconst filter_query_1 = __importDefault(require(\"./filter-query\"));\nconst callMethod = (self, name, ...args) => {\n if (typeof self[name] !== 'function') {\n return Promise.reject(new errors_1.NotImplemented(`Method ${name} not available`));\n }\n return self[name](...args);\n};\nconst alwaysMulti = {\n find: true,\n get: false,\n update: false\n};\nclass AdapterService {\n constructor(options) {\n this.options = Object.assign({\n id: 'id',\n events: [],\n paginate: {},\n multi: false,\n filters: [],\n whitelist: []\n }, options);\n }\n get id() {\n return this.options.id;\n }\n get events() {\n return this.options.events;\n }\n filterQuery(params = {}, opts = {}) {\n const paginate = typeof params.paginate !== 'undefined'\n ? params.paginate : this.options.paginate;\n const { query = {} } = params;\n const options = Object.assign({\n operators: this.options.whitelist || [],\n filters: this.options.filters,\n paginate\n }, opts);\n const result = filter_query_1.default(query, options);\n return Object.assign(result, { paginate });\n }\n allowsMulti(method) {\n const always = alwaysMulti[method];\n if (typeof always !== 'undefined') {\n return always;\n }\n const option = this.options.multi;\n if (option === true || option === false) {\n return option;\n }\n else {\n return option.includes(method);\n }\n }\n find(params) {\n return callMethod(this, '_find', params);\n }\n get(id, params) {\n return callMethod(this, '_get', id, params);\n }\n create(data, params) {\n if (Array.isArray(data) && !this.allowsMulti('create')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not create multiple entries`));\n }\n return callMethod(this, '_create', data, params);\n }\n update(id, data, params) {\n if (id === null || Array.isArray(data)) {\n return Promise.reject(new errors_1.BadRequest(`You can not replace multiple instances. Did you mean 'patch'?`));\n }\n return callMethod(this, '_update', id, data, params);\n }\n patch(id, data, params) {\n if (id === null && !this.allowsMulti('patch')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not patch multiple entries`));\n }\n return callMethod(this, '_patch', id, data, params);\n }\n remove(id, params) {\n if (id === null && !this.allowsMulti('remove')) {\n return Promise.reject(new errors_1.MethodNotAllowed(`Can not remove multiple entries`));\n }\n return callMethod(this, '_remove', id, params);\n }\n}\nexports.AdapterService = AdapterService;\n//# sourceMappingURL=service.js.map","\"use strict\";\n// Sorting algorithm taken from NeDB (https://github.com/louischatriot/nedb)\n// See https://github.com/louischatriot/nedb/blob/e3f0078499aa1005a59d0c2372e425ab789145c1/lib/model.js#L189\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sorter = exports.compare = exports.compareArrays = exports.compareNSB = void 0;\nfunction compareNSB(a, b) {\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n}\nexports.compareNSB = compareNSB;\nfunction compareArrays(a, b) {\n let i;\n let comp;\n for (i = 0; i < Math.min(a.length, b.length); i += 1) {\n comp = exports.compare(a[i], b[i]);\n if (comp !== 0) {\n return comp;\n }\n }\n // Common section was identical, longest one wins\n return exports.compareNSB(a.length, b.length);\n}\nexports.compareArrays = compareArrays;\nfunction compare(a, b, compareStrings = exports.compareNSB) {\n const { compareNSB, compare, compareArrays } = exports;\n // undefined\n if (a === undefined) {\n return b === undefined ? 0 : -1;\n }\n if (b === undefined) {\n return a === undefined ? 0 : 1;\n }\n // null\n if (a === null) {\n return b === null ? 0 : -1;\n }\n if (b === null) {\n return a === null ? 0 : 1;\n }\n // Numbers\n if (typeof a === 'number') {\n return typeof b === 'number' ? compareNSB(a, b) : -1;\n }\n if (typeof b === 'number') {\n return typeof a === 'number' ? compareNSB(a, b) : 1;\n }\n // Strings\n if (typeof a === 'string') {\n return typeof b === 'string' ? compareStrings(a, b) : -1;\n }\n if (typeof b === 'string') {\n return typeof a === 'string' ? compareStrings(a, b) : 1;\n }\n // Booleans\n if (typeof a === 'boolean') {\n return typeof b === 'boolean' ? compareNSB(a, b) : -1;\n }\n if (typeof b === 'boolean') {\n return typeof a === 'boolean' ? compareNSB(a, b) : 1;\n }\n // Dates\n if (a instanceof Date) {\n return b instanceof Date ? compareNSB(a.getTime(), b.getTime()) : -1;\n }\n if (b instanceof Date) {\n return a instanceof Date ? compareNSB(a.getTime(), b.getTime()) : 1;\n }\n // Arrays (first element is most significant and so on)\n if (Array.isArray(a)) {\n return Array.isArray(b) ? compareArrays(a, b) : -1;\n }\n if (Array.isArray(b)) {\n return Array.isArray(a) ? compareArrays(a, b) : 1;\n }\n // Objects\n const aKeys = Object.keys(a).sort();\n const bKeys = Object.keys(b).sort();\n let comp = 0;\n for (let i = 0; i < Math.min(aKeys.length, bKeys.length); i += 1) {\n comp = compare(a[aKeys[i]], b[bKeys[i]]);\n if (comp !== 0) {\n return comp;\n }\n }\n return compareNSB(aKeys.length, bKeys.length);\n}\nexports.compare = compare;\n// An in-memory sorting function according to the\n// $sort special query parameter\nfunction sorter($sort) {\n const criteria = Object.keys($sort).map(key => {\n const direction = $sort[key];\n return { key, direction };\n });\n return function (a, b) {\n let compare;\n for (const criterion of criteria) {\n compare = criterion.direction * exports.compare(a[criterion.key], b[criterion.key]);\n if (compare !== 0) {\n return compare;\n }\n }\n return 0;\n };\n}\nexports.sorter = sorter;\n//# sourceMappingURL=sort.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enableHooks = exports.processHooks = exports.getHooks = exports.isHookObject = exports.convertHookData = exports.makeArguments = exports.defaultMakeArguments = exports.createHookObject = exports.ACTIVATE_HOOKS = void 0;\nconst utils_1 = require(\"./utils\");\nconst { each, pick } = utils_1._;\nexports.ACTIVATE_HOOKS = utils_1.createSymbol('__feathersActivateHooks');\nfunction createHookObject(method, data = {}) {\n const hook = {};\n Object.defineProperty(hook, 'toJSON', {\n value() {\n return pick(this, 'type', 'method', 'path', 'params', 'id', 'data', 'result', 'error');\n }\n });\n return Object.assign(hook, data, {\n method,\n // A dynamic getter that returns the path of the service\n get path() {\n const { app, service } = data;\n if (!service || !app || !app.services) {\n return null;\n }\n return Object.keys(app.services)\n .find(path => app.services[path] === service);\n }\n });\n}\nexports.createHookObject = createHookObject;\n// Fallback used by `makeArguments` which usually won't be used\nfunction defaultMakeArguments(hook) {\n const result = [];\n if (typeof hook.id !== 'undefined') {\n result.push(hook.id);\n }\n if (hook.data) {\n result.push(hook.data);\n }\n result.push(hook.params || {});\n return result;\n}\nexports.defaultMakeArguments = defaultMakeArguments;\n// Turns a hook object back into a list of arguments\n// to call a service method with\nfunction makeArguments(hook) {\n switch (hook.method) {\n case 'find':\n return [hook.params];\n case 'get':\n case 'remove':\n return [hook.id, hook.params];\n case 'update':\n case 'patch':\n return [hook.id, hook.data, hook.params];\n case 'create':\n return [hook.data, hook.params];\n }\n return defaultMakeArguments(hook);\n}\nexports.makeArguments = makeArguments;\n// Converts different hook registration formats into the\n// same internal format\nfunction convertHookData(obj) {\n let hook = {};\n if (Array.isArray(obj)) {\n hook = { all: obj };\n }\n else if (typeof obj !== 'object') {\n hook = { all: [obj] };\n }\n else {\n each(obj, function (value, key) {\n hook[key] = !Array.isArray(value) ? [value] : value;\n });\n }\n return hook;\n}\nexports.convertHookData = convertHookData;\n// Duck-checks a given object to be a hook object\n// A valid hook object has `type` and `method`\nfunction isHookObject(hookObject) {\n return typeof hookObject === 'object' &&\n typeof hookObject.method === 'string' &&\n typeof hookObject.type === 'string';\n}\nexports.isHookObject = isHookObject;\n// Returns all service and application hooks combined\n// for a given method and type `appLast` sets if the hooks\n// from `app` should be added last (or first by default)\nfunction getHooks(app, service, type, method, appLast = false) {\n const appHooks = app.__hooks[type][method] || [];\n const serviceHooks = service.__hooks[type][method] || [];\n if (appLast) {\n // Run hooks in the order of service -> app -> finally\n return serviceHooks.concat(appHooks);\n }\n return appHooks.concat(serviceHooks);\n}\nexports.getHooks = getHooks;\nfunction processHooks(hooks, initialHookObject) {\n let hookObject = initialHookObject;\n const updateCurrentHook = (current) => {\n // Either use the returned hook object or the current\n // hook object from the chain if the hook returned undefined\n if (current) {\n if (!isHookObject(current)) {\n throw new Error(`${hookObject.type} hook for '${hookObject.method}' method returned invalid hook object`);\n }\n hookObject = current;\n }\n return hookObject;\n };\n // Go through all hooks and chain them into our promise\n const promise = hooks.reduce((current, fn) => {\n // @ts-ignore\n const hook = fn.bind(this);\n // Use the returned hook object or the old one\n return current.then((currentHook) => hook(currentHook)).then(updateCurrentHook);\n }, Promise.resolve(hookObject));\n return promise.then(() => hookObject).catch(error => {\n // Add the hook information to any errors\n error.hook = hookObject;\n throw error;\n });\n}\nexports.processHooks = processHooks;\n// Add `.hooks` functionality to an object\nfunction enableHooks(obj, methods, types) {\n if (typeof obj.hooks === 'function') {\n return obj;\n }\n const hookData = {};\n types.forEach(type => {\n // Initialize properties where hook functions are stored\n hookData[type] = {};\n });\n // Add non-enumerable `__hooks` property to the object\n Object.defineProperty(obj, '__hooks', {\n configurable: true,\n value: hookData,\n writable: true\n });\n return Object.assign(obj, {\n hooks(allHooks) {\n each(allHooks, (current, type) => {\n // @ts-ignore\n if (!this.__hooks[type]) {\n throw new Error(`'${type}' is not a valid hook type`);\n }\n const hooks = convertHookData(current);\n each(hooks, (_value, method) => {\n if (method !== 'all' && methods.indexOf(method) === -1) {\n throw new Error(`'${method}' is not a valid hook method`);\n }\n });\n methods.forEach(method => {\n // @ts-ignore\n const myHooks = this.__hooks[type][method] || (this.__hooks[type][method] = []);\n if (hooks.all) {\n myHooks.push.apply(myHooks, hooks.all);\n }\n if (hooks[method]) {\n myHooks.push.apply(myHooks, hooks[method]);\n }\n });\n });\n return this;\n }\n });\n}\nexports.enableHooks = enableHooks;\n//# sourceMappingURL=hooks.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createSymbol = exports.makeUrl = exports.isPromise = exports._ = exports.stripSlashes = void 0;\n// Removes all leading and trailing slashes from a path\nfunction stripSlashes(name) {\n return name.replace(/^(\\/+)|(\\/+)$/g, '');\n}\nexports.stripSlashes = stripSlashes;\n// A set of lodash-y utility functions that use ES6\nexports._ = {\n each(obj, callback) {\n if (obj && typeof obj.forEach === 'function') {\n obj.forEach(callback);\n }\n else if (exports._.isObject(obj)) {\n Object.keys(obj).forEach(key => callback(obj[key], key));\n }\n },\n some(value, callback) {\n return Object.keys(value)\n .map(key => [value[key], key])\n .some(([val, key]) => callback(val, key));\n },\n every(value, callback) {\n return Object.keys(value)\n .map(key => [value[key], key])\n .every(([val, key]) => callback(val, key));\n },\n keys(obj) {\n return Object.keys(obj);\n },\n values(obj) {\n return exports._.keys(obj).map(key => obj[key]);\n },\n isMatch(obj, item) {\n return exports._.keys(item).every(key => obj[key] === item[key]);\n },\n isEmpty(obj) {\n return exports._.keys(obj).length === 0;\n },\n isObject(item) {\n return (typeof item === 'object' && !Array.isArray(item) && item !== null);\n },\n isObjectOrArray(value) {\n return typeof value === 'object' && value !== null;\n },\n extend(first, ...rest) {\n return Object.assign(first, ...rest);\n },\n omit(obj, ...keys) {\n const result = exports._.extend({}, obj);\n keys.forEach(key => delete result[key]);\n return result;\n },\n pick(source, ...keys) {\n return keys.reduce((result, key) => {\n if (source[key] !== undefined) {\n result[key] = source[key];\n }\n return result;\n }, {});\n },\n // Recursively merge the source object into the target object\n merge(target, source) {\n if (exports._.isObject(target) && exports._.isObject(source)) {\n Object.keys(source).forEach(key => {\n if (exports._.isObject(source[key])) {\n if (!target[key]) {\n Object.assign(target, { [key]: {} });\n }\n exports._.merge(target[key], source[key]);\n }\n else {\n Object.assign(target, { [key]: source[key] });\n }\n });\n }\n return target;\n }\n};\n// Duck-checks if an object looks like a promise\nfunction isPromise(result) {\n return exports._.isObject(result) &&\n typeof result.then === 'function';\n}\nexports.isPromise = isPromise;\nfunction makeUrl(path, app = {}) {\n const get = typeof app.get === 'function' ? app.get.bind(app) : () => { };\n const env = get('env') || process.env.NODE_ENV;\n const host = get('host') || process.env.HOST_NAME || 'localhost';\n const protocol = (env === 'development' || env === 'test' || (env === undefined)) ? 'http' : 'https';\n const PORT = get('port') || process.env.PORT || 3030;\n const port = (env === 'development' || env === 'test' || (env === undefined)) ? `:${PORT}` : '';\n path = path || '';\n return `${protocol}://${host}${port}/${exports.stripSlashes(path)}`;\n}\nexports.makeUrl = makeUrl;\nfunction createSymbol(name) {\n return typeof Symbol !== 'undefined' ? Symbol(name) : name;\n}\nexports.createSymbol = createSymbol;\n//# sourceMappingURL=utils.js.map","const debug = require('debug')('@feathersjs/errors');\n\nfunction FeathersError (msg, name, code, className, data) {\n msg = msg || 'Error';\n\n let errors;\n let message;\n let newData;\n\n if (msg instanceof Error) {\n message = msg.message || 'Error';\n\n // NOTE (EK): This is typically to handle validation errors\n if (msg.errors) {\n errors = msg.errors;\n }\n } else if (typeof msg === 'object') { // Support plain old objects\n message = msg.message || 'Error';\n data = msg;\n } else { // message is just a string\n message = msg;\n }\n\n if (data) {\n // NOTE(EK): To make sure that we are not messing\n // with immutable data, just make a copy.\n // https://github.com/feathersjs/errors/issues/19\n newData = JSON.parse(JSON.stringify(data));\n\n if (newData.errors) {\n errors = newData.errors;\n delete newData.errors;\n } else if (data.errors) {\n // The errors property from data could be\n // stripped away while cloning resulting newData not to have it\n // For example: when cloning arrays this property\n errors = JSON.parse(JSON.stringify(data.errors));\n }\n }\n\n // NOTE (EK): Babel doesn't support this so\n // we have to pass in the class name manually.\n // this.name = this.constructor.name;\n this.type = 'FeathersError';\n this.name = name;\n this.message = message;\n this.code = code;\n this.className = className;\n this.data = newData;\n this.errors = errors || {};\n\n debug(`${this.name}(${this.code}): ${this.message}`);\n debug(this.errors);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, FeathersError);\n } else {\n this.stack = (new Error()).stack;\n }\n}\n\nfunction inheritsFrom (Child, Parent) {\n Child.prototype = Object.create(Parent.prototype);\n Child.prototype.constructor = Child;\n}\n\ninheritsFrom(FeathersError, Error);\n\n// NOTE (EK): A little hack to get around `message` not\n// being included in the default toJSON call.\nObject.defineProperty(FeathersError.prototype, 'toJSON', {\n value: function () {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n className: this.className,\n data: this.data,\n errors: this.errors\n };\n }\n});\n\n// 400 - Bad Request\nfunction BadRequest (message, data) {\n FeathersError.call(this, message, 'BadRequest', 400, 'bad-request', data);\n}\n\ninheritsFrom(BadRequest, FeathersError);\n\n// 401 - Not Authenticated\nfunction NotAuthenticated (message, data) {\n FeathersError.call(this, message, 'NotAuthenticated', 401, 'not-authenticated', data);\n}\n\ninheritsFrom(NotAuthenticated, FeathersError);\n\n// 402 - Payment Error\nfunction PaymentError (message, data) {\n FeathersError.call(this, message, 'PaymentError', 402, 'payment-error', data);\n}\n\ninheritsFrom(PaymentError, FeathersError);\n\n// 403 - Forbidden\nfunction Forbidden (message, data) {\n FeathersError.call(this, message, 'Forbidden', 403, 'forbidden', data);\n}\n\ninheritsFrom(Forbidden, FeathersError);\n\n// 404 - Not Found\nfunction NotFound (message, data) {\n FeathersError.call(this, message, 'NotFound', 404, 'not-found', data);\n}\n\ninheritsFrom(NotFound, FeathersError);\n\n// 405 - Method Not Allowed\nfunction MethodNotAllowed (message, data) {\n FeathersError.call(this, message, 'MethodNotAllowed', 405, 'method-not-allowed', data);\n}\n\ninheritsFrom(MethodNotAllowed, FeathersError);\n\n// 406 - Not Acceptable\nfunction NotAcceptable (message, data) {\n FeathersError.call(this, message, 'NotAcceptable', 406, 'not-acceptable', data);\n}\n\ninheritsFrom(NotAcceptable, FeathersError);\n\n// 408 - Timeout\nfunction Timeout (message, data) {\n FeathersError.call(this, message, 'Timeout', 408, 'timeout', data);\n}\n\ninheritsFrom(Timeout, FeathersError);\n\n// 409 - Conflict\nfunction Conflict (message, data) {\n FeathersError.call(this, message, 'Conflict', 409, 'conflict', data);\n}\n\ninheritsFrom(Conflict, FeathersError);\n\n// 410 - Gone\nfunction Gone (message, data) {\n FeathersError(this, message, 'Gone', 410, 'gone', data);\n}\n\ninheritsFrom(Gone, FeathersError);\n\n// 411 - Length Required\nfunction LengthRequired (message, data) {\n FeathersError.call(this, message, 'LengthRequired', 411, 'length-required', data);\n}\n\ninheritsFrom(LengthRequired, FeathersError);\n\n// 422 Unprocessable\nfunction Unprocessable (message, data) {\n FeathersError.call(this, message, 'Unprocessable', 422, 'unprocessable', data);\n}\n\ninheritsFrom(Unprocessable, FeathersError);\n\n// 429 Too Many Requests\nfunction TooManyRequests (message, data) {\n FeathersError.call(this, message, 'TooManyRequests', 429, 'too-many-requests', data);\n}\n\ninheritsFrom(TooManyRequests, FeathersError);\n\n// 500 - General Error\nfunction GeneralError (message, data) {\n FeathersError.call(this, message, 'GeneralError', 500, 'general-error', data);\n}\n\ninheritsFrom(GeneralError, FeathersError);\n\n// 501 - Not Implemented\nfunction NotImplemented (message, data) {\n FeathersError.call(this, message, 'NotImplemented', 501, 'not-implemented', data);\n}\n\ninheritsFrom(NotImplemented, FeathersError);\n\n// 502 - Bad Gateway\nfunction BadGateway (message, data) {\n FeathersError.call(this, message, 'BadGateway', 502, 'bad-gateway', data);\n}\n\ninheritsFrom(BadGateway, FeathersError);\n\n// 503 - Unavailable\nfunction Unavailable (message, data) {\n FeathersError.call(this, message, 'Unavailable', 503, 'unavailable', data);\n}\n\ninheritsFrom(Unavailable, FeathersError);\n\nconst errors = {\n FeathersError,\n BadRequest,\n NotAuthenticated,\n PaymentError,\n Forbidden,\n NotFound,\n MethodNotAllowed,\n NotAcceptable,\n Timeout,\n Conflict,\n Gone,\n LengthRequired,\n Unprocessable,\n TooManyRequests,\n GeneralError,\n NotImplemented,\n BadGateway,\n Unavailable,\n 400: BadRequest,\n 401: NotAuthenticated,\n 402: PaymentError,\n 403: Forbidden,\n 404: NotFound,\n 405: MethodNotAllowed,\n 406: NotAcceptable,\n 408: Timeout,\n 409: Conflict,\n 410: Gone,\n 411: LengthRequired,\n 422: Unprocessable,\n 429: TooManyRequests,\n 500: GeneralError,\n 501: NotImplemented,\n 502: BadGateway,\n 503: Unavailable\n};\n\nfunction convert (error) {\n if (!error) {\n return error;\n }\n\n const FeathersError = errors[error.name];\n const result = FeathersError\n ? new FeathersError(error.message, error.data)\n : new Error(error.message || error);\n\n if (typeof error === 'object') {\n Object.assign(result, error);\n }\n\n return result;\n}\n\nmodule.exports = Object.assign({ convert }, errors);\n","/* eslint-env browser */\n\n/**\n * This is the web browser implementation of `debug()`.\n */\n\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = localstorage();\nexports.destroy = (() => {\n\tlet warned = false;\n\n\treturn () => {\n\t\tif (!warned) {\n\t\t\twarned = true;\n\t\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t\t}\n\t};\n})();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n\t'#0000CC',\n\t'#0000FF',\n\t'#0033CC',\n\t'#0033FF',\n\t'#0066CC',\n\t'#0066FF',\n\t'#0099CC',\n\t'#0099FF',\n\t'#00CC00',\n\t'#00CC33',\n\t'#00CC66',\n\t'#00CC99',\n\t'#00CCCC',\n\t'#00CCFF',\n\t'#3300CC',\n\t'#3300FF',\n\t'#3333CC',\n\t'#3333FF',\n\t'#3366CC',\n\t'#3366FF',\n\t'#3399CC',\n\t'#3399FF',\n\t'#33CC00',\n\t'#33CC33',\n\t'#33CC66',\n\t'#33CC99',\n\t'#33CCCC',\n\t'#33CCFF',\n\t'#6600CC',\n\t'#6600FF',\n\t'#6633CC',\n\t'#6633FF',\n\t'#66CC00',\n\t'#66CC33',\n\t'#9900CC',\n\t'#9900FF',\n\t'#9933CC',\n\t'#9933FF',\n\t'#99CC00',\n\t'#99CC33',\n\t'#CC0000',\n\t'#CC0033',\n\t'#CC0066',\n\t'#CC0099',\n\t'#CC00CC',\n\t'#CC00FF',\n\t'#CC3300',\n\t'#CC3333',\n\t'#CC3366',\n\t'#CC3399',\n\t'#CC33CC',\n\t'#CC33FF',\n\t'#CC6600',\n\t'#CC6633',\n\t'#CC9900',\n\t'#CC9933',\n\t'#CCCC00',\n\t'#CCCC33',\n\t'#FF0000',\n\t'#FF0033',\n\t'#FF0066',\n\t'#FF0099',\n\t'#FF00CC',\n\t'#FF00FF',\n\t'#FF3300',\n\t'#FF3333',\n\t'#FF3366',\n\t'#FF3399',\n\t'#FF33CC',\n\t'#FF33FF',\n\t'#FF6600',\n\t'#FF6633',\n\t'#FF9900',\n\t'#FF9933',\n\t'#FFCC00',\n\t'#FFCC33'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\n// eslint-disable-next-line complexity\nfunction useColors() {\n\t// NB: In an Electron preload script, document will be defined but not fully\n\t// initialized. Since we know we're in Chrome, we'll just detect this case\n\t// explicitly\n\tif (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {\n\t\treturn true;\n\t}\n\n\t// Internet Explorer and Edge do not support colors.\n\tif (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\\/(\\d+)/)) {\n\t\treturn false;\n\t}\n\n\t// Is webkit? http://stackoverflow.com/a/16459606/376773\n\t// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632\n\treturn (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||\n\t\t// Is firebug? http://stackoverflow.com/a/398120/376773\n\t\t(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||\n\t\t// Is firefox >= v31?\n\t\t// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||\n\t\t// Double check webkit in userAgent just in case we are in a worker\n\t\t(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\\/(\\d+)/));\n}\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs(args) {\n\targs[0] = (this.useColors ? '%c' : '') +\n\t\tthis.namespace +\n\t\t(this.useColors ? ' %c' : ' ') +\n\t\targs[0] +\n\t\t(this.useColors ? '%c ' : ' ') +\n\t\t'+' + module.exports.humanize(this.diff);\n\n\tif (!this.useColors) {\n\t\treturn;\n\t}\n\n\tconst c = 'color: ' + this.color;\n\targs.splice(1, 0, c, 'color: inherit');\n\n\t// The final \"%c\" is somewhat tricky, because there could be other\n\t// arguments passed either before or after the %c, so we need to\n\t// figure out the correct index to insert the CSS into\n\tlet index = 0;\n\tlet lastC = 0;\n\targs[0].replace(/%[a-zA-Z%]/g, match => {\n\t\tif (match === '%%') {\n\t\t\treturn;\n\t\t}\n\t\tindex++;\n\t\tif (match === '%c') {\n\t\t\t// We only are interested in the *last* %c\n\t\t\t// (the user may have provided their own)\n\t\t\tlastC = index;\n\t\t}\n\t});\n\n\targs.splice(lastC, 0, c);\n}\n\n/**\n * Invokes `console.debug()` when available.\n * No-op when `console.debug` is not a \"function\".\n * If `console.debug` is not available, falls back\n * to `console.log`.\n *\n * @api public\n */\nexports.log = console.debug || console.log || (() => {});\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\nfunction save(namespaces) {\n\ttry {\n\t\tif (namespaces) {\n\t\t\texports.storage.setItem('debug', namespaces);\n\t\t} else {\n\t\t\texports.storage.removeItem('debug');\n\t\t}\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\nfunction load() {\n\tlet r;\n\ttry {\n\t\tr = exports.storage.getItem('debug');\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n\n\t// If debug isn't set in LS, and we're in Electron, try to load $DEBUG\n\tif (!r && typeof process !== 'undefined' && 'env' in process) {\n\t\tr = process.env.DEBUG;\n\t}\n\n\treturn r;\n}\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage() {\n\ttry {\n\t\t// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context\n\t\t// The Browser also has localStorage in the global context.\n\t\treturn localStorage;\n\t} catch (error) {\n\t\t// Swallow\n\t\t// XXX (@Qix-) should we be logging these?\n\t}\n}\n\nmodule.exports = require('./common')(exports);\n\nconst {formatters} = module.exports;\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nformatters.j = function (v) {\n\ttry {\n\t\treturn JSON.stringify(v);\n\t} catch (error) {\n\t\treturn '[UnexpectedJSONParseError]: ' + error.message;\n\t}\n};\n","\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n */\n\nfunction setup(env) {\n\tcreateDebug.debug = createDebug;\n\tcreateDebug.default = createDebug;\n\tcreateDebug.coerce = coerce;\n\tcreateDebug.disable = disable;\n\tcreateDebug.enable = enable;\n\tcreateDebug.enabled = enabled;\n\tcreateDebug.humanize = require('ms');\n\tcreateDebug.destroy = destroy;\n\n\tObject.keys(env).forEach(key => {\n\t\tcreateDebug[key] = env[key];\n\t});\n\n\t/**\n\t* The currently active debug mode names, and names to skip.\n\t*/\n\n\tcreateDebug.names = [];\n\tcreateDebug.skips = [];\n\n\t/**\n\t* Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t*\n\t* Valid key names are a single, lower or upper-case letter, i.e. \"n\" and \"N\".\n\t*/\n\tcreateDebug.formatters = {};\n\n\t/**\n\t* Selects a color for a debug namespace\n\t* @param {String} namespace The namespace string for the for the debug instance to be colored\n\t* @return {Number|String} An ANSI color code for the given namespace\n\t* @api private\n\t*/\n\tfunction selectColor(namespace) {\n\t\tlet hash = 0;\n\n\t\tfor (let i = 0; i < namespace.length; i++) {\n\t\t\thash = ((hash << 5) - hash) + namespace.charCodeAt(i);\n\t\t\thash |= 0; // Convert to 32bit integer\n\t\t}\n\n\t\treturn createDebug.colors[Math.abs(hash) % createDebug.colors.length];\n\t}\n\tcreateDebug.selectColor = selectColor;\n\n\t/**\n\t* Create a debugger with the given `namespace`.\n\t*\n\t* @param {String} namespace\n\t* @return {Function}\n\t* @api public\n\t*/\n\tfunction createDebug(namespace) {\n\t\tlet prevTime;\n\t\tlet enableOverride = null;\n\n\t\tfunction debug(...args) {\n\t\t\t// Disabled?\n\t\t\tif (!debug.enabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst self = debug;\n\n\t\t\t// Set `diff` timestamp\n\t\t\tconst curr = Number(new Date());\n\t\t\tconst ms = curr - (prevTime || curr);\n\t\t\tself.diff = ms;\n\t\t\tself.prev = prevTime;\n\t\t\tself.curr = curr;\n\t\t\tprevTime = curr;\n\n\t\t\targs[0] = createDebug.coerce(args[0]);\n\n\t\t\tif (typeof args[0] !== 'string') {\n\t\t\t\t// Anything else let's inspect with %O\n\t\t\t\targs.unshift('%O');\n\t\t\t}\n\n\t\t\t// Apply any `formatters` transformations\n\t\t\tlet index = 0;\n\t\t\targs[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {\n\t\t\t\t// If we encounter an escaped % then don't increase the array index\n\t\t\t\tif (match === '%%') {\n\t\t\t\t\treturn '%';\n\t\t\t\t}\n\t\t\t\tindex++;\n\t\t\t\tconst formatter = createDebug.formatters[format];\n\t\t\t\tif (typeof formatter === 'function') {\n\t\t\t\t\tconst val = args[index];\n\t\t\t\t\tmatch = formatter.call(self, val);\n\n\t\t\t\t\t// Now we need to remove `args[index]` since it's inlined in the `format`\n\t\t\t\t\targs.splice(index, 1);\n\t\t\t\t\tindex--;\n\t\t\t\t}\n\t\t\t\treturn match;\n\t\t\t});\n\n\t\t\t// Apply env-specific formatting (colors, etc.)\n\t\t\tcreateDebug.formatArgs.call(self, args);\n\n\t\t\tconst logFn = self.log || createDebug.log;\n\t\t\tlogFn.apply(self, args);\n\t\t}\n\n\t\tdebug.namespace = namespace;\n\t\tdebug.useColors = createDebug.useColors();\n\t\tdebug.color = createDebug.selectColor(namespace);\n\t\tdebug.extend = extend;\n\t\tdebug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.\n\n\t\tObject.defineProperty(debug, 'enabled', {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false,\n\t\t\tget: () => enableOverride === null ? createDebug.enabled(namespace) : enableOverride,\n\t\t\tset: v => {\n\t\t\t\tenableOverride = v;\n\t\t\t}\n\t\t});\n\n\t\t// Env-specific initialization logic for debug instances\n\t\tif (typeof createDebug.init === 'function') {\n\t\t\tcreateDebug.init(debug);\n\t\t}\n\n\t\treturn debug;\n\t}\n\n\tfunction extend(namespace, delimiter) {\n\t\tconst newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);\n\t\tnewDebug.log = this.log;\n\t\treturn newDebug;\n\t}\n\n\t/**\n\t* Enables a debug mode by namespaces. This can include modes\n\t* separated by a colon and wildcards.\n\t*\n\t* @param {String} namespaces\n\t* @api public\n\t*/\n\tfunction enable(namespaces) {\n\t\tcreateDebug.save(namespaces);\n\n\t\tcreateDebug.names = [];\n\t\tcreateDebug.skips = [];\n\n\t\tlet i;\n\t\tconst split = (typeof namespaces === 'string' ? namespaces : '').split(/[\\s,]+/);\n\t\tconst len = split.length;\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tif (!split[i]) {\n\t\t\t\t// ignore empty strings\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tnamespaces = split[i].replace(/\\*/g, '.*?');\n\n\t\t\tif (namespaces[0] === '-') {\n\t\t\t\tcreateDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t\t\t} else {\n\t\t\t\tcreateDebug.names.push(new RegExp('^' + namespaces + '$'));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t* Disable debug output.\n\t*\n\t* @return {String} namespaces\n\t* @api public\n\t*/\n\tfunction disable() {\n\t\tconst namespaces = [\n\t\t\t...createDebug.names.map(toNamespace),\n\t\t\t...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)\n\t\t].join(',');\n\t\tcreateDebug.enable('');\n\t\treturn namespaces;\n\t}\n\n\t/**\n\t* Returns true if the given mode name is enabled, false otherwise.\n\t*\n\t* @param {String} name\n\t* @return {Boolean}\n\t* @api public\n\t*/\n\tfunction enabled(name) {\n\t\tif (name[name.length - 1] === '*') {\n\t\t\treturn true;\n\t\t}\n\n\t\tlet i;\n\t\tlet len;\n\n\t\tfor (i = 0, len = createDebug.skips.length; i < len; i++) {\n\t\t\tif (createDebug.skips[i].test(name)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0, len = createDebug.names.length; i < len; i++) {\n\t\t\tif (createDebug.names[i].test(name)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t* Convert regexp to namespace\n\t*\n\t* @param {RegExp} regxep\n\t* @return {String} namespace\n\t* @api private\n\t*/\n\tfunction toNamespace(regexp) {\n\t\treturn regexp.toString()\n\t\t\t.substring(2, regexp.toString().length - 2)\n\t\t\t.replace(/\\.\\*\\?$/, '*');\n\t}\n\n\t/**\n\t* Coerce `val`.\n\t*\n\t* @param {Mixed} val\n\t* @return {Mixed}\n\t* @api private\n\t*/\n\tfunction coerce(val) {\n\t\tif (val instanceof Error) {\n\t\t\treturn val.stack || val.message;\n\t\t}\n\t\treturn val;\n\t}\n\n\t/**\n\t* XXX DO NOT USE. This is a temporary stub function.\n\t* XXX It WILL be removed in the next major release.\n\t*/\n\tfunction destroy() {\n\t\tconsole.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');\n\t}\n\n\tcreateDebug.enable(createDebug.load());\n\n\treturn createDebug;\n}\n\nmodule.exports = setup;\n","const errors = require('@feathersjs/errors');\nconst { _ } = require('@feathersjs/commons');\nconst { sorter, select, AdapterService } = require('@feathersjs/adapter-commons');\nconst sift = require('sift').default;\n\nconst _select = (data, ...args) => {\n const base = select(...args);\n\n return base(JSON.parse(JSON.stringify(data)));\n};\n\nclass Service extends AdapterService {\n constructor (options = {}) {\n super(_.extend({\n id: 'id',\n matcher: sift,\n sorter\n }, options));\n this._uId = options.startId || 0;\n this.store = options.store || {};\n }\n\n async getEntries (params = {}) {\n const { query } = this.filterQuery(params);\n\n return this._find(Object.assign({}, params, {\n paginate: false,\n query\n }));\n }\n\n async _find (params = {}) {\n const { query, filters, paginate } = this.filterQuery(params);\n let values = _.values(this.store).filter(this.options.matcher(query));\n const total = values.length;\n\n if (filters.$sort !== undefined) {\n values.sort(this.options.sorter(filters.$sort));\n }\n\n if (filters.$skip !== undefined) {\n values = values.slice(filters.$skip);\n }\n\n if (filters.$limit !== undefined) {\n values = values.slice(0, filters.$limit);\n }\n\n const result = {\n total,\n limit: filters.$limit,\n skip: filters.$skip || 0,\n data: values.map(value => _select(value, params))\n };\n\n if (!(paginate && paginate.default)) {\n return result.data;\n }\n\n return result;\n }\n\n async _get (id, params = {}) {\n if (id in this.store) {\n const { query } = this.filterQuery(params);\n const value = this.store[id];\n\n if (this.options.matcher(query)(value)) {\n return _select(value, params, this.id);\n }\n }\n\n throw new errors.NotFound(`No record found for id '${id}'`);\n }\n\n // Create without hooks and mixins that can be used internally\n async _create (data, params = {}) {\n if (Array.isArray(data)) {\n return Promise.all(data.map(current => this._create(current, params)));\n }\n\n const id = data[this.id] || this._uId++;\n const current = _.extend({}, data, { [this.id]: id });\n const result = (this.store[id] = current);\n\n return _select(result, params, this.id);\n }\n\n async _update (id, data, params = {}) {\n const oldEntry = await this._get(id);\n // We don't want our id to change type if it can be coerced\n const oldId = oldEntry[this.id];\n\n id = oldId == id ? oldId : id; // eslint-disable-line\n\n this.store[id] = _.extend({}, data, { [this.id]: id });\n\n return this._get(id, params);\n }\n\n async _patch (id, data, params = {}) {\n const patchEntry = entry => {\n const currentId = entry[this.id];\n\n this.store[currentId] = _.extend(this.store[currentId], _.omit(data, this.id));\n\n return _select(this.store[currentId], params, this.id);\n };\n\n if (id === null) {\n const entries = await this.getEntries(params);\n\n return entries.map(patchEntry);\n }\n\n return patchEntry(await this._get(id, params)); // Will throw an error if not found\n }\n\n // Remove without hooks and mixins that can be used internally\n async _remove (id, params = {}) {\n if (id === null) {\n const entries = await this.getEntries(params);\n\n return Promise.all(entries.map(\n current => this._remove(current[this.id], params))\n );\n }\n\n const entry = await this._get(id, params);\n\n delete this.store[id];\n\n return entry;\n }\n}\n\nmodule.exports = options => {\n return new Service(options);\n};\n\nmodule.exports.Service = Service;\n","/**\n * Helpers.\n */\n\nvar s = 1000;\nvar m = s * 60;\nvar h = m * 60;\nvar d = h * 24;\nvar w = d * 7;\nvar y = d * 365.25;\n\n/**\n * Parse or format the given `val`.\n *\n * Options:\n *\n * - `long` verbose formatting [false]\n *\n * @param {String|Number} val\n * @param {Object} [options]\n * @throws {Error} throw an error if val is not a non-empty string or a number\n * @return {String|Number}\n * @api public\n */\n\nmodule.exports = function(val, options) {\n options = options || {};\n var type = typeof val;\n if (type === 'string' && val.length > 0) {\n return parse(val);\n } else if (type === 'number' && isFinite(val)) {\n return options.long ? fmtLong(val) : fmtShort(val);\n }\n throw new Error(\n 'val is not a non-empty string or a valid number. val=' +\n JSON.stringify(val)\n );\n};\n\n/**\n * Parse the given `str` and return milliseconds.\n *\n * @param {String} str\n * @return {Number}\n * @api private\n */\n\nfunction parse(str) {\n str = String(str);\n if (str.length > 100) {\n return;\n }\n var match = /^(-?(?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(\n str\n );\n if (!match) {\n return;\n }\n var n = parseFloat(match[1]);\n var type = (match[2] || 'ms').toLowerCase();\n switch (type) {\n case 'years':\n case 'year':\n case 'yrs':\n case 'yr':\n case 'y':\n return n * y;\n case 'weeks':\n case 'week':\n case 'w':\n return n * w;\n case 'days':\n case 'day':\n case 'd':\n return n * d;\n case 'hours':\n case 'hour':\n case 'hrs':\n case 'hr':\n case 'h':\n return n * h;\n case 'minutes':\n case 'minute':\n case 'mins':\n case 'min':\n case 'm':\n return n * m;\n case 'seconds':\n case 'second':\n case 'secs':\n case 'sec':\n case 's':\n return n * s;\n case 'milliseconds':\n case 'millisecond':\n case 'msecs':\n case 'msec':\n case 'ms':\n return n;\n default:\n return undefined;\n }\n}\n\n/**\n * Short format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtShort(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return Math.round(ms / d) + 'd';\n }\n if (msAbs >= h) {\n return Math.round(ms / h) + 'h';\n }\n if (msAbs >= m) {\n return Math.round(ms / m) + 'm';\n }\n if (msAbs >= s) {\n return Math.round(ms / s) + 's';\n }\n return ms + 'ms';\n}\n\n/**\n * Long format for `ms`.\n *\n * @param {Number} ms\n * @return {String}\n * @api private\n */\n\nfunction fmtLong(ms) {\n var msAbs = Math.abs(ms);\n if (msAbs >= d) {\n return plural(ms, msAbs, d, 'day');\n }\n if (msAbs >= h) {\n return plural(ms, msAbs, h, 'hour');\n }\n if (msAbs >= m) {\n return plural(ms, msAbs, m, 'minute');\n }\n if (msAbs >= s) {\n return plural(ms, msAbs, s, 'second');\n }\n return ms + ' ms';\n}\n\n/**\n * Pluralization helper.\n */\n\nfunction plural(ms, msAbs, n, name) {\n var isPlural = msAbs >= n * 1.5;\n return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');\n}\n","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","/*\n *\n * Copryright 2018, Craig Condon\n * Licensed under MIT\n *\n * Filter JavaScript objects with mongodb queries\n */\n\nfunction typeChecker(type) {\n var typeString = \"[object \" + type + \"]\";\n return function(value) {\n return Object.prototype.toString.call(value) === typeString;\n };\n}\n\n/**\n */\n\nvar isArray = typeChecker(\"Array\");\nvar isObject = typeChecker(\"Object\");\nvar isFunction = typeChecker(\"Function\");\n\nfunction get(obj, key) {\n return isFunction(obj.get) ? obj.get(key) : obj[key];\n}\n\n\nconst nestable = (validator) => (validateOptions, value, key, valueOwner, nestedResults) => {\n if (nestedResults) {\n return Boolean(nestedResults.find(([value, key, valueOwner]) => validator(validateOptions, key, valueOwner)));\n }\n\n return validator(validateOptions, value, key, valueOwner);\n};\n\n/**\n */\n\nconst or = nestable((validator) => {\n return function(validateOptions, value, key, valueOwner, nestedResults) {\n if (!isArray(value) || !value.length) {\n return validator(validateOptions, value);\n }\n for (var i = 0, n = value.length; i < n; i++) {\n if (validator(validateOptions, get(value, i))) return true;\n }\n return false;\n };\n});\n\n/**\n */\n\nfunction and(validator) {\n return function(validateOptions, value, key, valueOwner) {\n if (!isArray(value) || !value.length) {\n return validator(validateOptions, value, key, valueOwner);\n }\n for (var i = 0, n = value.length; i < n; i++) {\n if (!validator(validateOptions, get(value, i), value, valueOwner)) return false;\n }\n return true;\n };\n}\n\nfunction validate(validator, value, key, valueOwner, nestedResults) {\n return validator.validate(validator.options, value, key, valueOwner, nestedResults);\n}\n\nvar defaultExpressions = {\n /**\n */\n\n $eq: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $ne: and(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $gt: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $gte: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $lt: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $lte: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $mod: or(function(test, value) {\n return test(value);\n }),\n\n /**\n */\n\n $in(test, value) {\n return test(value);\n },\n\n /**\n */\n\n $nin: function(test, value) {\n return test(value);\n },\n\n /**\n */\n\n $not: function(test, value, key, valueOwner) {\n return test(value, key, valueOwner);\n },\n\n /**\n */\n\n $type: function(testType, value) {\n return testType(value);\n },\n\n /**\n */\n\n $all: function(allOptions, value, key, valueOwner, nestedResults) {\n return defaultExpressions.$and(allOptions, value, key, valueOwner, nestedResults);\n },\n\n /**\n */\n\n $size: function(sizeMatch, value) {\n return value ? sizeMatch === value.length : false;\n },\n\n /**\n */\n\n $or: function(orOptions, value, key, valueOwner) {\n for (var i = 0, n = orOptions.length; i < n; i++) {\n if (validate(get(orOptions, i), value, key, valueOwner)) {\n return true;\n }\n }\n return false;\n },\n\n /**\n */\n\n $nor: function(validateOptions, value, key, valueOwner) {\n return !defaultExpressions.$or(validateOptions, value, key, valueOwner);\n },\n\n /**\n */\n\n $and: function(validateOptions, value, key, valueOwner, nestedResults) {\n\n if (nestedResults) {\n for (var i = 0, n = validateOptions.length; i < n; i++) {\n if (!validate(get(validateOptions, i), value, key, valueOwner, nestedResults)) {\n return false;\n }\n }\n } else {\n for (var i = 0, n = validateOptions.length; i < n; i++) {\n if (!validate(get(validateOptions, i), value, key, valueOwner, nestedResults)) {\n return false;\n }\n }\n }\n return true;\n },\n\n /**\n */\n\n $regex: or(function(validateOptions, value) {\n return typeof value === \"string\" && validateOptions.test(value);\n }),\n\n /**\n */\n\n $where: function(validateOptions, value, key, valueOwner) {\n return validateOptions.call(value, value, key, valueOwner);\n },\n\n /**\n */\n\n $elemMatch: function(validateOptions, value, key, valueOwner) {\n if (isArray(value)) {\n return !!~search(value, validateOptions);\n }\n return validate(validateOptions, value, key, valueOwner);\n },\n\n /**\n */\n\n $exists: function(validateOptions, value, key, valueOwner) {\n return valueOwner.hasOwnProperty(key) === validateOptions;\n }\n};\n\n/**\n */\n\nvar prepare = {\n /**\n */\n\n $eq: function(query, queryOwner, { comparable, compare }) {\n if (query instanceof RegExp) {\n return or(function(value) {\n return typeof value === \"string\" && query.test(value);\n });\n } else if (query instanceof Function) {\n return or(query);\n } else if (isArray(query) && !query.length) {\n // Special case of a == []\n return or(function(value) {\n return isArray(value) && !value.length;\n });\n } else if (query === null) {\n return or(function(value) {\n //will match both null and undefined\n return value == null;\n });\n }\n return or(function(value) {\n return compare(comparable(value), comparable(query)) === 0;\n });\n },\n\n $gt: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) > 0;\n };\n },\n\n $gte: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) >= 0;\n };\n },\n\n $lt: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) < 0;\n };\n },\n $lte: function(query, queryOwner, { comparable, compare }) {\n return function(value) {\n return compare(comparable(value), comparable(query)) <= 0;\n };\n },\n\n $in: function(query, queryOwner, options) {\n const { comparable } = options;\n return function(value) {\n if (value instanceof Array) {\n for (var i = value.length; i--; ) {\n if (~query.indexOf(comparable(get(value, i)))) {\n return true;\n }\n }\n } else {\n var comparableValue = comparable(value);\n if (comparableValue === value && typeof value === \"object\") {\n for (var i = query.length; i--; ) {\n if (\n String(query[i]) === String(value) &&\n String(value) !== \"[object Object]\"\n ) {\n return true;\n }\n }\n }\n\n /*\n Handles documents that are undefined, whilst also\n having a 'null' element in the parameters to $in.\n */\n if (typeof comparableValue == \"undefined\") {\n for (var i = query.length; i--; ) {\n if (query[i] == null) {\n return true;\n }\n }\n }\n\n /*\n Handles the case of {'field': {$in: [/regexp1/, /regexp2/, ...]}}\n */\n for (var i = query.length; i--; ) {\n var validator = createRootValidator(get(query, i), options);\n var result = validate(validator, comparableValue, i, query);\n if (\n result &&\n String(result) !== \"[object Object]\" &&\n String(comparableValue) !== \"[object Object]\"\n ) {\n return true;\n }\n }\n\n return !!~query.indexOf(comparableValue);\n }\n\n return false;\n };\n },\n\n $nin: function(query, queryOwner, options) {\n const eq = prepare.$in(query, queryOwner, options);\n return function(validateOptions, value, key, valueOwner) {\n return !eq(validateOptions, value, key, valueOwner);\n };\n },\n\n $mod: function(query) {\n return function(value) {\n return value % query[0] == query[1];\n };\n },\n\n /**\n */\n\n $ne: function(query, queryOwner, options) {\n const eq = prepare.$eq(query, queryOwner, options);\n return and(function(validateOptions, value, key, valueOwner) {\n return !eq(validateOptions, value, key, valueOwner);\n });\n },\n\n /**\n */\n\n $and: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $all: function(query, queryOwner, options) {\n return prepare.$and(query, queryOwner, options);\n },\n\n /**\n */\n\n $or: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $nor: function(query, queryOwner, options) {\n return query.map(parse(options));\n },\n\n /**\n */\n\n $not: function(query, queryOwner, options) {\n const validateOptions = parse(options)(query);\n return function(value, key, valueOwner) {\n return !validate(validateOptions, value, key, valueOwner);\n };\n },\n\n $type: function(query) {\n return function(value, key, valueOwner) {\n return value != void 0\n ? value instanceof query || value.constructor == query\n : false;\n };\n },\n\n /**\n */\n\n $regex: function(query, queryOwner) {\n return new RegExp(query, queryOwner.$options);\n },\n\n /**\n */\n\n $where: function(query) {\n return typeof query === \"string\"\n ? new Function(\"obj\", \"return \" + query)\n : query;\n },\n\n /**\n */\n\n $elemMatch: function(query, queryOwner, options) {\n return parse(options)(query);\n },\n\n /**\n */\n\n $exists: function(query) {\n return !!query;\n }\n};\n\n/**\n */\n\nfunction search(array, validator) {\n for (var i = 0; i < array.length; i++) {\n var result = get(array, i);\n if (validate(validator, get(array, i))) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n */\n\nfunction createValidator(options, validate) {\n return { options, validate };\n}\n\n/**\n */\n\nfunction validatedNested({ keyPath, child, query }, value) {\n const results = [];\n findValues(value, keyPath, 0, value, results);\n \n if (results.length === 1) {\n const [value, key, valueOwner] = results[0];\n return validate(child, value, key, valueOwner);\n }\n\n // If the query contains $ne, need to test all elements ANDed together\n var inclusive = query && typeof query.$ne !== \"undefined\";\n var allValid = inclusive;\n const allValues = results.map(([value]) => value);\n\n return validate(child, undefined, undefined, undefined, results);\n // for (var i = 0; i < results.length; i++) {\n // const [value, key, valueOwner] = results[i];\n // var isValid = validate(child, value, key, valueOwner);\n // console.log(isValid, value);\n // if (inclusive) {\n // allValid &= isValid;\n // } else {\n // allValid |= isValid;\n // }\n // }\n // return allValid;\n}\n\n/**\n */\n\nfunction findValues(current, keypath, index, object, values) {\n if (index === keypath.length || current == void 0) {\n values.push([current, keypath[index - 1], object]);\n return;\n }\n\n var k = get(keypath, index);\n\n // ensure that if current is an array, that the current key\n // is NOT an array index. This sort of thing needs to work:\n // sift({'foo.0':42}, [{foo: [42]}]);\n if (isArray(current) && isNaN(Number(k))) {\n for (var i = 0, n = current.length; i < n; i++) {\n findValues(get(current, i), keypath, index, current, values);\n }\n } else {\n findValues(get(current, k), keypath, index + 1, current, values);\n }\n}\n\n/**\n */\n\nfunction createNestedValidator(keyPath, child, query) {\n return createValidator({ keyPath, child, query }, validatedNested);\n}\n\n/**\n * flatten the query\n */\n\nfunction isVanillaObject(value) {\n return (\n value &&\n (value.constructor === Object ||\n value.constructor === Array ||\n value.constructor.toString() === \"function Object() { [native code] }\" ||\n value.constructor.toString() === \"function Array() { [native code] }\")\n );\n}\n\nfunction parse(options) {\n const { comparable, expressions } = options;\n var wrapQuery = function(query) {\n if (!query || !isVanillaObject(query)) {\n query = { $eq: query };\n }\n return query;\n };\n\n var parseQuery = function(query) {\n query = comparable(query);\n\n var validators = [];\n\n for (var key in query) {\n var queryValue = query[key];\n\n if (key === \"$options\") {\n continue;\n }\n\n var expression =\n defaultExpressions[key] || (options && expressions && expressions[key]);\n\n if (expression) {\n if (prepare[key]) {\n queryValue = prepare[key](queryValue, query, options);\n }\n validators.push(createValidator(comparable(queryValue), expression));\n } else {\n if (key.charCodeAt(0) === 36) {\n throw new Error(\"Unknown operation \" + key);\n }\n\n var keyParts = key.split(\".\");\n\n validators.push(\n createNestedValidator(keyParts, parseNested(queryValue), queryValue)\n );\n }\n }\n\n return validators.length === 1\n ? validators[0]\n : createValidator(validators, defaultExpressions.$and);\n };\n\n var parseNested = function(query) {\n query = wrapQuery(query);\n if (isExactObject(query)) {\n return createValidator(query, isEqual);\n }\n return parseQuery(query);\n };\n\n var parseRoot = function(query) {\n return parseQuery(wrapQuery(query));\n };\n\n return parseRoot;\n}\n\nfunction isEqual(a, b) {\n if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) {\n return false;\n }\n\n if (isObject(a)) {\n if (Object.keys(a).length !== Object.keys(b).length) {\n return false;\n }\n\n for (var key in a) {\n if (!isEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n } else if (isArray(a)) {\n if (a.length !== b.length) {\n return false;\n }\n for (var i = 0, n = a.length; i < n; i++) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n } else {\n return a === b;\n }\n}\n\nfunction getAllKeys(value, keys) {\n if (!isObject(value)) {\n return keys;\n }\n for (var key in value) {\n keys.push(key);\n getAllKeys(value[key], keys);\n }\n return keys;\n}\n\nfunction isExactObject(value) {\n const allKeysHash = getAllKeys(value, []).join(\",\");\n return allKeysHash.search(/[$.]/) === -1;\n}\n\n/**\n */\n\nfunction createRootValidator(query, options) {\n var validator = parse(options)(query);\n if (options && options.select) {\n validator = {\n options: validator,\n validate: function(validateOptions, value, key, valueOwner) {\n return validate(\n validateOptions,\n value && options.select(value),\n key,\n valueOwner\n );\n }\n };\n }\n return validator;\n}\n\n/**\n */\n\nexport default function sift(query, options) {\n options = Object.assign({ compare, comparable }, options);\n var validator = createRootValidator(query, options);\n return function(value, key, valueOwner) {\n return validate(validator, value, key, valueOwner);\n };\n}\n\n/**\n */\n\nexport function compare(a, b) {\n if (isEqual(a, b)) return 0;\n if (typeof a === typeof b) {\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n }\n}\n\n/**\n */\n\nexport function comparable(value) {\n if (value instanceof Date) {\n return value.getTime();\n } else if (isArray(value)) {\n return value.map(comparable);\n } else if (value && typeof value.toJSON === \"function\") {\n return value.toJSON();\n } else {\n return value;\n }\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/feathers-localstorage.min.js b/dist/feathers-localstorage.min.js index 801dd3c..38cb185 100644 --- a/dist/feathers-localstorage.min.js +++ b/dist/feathers-localstorage.min.js @@ -1 +1 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.localstorage=e():(t.feathers=t.feathers||{},t.feathers.localstorage=e())}(window,(function(){return r={},t.m=e=[function(t,e,r){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=r(7)("@feathersjs/errors");function i(t,e,r,u,a){var c,s,f;(t=t||"Error")instanceof Error?(s=t.message||"Error",t.errors&&(c=t.errors)):"object"===n(t)?(s=t.message||"Error",a=t):s=t,a&&((f=JSON.parse(JSON.stringify(a))).errors?(c=f.errors,delete f.errors):a.errors&&(c=JSON.parse(JSON.stringify(a.errors)))),this.type="FeathersError",this.name=e,this.message=s,this.code=r,this.className=u,this.data=f,this.errors=c||{},o("".concat(this.name,"(").concat(this.code,"): ").concat(this.message)),o(this.errors),Error.captureStackTrace?Error.captureStackTrace(this,i):this.stack=(new Error).stack}function u(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}function a(t,e){i.call(this,t,"BadRequest",400,"bad-request",e)}function c(t,e){i.call(this,t,"NotAuthenticated",401,"not-authenticated",e)}function s(t,e){i.call(this,t,"PaymentError",402,"payment-error",e)}function f(t,e){i.call(this,t,"Forbidden",403,"forbidden",e)}function l(t,e){i.call(this,t,"NotFound",404,"not-found",e)}function p(t,e){i.call(this,t,"MethodNotAllowed",405,"method-not-allowed",e)}function y(t,e){i.call(this,t,"NotAcceptable",406,"not-acceptable",e)}function h(t,e){i.call(this,t,"Timeout",408,"timeout",e)}function d(t,e){i.call(this,t,"Conflict",409,"conflict",e)}function m(t,e){i.call(this,t,"LengthRequired",411,"length-required",e)}function v(t,e){i.call(this,t,"Unprocessable",422,"unprocessable",e)}function b(t,e){i.call(this,t,"TooManyRequests",429,"too-many-requests",e)}function g(t,e){i.call(this,t,"GeneralError",500,"general-error",e)}function w(t,e){i.call(this,t,"NotImplemented",501,"not-implemented",e)}function O(t,e){i.call(this,t,"BadGateway",502,"bad-gateway",e)}function C(t,e){i.call(this,t,"Unavailable",503,"unavailable",e)}u(i,Error),Object.defineProperty(i.prototype,"toJSON",{value:function(){return{name:this.name,message:this.message,code:this.code,className:this.className,data:this.data,errors:this.errors}}}),u(a,i),u(c,i),u(s,i),u(f,i),u(l,i),u(p,i),u(y,i),u(h,i),u(d,i),u(m,i),u(v,i),u(b,i),u(g,i),u(w,i),u(O,i),u(C,i);var j={FeathersError:i,BadRequest:a,NotAuthenticated:c,PaymentError:s,Forbidden:f,NotFound:l,MethodNotAllowed:p,NotAcceptable:y,Timeout:h,Conflict:d,LengthRequired:m,Unprocessable:v,TooManyRequests:b,GeneralError:g,NotImplemented:w,BadGateway:O,Unavailable:C,400:a,401:c,402:s,403:f,404:l,405:p,406:y,408:h,409:d,411:m,422:v,429:b,500:g,501:w,502:O,503:C};t.exports=Object.assign({convert:function(t){if(!t)return t;var e=j[t.name],r=e?new e(t.message,t.data):new Error(t.message||t);return"object"===n(t)&&Object.assign(r,t),r}},j)},function(t,e,r){"use strict";var n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(10));!function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(3)),e.hooks=o},function(t,e){var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch(t){r=i}try{n="function"==typeof clearTimeout?clearTimeout:u}catch(t){n=u}}();var c,s=[],f=!1,l=-1;function p(){f&&c&&(f=!1,c.length?s=c.concat(s):l=-1,s.length&&y())}function y(){if(!f){var t=a(p);f=!0;for(var e=s.length;e;){for(c=s,s=[];++lt.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){r=t[Symbol.iterator]()},n:function(){var t=r.next();return u=t.done,t},e:function(t){a=!0,i=t},f:function(){try{u||null==r.return||r.return()}finally{if(a)throw i}}}}(r);try{for(i.s();!(u=i.n()).done;){var u=u.value;if(0!=(u=u.direction*e.compare(t[u.key],o[u.key])))return u}}catch(t){i.e(t)}finally{i.f()}return 0}}},function(t,e,r){"use strict";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var r=[],n=!0,o=!1,i=void 0;try{for(var u,a=t[Symbol.iterator]();!(n=(u=a.next()).done)&&(r.push(u.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(o)throw i}}return r}}(t,e)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r