UNPKG

@swissquote/eslint-plugin-swissquote

Version:

- Provide a style guide for your JavaScript - Warns on common mistakes in JavaScript - Works with EcmaScript 2015+

108 lines (99 loc) 3.72 kB
/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ 886: /***/ ((__unused_webpack_module, exports) => { //#region src/index.ts const table = /* @__PURE__ */ new WeakMap(); let counter = 0; const { toString } = Object.prototype; const isType = (arg, type) => toString.call(arg) === `[object ${type}]`; const isPlainObject = (val) => { const prototype = Object.getPrototypeOf(val); return prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null; }; function stableHash(arg, crossRealm) { const type = typeof arg; const constructor = arg === null || arg === void 0 ? void 0 : arg.constructor; const isDate = crossRealm ? isType(arg, "Date") : constructor === Date; if (Object(arg) === arg && !isDate && !(crossRealm ? isType(arg, "RegExp") : constructor === RegExp)) { const arg_ = arg; let result = table.get(arg_); if (result) return result; result = ++counter + "~"; table.set(arg_, result); let index; if (crossRealm ? Array.isArray(arg) : constructor === Array) { const arg_$1 = arg; result = "@"; for (index = 0; index < arg_$1.length; index++) result += stableHash(arg_$1[index], crossRealm) + ","; table.set(arg_$1, result); } else if (crossRealm ? isPlainObject(arg_) : constructor === null || constructor === Object) { result = "#"; const keys = Object.keys(arg_).sort(); while ((index = keys.pop()) !== void 0) { const index_ = index; if (arg_[index_] !== void 0) result += index + ":" + stableHash(arg_[index_], crossRealm) + ","; } table.set(arg_, result); } return result; } if (isDate) return arg.toJSON(); if (type === "symbol") return arg.toString(); return type === "string" ? JSON.stringify(arg) : "" + arg; } //#endregion exports.hash = stableHash; exports.stableHash = stableHash; /***/ }), /***/ 590: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { module.exports = __nccwpck_require__(886); /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __nccwpck_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ var threw = true; /******/ try { /******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__); /******/ threw = false; /******/ } finally { /******/ if(threw) delete __webpack_module_cache__[moduleId]; /******/ } /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ /******/ /* webpack/runtime/compat */ /******/ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/"; /******/ /************************************************************************/ /******/ /******/ // startup /******/ // Load entry module and return exports /******/ // This entry module used 'module' so it can't be inlined /******/ var __webpack_exports__ = __nccwpck_require__(590); /******/ module.exports = __webpack_exports__; /******/ /******/ })() ;